summaryrefslogtreecommitdiff
path: root/include/net/udp.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-04-07 23:53:37 +0300
committerDavid S. Miller <davem@davemloft.net>2016-04-07 23:53:37 +0300
commitba35855e24d12d872e6173692bc34d48d96db39c (patch)
treed7c064a02842bad233e6aaaf9be93f95565c269f /include/net/udp.h
parent1fbbe1a8a9b195c4ac856540dfaef49d663c2e91 (diff)
parent46aa2f30aa7fe03a4dcd732b009284c02ff4f093 (diff)
downloadlinux-ba35855e24d12d872e6173692bc34d48d96db39c.tar.xz
Merge branch 'gro-in-udp'
Tom Herbert says: ==================== udp: GRO in UDP sockets This patch set adds GRO functions (gro_receive and gro_complete) to UDP sockets and removes udp_offload infrastructure. Add GRO functions (gro_receive and gro_complete) to UDP sockets. In udp_gro_receive and udp_gro_complete a socket lookup is done instead of looking up the port number in udp_offloads. If a socket is found and there are GRO functions for it then those are called. This feature allows binding GRO functions to more than just a port number. Eventually, we will be able to use this technique to allow application defined GRO for an application protocol by attaching BPF porgrams to UDP sockets for doing GRO. In order to implement these functions, we added exported udp6_lib_lookup_skb and udp4_lib_lookup_skb functions in ipv4/udp.c and ipv6/udp.c. Also, inet_iif and references to skb_dst() were changed to check that dst is set in skbuf before derefencing. In the GRO path there is now a UDP socket lookup performed before dst is set, to the get the device in that case we simply use skb->dev. Tested: Ran various combinations of VXLAN and GUE TCP_STREAM and TCP_RR tests. Did not see any material regression. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/udp.h')
-rw-r--r--include/net/udp.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/net/udp.h b/include/net/udp.h
index a0b0da97164c..3c5a65e0946d 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -167,9 +167,12 @@ static inline void udp_csum_pull_header(struct sk_buff *skb)
UDP_SKB_CB(skb)->cscov -= sizeof(struct udphdr);
}
+typedef struct sock *(*udp_lookup_t)(struct sk_buff *skb, __be16 sport,
+ __be16 dport);
+
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);
+ struct udphdr *uh, udp_lookup_t lookup);
+int udp_gro_complete(struct sk_buff *skb, int nhoff, udp_lookup_t lookup);
static inline struct udphdr *udp_gro_udphdr(struct sk_buff *skb)
{
@@ -269,6 +272,8 @@ struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
__be32 daddr, __be16 dport, int dif,
struct udp_table *tbl, struct sk_buff *skb);
+struct sock *udp4_lib_lookup_skb(struct sk_buff *skb,
+ __be16 sport, __be16 dport);
struct sock *udp6_lib_lookup(struct net *net,
const struct in6_addr *saddr, __be16 sport,
const struct in6_addr *daddr, __be16 dport,
@@ -278,6 +283,8 @@ struct sock *__udp6_lib_lookup(struct net *net,
const struct in6_addr *daddr, __be16 dport,
int dif, struct udp_table *tbl,
struct sk_buff *skb);
+struct sock *udp6_lib_lookup_skb(struct sk_buff *skb,
+ __be16 sport, __be16 dport);
/*
* SNMP statistics for UDP and UDP-Lite