Module Name:    src
Committed By:   msaitoh
Date:           Thu Sep 14 09:25:58 UTC 2017

Modified Files:
        src/sys/dev/pci/ixgbe: ixgbe_type.h ixgbe_vf.h

Log Message:
 Quick hack to fix ixv(4)'s hardware counter. ixgbe_rx_checksum() passes
"struct ixgbe_hw_stats *" even if its a virtual function. The layout between
ixgbe_hw_stats and ixgbevf_hw_stats are different, so ixgbe_rx_checksum()
wrote wrong area if a device is a virtual function. To fix this problem with
small change, move the location of ipcs, ipcs_bad, l4cs and l4cs_bad of
struct ixgbe(vf)_hw_stats to the same location at the biggining of the struct.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/ixgbe/ixgbe_type.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ixgbe/ixgbe_vf.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.26 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.27
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.26	Wed Aug 30 08:49:18 2017
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Thu Sep 14 09:25:58 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_type.h,v 1.26 2017/08/30 08:49:18 msaitoh Exp $ */
+/* $NetBSD: ixgbe_type.h,v 1.27 2017/09/14 09:25:58 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -3799,6 +3799,11 @@ struct ixgbe_fc_info {
 /* Statistics counters collected by the MAC */
 struct ixgbe_hw_stats {
 	char namebuf[32];
+	struct evcnt ipcs;
+	struct evcnt ipcs_bad;
+	struct evcnt l4cs;
+	struct evcnt l4cs_bad;
+
 	struct evcnt crcerrs;
 	struct evcnt illerrc;
 	struct evcnt errbc;
@@ -3878,10 +3883,6 @@ struct ixgbe_hw_stats {
 	struct evcnt o2bspc;
 	struct evcnt legint;	/* legacy interrupts */
 	struct evcnt intzero;	/* no legacy interrupt conditions */
-	struct evcnt ipcs;
-	struct evcnt ipcs_bad;
-	struct evcnt l4cs;
-	struct evcnt l4cs_bad;
 };
 
 /* forward declaration */

Index: src/sys/dev/pci/ixgbe/ixgbe_vf.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_vf.h:1.9 src/sys/dev/pci/ixgbe/ixgbe_vf.h:1.10
--- src/sys/dev/pci/ixgbe/ixgbe_vf.h:1.9	Wed Aug 30 08:49:18 2017
+++ src/sys/dev/pci/ixgbe/ixgbe_vf.h	Thu Sep 14 09:25:58 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_vf.h,v 1.9 2017/08/30 08:49:18 msaitoh Exp $ */
+/* $NetBSD: ixgbe_vf.h,v 1.10 2017/09/14 09:25:58 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -93,6 +93,11 @@
 
 struct ixgbevf_hw_stats {
 	char namebuf[32];
+	struct evcnt ipcs;
+	struct evcnt ipcs_bad;
+	struct evcnt l4cs;
+	struct evcnt l4cs_bad;
+
 	u64 base_vfgprc;
 	u64 base_vfgptc;
 	u64 base_vfgorc;
@@ -116,11 +121,6 @@ struct ixgbevf_hw_stats {
 	u64 saved_reset_vfgorc;
 	u64 saved_reset_vfgotc;
 	u64 saved_reset_vfmprc;
-
-	struct evcnt ipcs;
-	struct evcnt ipcs_bad;
-	struct evcnt l4cs;
-	struct evcnt l4cs_bad;
 };
 
 s32 ixgbe_init_ops_vf(struct ixgbe_hw *hw);

Reply via email to