Page MenuHomeFreeBSD

D38061.diff
No OneTemporary

D38061.diff

diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c
--- a/sys/dev/netmap/netmap.c
+++ b/sys/dev/netmap/netmap.c
@@ -1710,8 +1710,8 @@
u_int
nm_txsync_prologue(struct netmap_kring *kring, struct netmap_ring *ring)
{
- u_int head = ring->head; /* read only once */
- u_int cur = ring->cur; /* read only once */
+ u_int head = NM_ACCESS_ONCE(ring->head);
+ u_int cur = NM_ACCESS_ONCE(ring->cur);
u_int n = kring->nkr_num_slots;
nm_prdis(5, "%s kcur %d ktail %d head %d cur %d tail %d",
@@ -1788,8 +1788,8 @@
* - cur could in principle go back, however it does not matter
* because we are processing a brand new rxsync()
*/
- cur = kring->rcur = ring->cur; /* read only once */
- head = kring->rhead = ring->head; /* read only once */
+ cur = kring->rcur = NM_ACCESS_ONCE(ring->cur);
+ head = kring->rhead = NM_ACCESS_ONCE(ring->head);
#if 1 /* kernel sanity checks */
NM_FAIL_ON(kring->nr_hwcur >= n || kring->nr_hwtail >= n);
#endif /* kernel sanity checks */

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 20, 3:01 PM (20 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15978994
Default Alt Text
D38061.diff (994 B)

Event Timeline