Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/dev/pci/ixgbe Pull up following revision(s) (requeste...



details:   https://anonhg.NetBSD.org/src/rev/63e54e197437
branches:  netbsd-9
changeset: 843711:63e54e197437
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Dec 24 17:44:22 2019 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #580):

        sys/dev/pci/ixgbe/ixgbe.c: revision 1.217
        sys/dev/pci/ixgbe/ixgbe.c: revision 1.218
        sys/dev/pci/ixgbe/ixgbe_osdep.c: revision 1.6
        sys/dev/pci/ixgbe/ixv.c: revision 1.143
        sys/dev/pci/ixgbe/ixgbe_osdep.h: revision 1.25

 Use bus_space_barrier() instead of x86 specific *fence instruction.
Written by riastradh@.

 Add missing core lock in ixgbe_handle_mod().

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c       |  13 ++++++++-----
 sys/dev/pci/ixgbe/ixgbe_osdep.c |  11 ++++++++++-
 sys/dev/pci/ixgbe/ixgbe_osdep.h |  18 +++++-------------
 sys/dev/pci/ixgbe/ixv.c         |   6 +++---
 4 files changed, 26 insertions(+), 22 deletions(-)

diffs (142 lines):

diff -r f245c89a1aa9 -r 63e54e197437 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Tue Dec 24 17:42:18 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Tue Dec 24 17:44:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.7 2019/11/19 13:17:44 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.8 2019/12/24 17:44:22 martin Exp $ */
 
 /******************************************************************************
 
@@ -4021,7 +4021,7 @@
                        else
                                msec_delay(1);
                }
-               wmb();
+               IXGBE_WRITE_BARRIER(hw);
 
                /*
                 * In netmap mode, we must preserve the buffers made
@@ -4613,6 +4613,7 @@
        device_t        dev = adapter->dev;
        u32             err, cage_full = 0;
 
+       IXGBE_CORE_LOCK(adapter);
        ++adapter->mod_sicount.ev_count;
        if (adapter->hw.need_crosstalk_fix) {
                switch (hw->mac.type) {
@@ -4630,14 +4631,14 @@
                }
 
                if (!cage_full)
-                       return;
+                       goto out;
        }
 
        err = hw->phy.ops.identify_sfp(hw);
        if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
                device_printf(dev,
                    "Unsupported SFP+ module type was detected.\n");
-               return;
+               goto out;
        }
 
        if (hw->mac.type == ixgbe_mac_82598EB)
@@ -4648,9 +4649,11 @@
        if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
                device_printf(dev,
                    "Setup failure - unsupported SFP+ module type.\n");
-               return;
+               goto out;
        }
        softint_schedule(adapter->msf_si);
+out:
+       IXGBE_CORE_UNLOCK(adapter);
 } /* ixgbe_handle_mod */
 
 
diff -r f245c89a1aa9 -r 63e54e197437 sys/dev/pci/ixgbe/ixgbe_osdep.c
--- a/sys/dev/pci/ixgbe/ixgbe_osdep.c   Tue Dec 24 17:42:18 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_osdep.c   Tue Dec 24 17:44:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_osdep.c,v 1.4 2018/04/04 08:13:07 msaitoh Exp $ */
+/* $NetBSD: ixgbe_osdep.c,v 1.4.8.1 2019/12/24 17:44:22 martin Exp $ */
 
 /******************************************************************************
 
@@ -116,3 +116,12 @@
            ((struct adapter *)hw->back)->osdep.mem_bus_space_handle,
            reg + (offset << 2), val);
 }
+
+inline void
+ixgbe_write_barrier(struct ixgbe_hw *hw)
+{
+       bus_space_barrier(((struct adapter *)hw->back)->osdep.mem_bus_space_tag,
+           ((struct adapter *)hw->back)->osdep.mem_bus_space_handle,
+           0, ((struct adapter *)hw->back)->osdep.mem_size,
+           BUS_SPACE_BARRIER_WRITE);
+}
diff -r f245c89a1aa9 -r 63e54e197437 sys/dev/pci/ixgbe/ixgbe_osdep.h
--- a/sys/dev/pci/ixgbe/ixgbe_osdep.h   Tue Dec 24 17:42:18 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_osdep.h   Tue Dec 24 17:44:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_osdep.h,v 1.23 2018/07/31 09:19:34 msaitoh Exp $ */
+/* $NetBSD: ixgbe_osdep.h,v 1.23.6.1 2019/12/24 17:44:22 martin Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -157,18 +157,6 @@
 /* This device driver's max interrupt numbers. */
 #define IXG_MAX_NINTR          64
 
-#if __FreeBSD_version < 800000
-#if defined(__i386__) || defined(__amd64__)
-#define mb()   __asm volatile("mfence" ::: "memory")
-#define wmb()  __asm volatile("sfence" ::: "memory")
-#define rmb()  __asm volatile("lfence" ::: "memory")
-#else
-#define mb()
-#define rmb()
-#define wmb()
-#endif
-#endif
-
 #if defined(__i386__) || defined(__amd64__)
 static __inline
 void prefetch(void *x)
@@ -241,4 +229,8 @@
 #define IXGBE_WRITE_REG_ARRAY(a, reg, offset, val) \
     ixgbe_write_reg_array(a, reg, offset, val)
 
+extern void ixgbe_write_barrier(struct ixgbe_hw *);
+#define IXGBE_WRITE_BARRIER(a) \
+    ixgbe_write_barrier(a)
+
 #endif /* _IXGBE_OSDEP_H_ */
diff -r f245c89a1aa9 -r 63e54e197437 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Tue Dec 24 17:42:18 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Tue Dec 24 17:44:22 2019 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.125.2.7 2019/11/19 13:17:44 martin Exp $*/
+/*$NetBSD: ixv.c,v 1.125.2.8 2019/12/24 17:44:22 martin Exp $*/
 
 /******************************************************************************
 
@@ -1857,7 +1857,7 @@
                        else
                                break;
                }
-               wmb();
+               IXGBE_WRITE_BARRIER(hw);
                /* Setup the Base and Length of the Rx Descriptor Ring */
                IXGBE_WRITE_REG(hw, IXGBE_VFRDBAL(j),
                    (rdba & 0x00000000ffffffffULL));
@@ -1889,7 +1889,7 @@
                                break;
                        msec_delay(1);
                }
-               wmb();
+               IXGBE_WRITE_BARRIER(hw);
 
                /* Set the Tail Pointer */
 #ifdef DEV_NETMAP



Home | Main Index | Thread Index | Old Index