From patchwork Sun Jan 5 15:23:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Or Gerlitz X-Patchwork-Id: 306962 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 305BF2C00CE for ; Mon, 6 Jan 2014 02:24:00 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751247AbaAEPXx (ORCPT ); Sun, 5 Jan 2014 10:23:53 -0500 Received: from mailp.voltaire.com ([193.47.165.129]:52439 "EHLO mellanox.co.il" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751186AbaAEPXw (ORCPT ); Sun, 5 Jan 2014 10:23:52 -0500 Received: from Internal Mail-Server by MTLPINE2 (envelope-from ogerlitz@mellanox.com) with SMTP; 5 Jan 2014 17:23:45 +0200 Received: from r-vnc04.mtr.labs.mlnx (r-vnc04.mtr.labs.mlnx [10.208.0.116]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id s05FNhVa006416; Sun, 5 Jan 2014 17:23:45 +0200 From: Or Gerlitz To: hkchu@google.com, edumazet@google.com, herbert@gondor.apana.org.au Cc: netdev@vger.kernel.org, davem@davemloft.net, yanb@mellanox.com, shlomop@mellanox.com, Or Gerlitz Subject: [PATCH V1 net-next 1/2] net: Pre-step for supporting GRO on vxlan traffic Date: Sun, 5 Jan 2014 17:23:41 +0200 Message-Id: <1388935422-7331-2-git-send-email-ogerlitz@mellanox.com> X-Mailer: git-send-email 1.7.8.2 In-Reply-To: <1388935422-7331-1-git-send-email-ogerlitz@mellanox.com> References: <1388935422-7331-1-git-send-email-ogerlitz@mellanox.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org As a pre-step for supporting vxlan with the GRO stack, move the vxlan header structure definition to common header file and enhance the vxlan code not to alter the ip_summed field for RX skb's marked with CHECKSUM_PARTIAL, as done by the TCP GRO code. Signed-off-by: Or Gerlitz --- drivers/net/vxlan.c | 10 ++-------- include/net/vxlan.h | 6 ++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 474a99e..e3d8183 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -64,12 +64,6 @@ #define VXLAN_FLAGS 0x08000000 /* struct vxlanhdr.vx_flags required value. */ -/* VXLAN protocol header */ -struct vxlanhdr { - __be32 vx_flags; - __be32 vx_vni; -}; - /* UDP port for VXLAN traffic. * The IANA assigned port is 4789, but the Linux default is 8472 * for compatibility with early adopters. @@ -1125,8 +1119,8 @@ static void vxlan_rcv(struct vxlan_sock *vs, * leave the CHECKSUM_UNNECESSARY, the device checksummed it * for us. Otherwise force the upper layers to verify it. */ - if (skb->ip_summed != CHECKSUM_UNNECESSARY || !skb->encapsulation || - !(vxlan->dev->features & NETIF_F_RXCSUM)) + if ((skb->ip_summed != CHECKSUM_UNNECESSARY && skb->ip_summed != CHECKSUM_PARTIAL) || + !skb->encapsulation || !(vxlan->dev->features & NETIF_F_RXCSUM)) skb->ip_summed = CHECKSUM_NONE; skb->encapsulation = 0; diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 6b6d180..dede91c 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -5,6 +5,12 @@ #include #include +/* VXLAN protocol header */ +struct vxlanhdr { + __be32 vx_flags; + __be32 vx_vni; +}; + #define VNI_HASH_BITS 10 #define VNI_HASH_SIZE (1<