summaryrefslogtreecommitdiffstats
path: root/include/net/udp.h
diff options
context:
space:
mode:
authorTom Herbert2014-08-22 22:34:44 +0200
committerDavid S. Miller2014-08-25 03:09:24 +0200
commit57c67ff4bd92af634f7c91c40eb02a96dd785dda (patch)
treef10aac8b764b6254075ebcba255285140d1cabea /include/net/udp.h
parenttcp: Call skb_gro_checksum_validate (diff)
downloadkernel-qcow2-linux-57c67ff4bd92af634f7c91c40eb02a96dd785dda.tar.gz
kernel-qcow2-linux-57c67ff4bd92af634f7c91c40eb02a96dd785dda.tar.xz
kernel-qcow2-linux-57c67ff4bd92af634f7c91c40eb02a96dd785dda.zip
udp: additional GRO support
Implement GRO for UDPv6. Add UDP checksum verification in gro_receive for both UDP4 and UDP6 calling skb_gro_checksum_validate_zero_check. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/udp.h')
-rw-r--r--include/net/udp.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index 70f941368ace..16f4e80f0519 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -158,6 +158,24 @@ static inline __sum16 udp_v4_check(int len, __be32 saddr,
void udp_set_csum(bool nocheck, struct sk_buff *skb,
__be32 saddr, __be32 daddr, int len);
+struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb,
+ struct udphdr *uh);
+int udp_gro_complete(struct sk_buff *skb, int nhoff);
+
+static inline struct udphdr *udp_gro_udphdr(struct sk_buff *skb)
+{
+ struct udphdr *uh;
+ unsigned int hlen, off;
+
+ off = skb_gro_offset(skb);
+ hlen = off + sizeof(*uh);
+ uh = skb_gro_header_fast(skb, off);
+ if (skb_gro_header_hard(skb, hlen))
+ uh = skb_gro_header_slow(skb, hlen, off);
+
+ return uh;
+}
+
/* hash routines shared between UDPv4/6 and UDP-Litev4/6 */
static inline void udp_lib_hash(struct sock *sk)
{