aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorLuigi Rizzo <luigi@FreeBSD.org>2014-11-13 00:14:25 +0000
committerLuigi Rizzo <luigi@FreeBSD.org>2014-11-13 00:14:25 +0000
commitad15cc59e95f6bad314fd84768624d9c7a013343 (patch)
tree3c2785a2518c4639cae3aca93e3786f1ce8be3a5 /sys/dev
parent05c4567dd973cc81284f626dc0097ece97c3b19d (diff)
downloadsrc-ad15cc59e95f6bad314fd84768624d9c7a013343.tar.gz
src-ad15cc59e95f6bad314fd84768624d9c7a013343.zip
we need full barriers here
Notes
Notes: svn path=/head/; revision=274457
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/netmap/netmap_monitor.c4
-rw-r--r--sys/dev/netmap/netmap_pipe.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/netmap/netmap_monitor.c b/sys/dev/netmap/netmap_monitor.c
index 485c370d91e2..746abb524d06 100644
--- a/sys/dev/netmap/netmap_monitor.c
+++ b/sys/dev/netmap/netmap_monitor.c
@@ -179,7 +179,7 @@ netmap_monitor_parent_sync(struct netmap_kring *kring, int flags, u_int* ringptr
i = nm_next(i, mlim);
}
- wmb();
+ mb();
mkring->nr_hwtail = i;
mtx_unlock(&mkring->q_lock);
@@ -225,7 +225,7 @@ netmap_monitor_rxsync(struct netmap_kring *kring, int flags)
{
ND("%s %x", kring->name, flags);
kring->nr_hwcur = kring->rcur;
- rmb();
+ mb();
nm_rxsync_finalize(kring);
return 0;
}
diff --git a/sys/dev/netmap/netmap_pipe.c b/sys/dev/netmap/netmap_pipe.c
index ab77f4b6dcde..64828670c35b 100644
--- a/sys/dev/netmap/netmap_pipe.c
+++ b/sys/dev/netmap/netmap_pipe.c
@@ -228,7 +228,7 @@ netmap_pipe_txsync(struct netmap_kring *txkring, int flags)
k = nm_next(k, lim_tx);
}
- wmb(); /* make sure the slots are updated before publishing them */
+ mb(); /* make sure the slots are updated before publishing them */
rxkring->nr_hwtail = j;
txkring->nr_hwcur = k;
txkring->nr_hwtail = nm_prev(k, lim_tx);
@@ -237,7 +237,7 @@ netmap_pipe_txsync(struct netmap_kring *txkring, int flags)
ND(2, "after: hwcur %d hwtail %d cur %d head %d tail %d j %d", txkring->nr_hwcur, txkring->nr_hwtail,
txkring->rcur, txkring->rhead, txkring->rtail, j);
- wmb(); /* make sure rxkring->nr_hwtail is updated before notifying */
+ mb(); /* make sure rxkring->nr_hwtail is updated before notifying */
rxkring->na->nm_notify(rxkring->na, rxkring->ring_id, NR_RX, 0);
return 0;
@@ -253,12 +253,12 @@ netmap_pipe_rxsync(struct netmap_kring *rxkring, int flags)
rxkring->nr_hwcur = rxkring->rhead; /* recover user-relased slots */
ND(5, "hwcur %d hwtail %d cur %d head %d tail %d", rxkring->nr_hwcur, rxkring->nr_hwtail,
rxkring->rcur, rxkring->rhead, rxkring->rtail);
- rmb(); /* paired with the first wmb() in txsync */
+ mb(); /* paired with the first mb() in txsync */
nm_rxsync_finalize(rxkring);
if (oldhwcur != rxkring->nr_hwcur) {
/* we have released some slots, notify the other end */
- wmb(); /* make sure nr_hwcur is updated before notifying */
+ mb(); /* make sure nr_hwcur is updated before notifying */
txkring->na->nm_notify(txkring->na, txkring->ring_id, NR_TX, 0);
}
return 0;