net: annotate accesses to dev->gso_max_segs
dev->gso_max_segs is written under RTNL protection, or when the device is not yet visible, but is read locklessly. Add netif_set_gso_max_segs() helper. Add the READ_ONCE()/WRITE_ONCE() pairs, and use netif_set_gso_max_segs() where we can to better document what is going on. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
4b66d2161b
commit
6d872df3e3
@@ -3396,7 +3396,7 @@ static netdev_features_t gso_features_check(const struct sk_buff *skb,
|
||||
{
|
||||
u16 gso_segs = skb_shinfo(skb)->gso_segs;
|
||||
|
||||
if (gso_segs > dev->gso_max_segs)
|
||||
if (gso_segs > READ_ONCE(dev->gso_max_segs))
|
||||
return features & ~NETIF_F_GSO_MASK;
|
||||
|
||||
if (!skb_shinfo(skb)->gso_type) {
|
||||
|
||||
Reference in New Issue
Block a user