summaryrefslogtreecommitdiff
path: root/include/linux/udp.h
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2018-11-07 14:38:28 +0300
committerDavid S. Miller <davem@davemloft.net>2018-11-08 03:23:04 +0300
commit60fb9567bf30937e6bedfa939d7c8fd4ee6a1b1c (patch)
tree92197dd09800c0f4704f94bfd49ffe2d9a9d664e /include/linux/udp.h
parent7e225619e8afc432fb054ef135f10c11cf8cfc85 (diff)
downloadlinux-60fb9567bf30937e6bedfa939d7c8fd4ee6a1b1c.tar.xz
udp: implement complete book-keeping for encap_needed
The *encap_needed static keys are enabled by UDP tunnels and several UDP encapsulations type, but they are never turned off. This can cause unneeded overall performance degradation for systems where such features are used transiently. This patch introduces complete book-keeping for such keys, decreasing the usage at socket destruction time, if needed, and avoiding that the same socket could increase the key usage multiple times. rfc v3 -> v1: - add socket lock around udp_tunnel_encap_enable() rfc v2 -> rfc v3: - use udp_tunnel_encap_enable() in setsockopt() Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/udp.h')
-rw-r--r--include/linux/udp.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 320d49d85484..a4dafff407fb 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -49,7 +49,12 @@ struct udp_sock {
unsigned int corkflag; /* Cork is required */
__u8 encap_type; /* Is this an Encapsulation socket? */
unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */
- no_check6_rx:1;/* Allow zero UDP6 checksums on RX? */
+ no_check6_rx:1,/* Allow zero UDP6 checksums on RX? */
+ encap_enabled:1; /* This socket enabled encap
+ * processing; UDP tunnels and
+ * different encapsulation layer set
+ * this
+ */
/*
* Following member retains the information to create a UDP header
* when the socket is uncorked.