diff options
author | Paolo Abeni <pabeni@redhat.com> | 2018-11-07 06:38:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-07 19:23:04 -0500 |
commit | bcd1665e3569b0a6f569514f023a41fc7df0b4a3 (patch) | |
tree | 4e28d9a2711bdfa1069efdfb49350ede0e1d97f7 /include/linux/udp.h | |
parent | e20cf8d3f1f763ad28a9cb3b41305b8a8a42653e (diff) |
udp: add support for UDP_GRO cmsg
When UDP GRO is enabled, the UDP_GRO cmsg will carry the ingress
datagram size. User-space can use such info to compute the original
packets layout.
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.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/udp.h b/include/linux/udp.h index f613b329852e..e23d5024f42f 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -121,6 +121,17 @@ static inline bool udp_get_no_check6_rx(struct sock *sk) | |||
121 | return udp_sk(sk)->no_check6_rx; | 121 | return udp_sk(sk)->no_check6_rx; |
122 | } | 122 | } |
123 | 123 | ||
124 | static inline void udp_cmsg_recv(struct msghdr *msg, struct sock *sk, | ||
125 | struct sk_buff *skb) | ||
126 | { | ||
127 | int gso_size; | ||
128 | |||
129 | if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) { | ||
130 | gso_size = skb_shinfo(skb)->gso_size; | ||
131 | put_cmsg(msg, SOL_UDP, UDP_GRO, sizeof(gso_size), &gso_size); | ||
132 | } | ||
133 | } | ||
134 | |||
124 | #define udp_portaddr_for_each_entry(__sk, list) \ | 135 | #define udp_portaddr_for_each_entry(__sk, list) \ |
125 | hlist_for_each_entry(__sk, list, __sk_common.skc_portaddr_node) | 136 | hlist_for_each_entry(__sk, list, __sk_common.skc_portaddr_node) |
126 | 137 | ||