Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Quick hack to fix ixv(4)'s hardware counte...



details:   https://anonhg.NetBSD.org/src/rev/c8ef5369b7b8
branches:  trunk
changeset: 826572:c8ef5369b7b8
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Sep 14 09:25:58 2017 +0000

description:
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.

diffstat:

 sys/dev/pci/ixgbe/ixgbe_type.h |  11 ++++++-----
 sys/dev/pci/ixgbe/ixgbe_vf.h   |  12 ++++++------
 2 files changed, 12 insertions(+), 11 deletions(-)

diffs (65 lines):

diff -r 4c01d6830ca8 -r c8ef5369b7b8 sys/dev/pci/ixgbe/ixgbe_type.h
--- a/sys/dev/pci/ixgbe/ixgbe_type.h    Thu Sep 14 08:52:41 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_type.h    Thu Sep 14 09:25:58 2017 +0000
@@ -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 @@
 /* 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 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 */
diff -r 4c01d6830ca8 -r c8ef5369b7b8 sys/dev/pci/ixgbe/ixgbe_vf.h
--- a/sys/dev/pci/ixgbe/ixgbe_vf.h      Thu Sep 14 08:52:41 2017 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_vf.h      Thu Sep 14 09:25:58 2017 +0000
@@ -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 @@
        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);



Home | Main Index | Thread Index | Old Index