From patchwork Thu Jun 30 08:06:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pravin Shelar X-Patchwork-Id: 642420 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rgBxM0J49z9s9n for ; Thu, 30 Jun 2016 18:08:07 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 0CB5D1075A; Thu, 30 Jun 2016 01:07:24 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id A686310712 for ; Thu, 30 Jun 2016 01:07:21 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 396D742031D for ; Thu, 30 Jun 2016 02:07:21 -0600 (MDT) X-ASG-Debug-ID: 1467274040-09eadd4848f79d0001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id 6AxgwZEAB023ECLW (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 30 Jun 2016 02:07:20 -0600 (MDT) X-Barracuda-Envelope-From: pshelar@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO relay5-d.mail.gandi.net) (217.70.183.197) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 30 Jun 2016 08:07:20 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at ovn.org designates 217.70.183.197 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.197 X-Barracuda-RBL-IP: 217.70.183.197 Received: from mfilter42-d.gandi.net (mfilter42-d.gandi.net [217.70.178.172]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 39B0341C0AC; Thu, 30 Jun 2016 10:07:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter42-d.gandi.net Received: from relay5-d.mail.gandi.net ([IPv6:::ffff:217.70.183.197]) by mfilter42-d.gandi.net (mfilter42-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id a4XZ3FiXh9Zh; Thu, 30 Jun 2016 10:07:17 +0200 (CEST) X-Originating-IP: 24.130.10.65 Received: from localhost.localdomain.localdomain (c-24-130-10-65.hsd1.ca.comcast.net [24.130.10.65]) (Authenticated sender: pshelar@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id F2FA441C0D0; Thu, 30 Jun 2016 10:07:16 +0200 (CEST) X-CudaMail-Envelope-Sender: pshelar@ovn.org From: Pravin B Shelar To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-629002200 X-CudaMail-DTE: 063016 X-CudaMail-Originating-IP: 217.70.183.197 Date: Thu, 30 Jun 2016 01:06:28 -0700 X-ASG-Orig-Subj: [##CM-E1-629002200##][PATCH v2 11/24] datapath: backport: udp: Add socket based GRO and config Message-Id: <1467274002-61390-11-git-send-email-pshelar@ovn.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1467274002-61390-1-git-send-email-pshelar@ovn.org> References: <1467274002-61390-1-git-send-email-pshelar@ovn.org> X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1467274040 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH v2 11/24] datapath: backport: udp: Add socket based GRO and config X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Upstream commit: commit 38fd2af24fcfda93f9fea3e53f26e48775ae9e09 Author: Tom Herbert udp: Add socket based GRO and config Add gro_receive and gro_complete to struct udp_tunnel_sock_cfg. Signed-off-by: Tom Herbert Signed-off-by: David S. Miller Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- acinclude.m4 | 2 ++ datapath/linux/compat/include/net/udp_tunnel.h | 9 +++++++++ datapath/linux/compat/udp_tunnel.c | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index dd453bf..f2099bc 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -614,6 +614,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/net/udp.h], [udp_v4_check]) OVS_GREP_IFELSE([$KSRC/include/net/udp.h], [udp_set_csum]) OVS_GREP_IFELSE([$KSRC/include/net/udp_tunnel.h], [udp_tunnel_gro_complete]) + OVS_FIND_FIELD_IFELSE([$KSRC/include/net/udp_tunnel.h], [udp_tunnel_sock_cfg], + [gro_receive]) OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [ignore_df], [OVS_DEFINE([HAVE_IGNORE_DF_RENAME])]) diff --git a/datapath/linux/compat/include/net/udp_tunnel.h b/datapath/linux/compat/include/net/udp_tunnel.h index 3f02c79..7086216 100644 --- a/datapath/linux/compat/include/net/udp_tunnel.h +++ b/datapath/linux/compat/include/net/udp_tunnel.h @@ -73,6 +73,11 @@ 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 */ @@ -80,6 +85,10 @@ struct udp_tunnel_sock_cfg { __u8 encap_type; udp_tunnel_encap_rcv_t encap_rcv; udp_tunnel_encap_destroy_t encap_destroy; +#ifdef HAVE_UDP_TUNNEL_SOCK_CFG_GRO_RECEIVE + udp_tunnel_gro_receive_t gro_receive; + udp_tunnel_gro_complete_t gro_complete; +#endif }; /* Setup the given (UDP) sock to receive UDP encapsulated packets */ diff --git a/datapath/linux/compat/udp_tunnel.c b/datapath/linux/compat/udp_tunnel.c index 4e2c64d..d5dbad1 100644 --- a/datapath/linux/compat/udp_tunnel.c +++ b/datapath/linux/compat/udp_tunnel.c @@ -132,6 +132,10 @@ void rpl_setup_udp_tunnel_sock(struct net *net, struct socket *sock, #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0) udp_sk(sk)->encap_destroy = cfg->encap_destroy; #endif +#ifdef HAVE_UDP_TUNNEL_SOCK_CFG_GRO_RECEIVE + udp_sk(sk)->gro_receive = cfg->gro_receive; + udp_sk(sk)->gro_complete = cfg->gro_complete; +#endif udp_tunnel_encap_enable(sock); }