diff options
author | Eric Dumazet <edumazet@google.com> | 2023-03-16 01:10:11 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-03-17 08:52:05 +0000 |
commit | 164bddace2e03f6005e650cb88f101a66ebdc05a (patch) | |
tree | 862fb745ff1aa864b0f0b3f46d2b39f6c8bd1f48 /net/packet/internal.h | |
parent | 7438344660fa55b33b8234c1797c886eb73667a7 (diff) |
net/packet: convert po->tp_loss to an atomic flag
tp_loss can be read locklessly.
Convert it to an atomic flag to avoid races.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet/internal.h')
-rw-r--r-- | net/packet/internal.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/packet/internal.h b/net/packet/internal.h index 0d16a581e271..9d406a92ede8 100644 --- a/net/packet/internal.h +++ b/net/packet/internal.h @@ -118,8 +118,7 @@ struct packet_sock { struct mutex pg_vec_lock; unsigned long flags; unsigned int running; /* bind_lock must be held */ - unsigned int has_vnet_hdr:1, /* writer must hold sock lock */ - tp_loss:1; + unsigned int has_vnet_hdr:1; /* writer must hold sock lock */ int pressure; int ifindex; /* bound device */ __be16 num; @@ -146,6 +145,7 @@ enum packet_sock_flags { PACKET_SOCK_ORIGDEV, PACKET_SOCK_AUXDATA, PACKET_SOCK_TX_HAS_OFF, + PACKET_SOCK_TP_LOSS, }; static inline void packet_sock_flag_set(struct packet_sock *po, |