Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107930580
D38061.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
994 B
Referenced Files
None
Subscribers
None
D38061.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D38061: netmap: Tell the compiler to avoid reloading ring indices
Attached
Detach File
Event Timeline
Log In to Comment