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
@ -2768,7 +2768,7 @@ static int do_setlink(const struct sk_buff *skb,
|
||||
}
|
||||
|
||||
if (dev->gso_max_segs ^ max_segs) {
|
||||
dev->gso_max_segs = max_segs;
|
||||
netif_set_gso_max_segs(dev, max_segs);
|
||||
status |= DO_SETLINK_MODIFIED;
|
||||
}
|
||||
}
|
||||
@ -3222,7 +3222,7 @@ struct net_device *rtnl_create_link(struct net *net, const char *ifname,
|
||||
if (tb[IFLA_GSO_MAX_SIZE])
|
||||
netif_set_gso_max_size(dev, nla_get_u32(tb[IFLA_GSO_MAX_SIZE]));
|
||||
if (tb[IFLA_GSO_MAX_SEGS])
|
||||
dev->gso_max_segs = nla_get_u32(tb[IFLA_GSO_MAX_SEGS]);
|
||||
netif_set_gso_max_segs(dev, nla_get_u32(tb[IFLA_GSO_MAX_SEGS]));
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
Reference in New Issue
Block a user