summaryrefslogtreecommitdiffstats
path: root/include/linux/udp.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-12 09:17:27 +0000
committerPaolo Abeni <pabeni@redhat.com>2023-09-14 16:16:36 +0200
commitac9a7f4ce5dda1472e8f44096f33066c6ec1a3b4 (patch)
tree70a7b9065ac78d7a5825886380984469fab4ca28 /include/linux/udp.h
parentf5f52f0884a595ff99ab1a608643fe4025fca2d5 (diff)
downloadlinux-stable-ac9a7f4ce5dda1472e8f44096f33066c6ec1a3b4.tar.gz
linux-stable-ac9a7f4ce5dda1472e8f44096f33066c6ec1a3b4.tar.bz2
linux-stable-ac9a7f4ce5dda1472e8f44096f33066c6ec1a3b4.zip
udp: lockless UDP_ENCAP_L2TPINUDP / UDP_GRO
Move udp->encap_enabled to udp->udp_flags. Add udp_test_and_set_bit() helper to allow lockless udp_tunnel_encap_enable() implementation. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/linux/udp.h')
-rw-r--r--include/linux/udp.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/udp.h b/include/linux/udp.h
index bb2b87adfbea..0cf83270a4a2 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -39,6 +39,7 @@ enum {
UDP_FLAGS_GRO_ENABLED, /* Request GRO aggregation */
UDP_FLAGS_ACCEPT_FRAGLIST,
UDP_FLAGS_ACCEPT_L4,
+ UDP_FLAGS_ENCAP_ENABLED, /* This socket enabled encap */
};
struct udp_sock {
@@ -52,11 +53,7 @@ struct udp_sock {
int pending; /* Any pending frames ? */
__u8 encap_type; /* Is this an Encapsulation socket? */
- unsigned char encap_enabled:1; /* This socket enabled encap
- * processing; UDP tunnels and
- * different encapsulation layer set
- * this
- */
+
/* indicator bits used by pcflag: */
#define UDPLITE_BIT 0x1 /* set by udplite proto init function */
#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */
@@ -104,6 +101,8 @@ struct udp_sock {
test_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags)
#define udp_set_bit(nr, sk) \
set_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags)
+#define udp_test_and_set_bit(nr, sk) \
+ test_and_set_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags)
#define udp_clear_bit(nr, sk) \
clear_bit(UDP_FLAGS_##nr, &udp_sk(sk)->udp_flags)
#define udp_assign_bit(nr, sk, val) \