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 Use bus_space_barrier() instead of x86 spe...
details: https://anonhg.NetBSD.org/src/rev/ed973dcf3c97
branches: trunk
changeset: 466287:ed973dcf3c97
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Tue Dec 17 05:49:01 2019 +0000
description:
Use bus_space_barrier() instead of x86 specific *fence instruction.
Written by riastradh@.
diffstat:
sys/dev/pci/ixgbe/ixgbe.c | 4 ++--
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, 20 insertions(+), 19 deletions(-)
diffs (104 lines):
diff -r 66981f736e61 -r ed973dcf3c97 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Tue Dec 17 04:54:36 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Tue Dec 17 05:49:01 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.216 2019/11/18 03:17:51 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.217 2019/12/17 05:49:01 msaitoh Exp $ */
/******************************************************************************
@@ -4016,7 +4016,7 @@
else
msec_delay(1);
}
- wmb();
+ IXGBE_WRITE_BARRIER(hw);
/*
* In netmap mode, we must preserve the buffers made
diff -r 66981f736e61 -r ed973dcf3c97 sys/dev/pci/ixgbe/ixgbe_osdep.c
--- a/sys/dev/pci/ixgbe/ixgbe_osdep.c Tue Dec 17 04:54:36 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_osdep.c Tue Dec 17 05:49:01 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_osdep.c,v 1.5 2019/12/16 02:50:54 msaitoh Exp $ */
+/* $NetBSD: ixgbe_osdep.c,v 1.6 2019/12/17 05:49:01 msaitoh 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 66981f736e61 -r ed973dcf3c97 sys/dev/pci/ixgbe/ixgbe_osdep.h
--- a/sys/dev/pci/ixgbe/ixgbe_osdep.h Tue Dec 17 04:54:36 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_osdep.h Tue Dec 17 05:49:01 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_osdep.h,v 1.24 2019/12/16 02:50:54 msaitoh Exp $ */
+/* $NetBSD: ixgbe_osdep.h,v 1.25 2019/12/17 05:49:01 msaitoh 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 66981f736e61 -r ed973dcf3c97 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c Tue Dec 17 04:54:36 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c Tue Dec 17 05:49:01 2019 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.142 2019/12/16 02:50:54 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.143 2019/12/17 05:49:01 msaitoh Exp $*/
/******************************************************************************
@@ -1844,7 +1844,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));
@@ -1876,7 +1876,7 @@
break;
msec_delay(1);
}
- wmb();
+ IXGBE_WRITE_BARRIER(hw);
/* Set the Tail Pointer */
#ifdef DEV_NETMAP
Home |
Main Index |
Thread Index |
Old Index