svn commit: r274457 - head/sys/dev/netmap
Luigi Rizzo
luigi at FreeBSD.org
Thu Nov 13 00:14:26 UTC 2014
Author: luigi
Date: Thu Nov 13 00:14:25 2014
New Revision: 274457
URL: https://svnweb.freebsd.org/changeset/base/274457
Log:
we need full barriers here
Modified:
head/sys/dev/netmap/netmap_monitor.c
head/sys/dev/netmap/netmap_pipe.c
Modified: head/sys/dev/netmap/netmap_monitor.c
==============================================================================
--- head/sys/dev/netmap/netmap_monitor.c Wed Nov 12 23:29:22 2014 (r274456)
+++ head/sys/dev/netmap/netmap_monitor.c Thu Nov 13 00:14:25 2014 (r274457)
@@ -179,7 +179,7 @@ netmap_monitor_parent_sync(struct netmap
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_krin
{
ND("%s %x", kring->name, flags);
kring->nr_hwcur = kring->rcur;
- rmb();
+ mb();
nm_rxsync_finalize(kring);
return 0;
}
Modified: head/sys/dev/netmap/netmap_pipe.c
==============================================================================
--- head/sys/dev/netmap/netmap_pipe.c Wed Nov 12 23:29:22 2014 (r274456)
+++ head/sys/dev/netmap/netmap_pipe.c Thu Nov 13 00:14:25 2014 (r274457)
@@ -228,7 +228,7 @@ netmap_pipe_txsync(struct netmap_kring *
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 *
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->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;
More information about the svn-src-head
mailing list