netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Herbert <tom@herbertland.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: <kernel-team@fb.com>
Subject: [PATCH RFC 5/9] udp: Add socket based GRO and fast receive encap to tunnel config
Date: Wed, 23 Mar 2016 15:36:54 -0700	[thread overview]
Message-ID: <1458772618-845742-6-git-send-email-tom@herbertland.com> (raw)
In-Reply-To: <1458772618-845742-1-git-send-email-tom@herbertland.com>

Add gro_receive, gro_complete and encap_fast to
struct udp_tunnel_sock_cfg.

Signed-off-by: Tom Herbert <tom@herbertland.com>
---
 include/net/udp_tunnel.h | 8 ++++++++
 net/ipv4/udp_tunnel.c    | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h
index b831140..3c534e7 100644
--- a/include/net/udp_tunnel.h
+++ b/include/net/udp_tunnel.h
@@ -64,13 +64,21 @@ static inline int udp_sock_create(struct net *net,
 
 typedef int (*udp_tunnel_encap_rcv_t)(struct sock *sk, struct sk_buff *skb);
 typedef void (*udp_tunnel_encap_destroy_t)(struct sock *sk);
+typedef struct sk_buff **(*udp_tunnel_gro_receive_t)(struct sock *sk,
+						     struct sk_buff **head,
+						     struct sk_buff *skb);
+typedef int (*udp_tunnel_gro_complete_t)(struct sock *sk, struct sk_buff *skb,
+					 int nhoff);
 
 struct udp_tunnel_sock_cfg {
 	void *sk_user_data;     /* user data used by encap_rcv call back */
 	/* Used for setting up udp_sock fields, see udp.h for details */
 	__u8  encap_type;
+	__u8 encap_fast:1;
 	udp_tunnel_encap_rcv_t encap_rcv;
 	udp_tunnel_encap_destroy_t encap_destroy;
+	udp_tunnel_gro_receive_t gro_receive;
+	udp_tunnel_gro_complete_t gro_complete;
 };
 
 /* Setup the given (UDP) sock to receive UDP encapsulated packets */
diff --git a/net/ipv4/udp_tunnel.c b/net/ipv4/udp_tunnel.c
index 96599d1..b5b13f8 100644
--- a/net/ipv4/udp_tunnel.c
+++ b/net/ipv4/udp_tunnel.c
@@ -69,6 +69,9 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock,
 	udp_sk(sk)->encap_type = cfg->encap_type;
 	udp_sk(sk)->encap_rcv = cfg->encap_rcv;
 	udp_sk(sk)->encap_destroy = cfg->encap_destroy;
+	udp_sk(sk)->encap_fast = cfg->encap_fast;
+	udp_sk(sk)->gro_receive = cfg->gro_receive;
+	udp_sk(sk)->gro_complete = cfg->gro_complete;
 
 	udp_tunnel_encap_enable(sock);
 }
-- 
2.8.0.rc2

  parent reply	other threads:[~2016-03-23 22:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 22:36 [PATCH RFC 0/9] udp: GRO in UDP sockets and fast encap_rcv Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 1/9] net: Check skb_dst for NULL in inet_iif Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 2/9] udp: Add noreference lookup functions Tom Herbert
2016-03-23 22:59   ` Eric Dumazet
2016-03-23 23:17     ` Tom Herbert
2016-03-23 23:28       ` Eric Dumazet
2016-03-23 22:36 ` [PATCH RFC 3/9] net: Add fast receive encapsulation Tom Herbert
2016-03-25 20:40   ` David Miller
2016-03-25 22:31     ` Joe Perches
2016-03-23 22:36 ` [PATCH RFC 4/9] udp: Add GRO functions to UDP socket Tom Herbert
2016-03-23 22:36 ` Tom Herbert [this message]
2016-03-23 22:36 ` [PATCH RFC 6/9] vxlan: change vxlan to use UDP socket GRO Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 7/9] fou: change to use UDP socket GRO and fast rcv encap Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 8/9] geneve: change to use UDP socket GRO Tom Herbert
2016-03-23 22:36 ` [PATCH RFC 9/9] udp: Remove udp_offloads Tom Herbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458772618-845742-6-git-send-email-tom@herbertland.com \
    --to=tom@herbertland.com \
    --cc=davem@davemloft.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).