aboutsummaryrefslogtreecommitdiff
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
authorHåkon Bugge <[email protected]>2017-07-20 12:28:55 +0200
committerDavid S. Miller <[email protected]>2017-07-20 15:33:01 -0700
commite623a48ee433985f6ca0fb238f0002cc2eccdf53 (patch)
treee3dc5acbe886b14e0dde4296b6b78748ac7175cd /net/switchdev/switchdev.c
parent070f9c658a59f9a736b1c040001d37b0952e778e (diff)
rds: Make sure updates to cp_send_gen can be observed
cp->cp_send_gen is treated as a normal variable, although it may be used by different threads. This is fixed by using {READ,WRITE}_ONCE when it is incremented and READ_ONCE when it is read outside the {acquire,release}_in_xmit protection. Normative reference from the Linux-Kernel Memory Model: Loads from and stores to shared (but non-atomic) variables should be protected with the READ_ONCE(), WRITE_ONCE(), and ACCESS_ONCE(). Clause 5.1.2.4/25 in the C standard is also relevant. Signed-off-by: Håkon Bugge <[email protected]> Reviewed-by: Knut Omang <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions