From patchwork Thu Jan 11 07:53:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Yi" X-Patchwork-Id: 858876 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zHJHq51ppz9t3F for ; Thu, 11 Jan 2018 19:01:59 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 9DD3FF1E; Thu, 11 Jan 2018 07:59:36 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id A48F3ED0 for ; Thu, 11 Jan 2018 07:59:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 4A4B4102 for ; Thu, 11 Jan 2018 07:59:34 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2018 23:59:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,343,1511856000"; d="scan'208";a="8784246" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([10.240.224.185]) by fmsmga007.fm.intel.com with ESMTP; 10 Jan 2018 23:59:32 -0800 From: Yi Yang To: dev@openvswitch.org Date: Thu, 11 Jan 2018 15:53:36 +0800 Message-Id: <1515657217-105285-5-git-send-email-yi.y.yang@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1515657217-105285-1-git-send-email-yi.y.yang@intel.com> References: <1515657217-105285-1-git-send-email-yi.y.yang@intel.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v1 4/5] datapath: nsh: add GSO support X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Upstream commit: commit c411ed854584a71b0e86ac3019b60e4789d88086 Author: Jiri Benc Date: Mon Aug 28 21:43:24 2017 +0200 nsh: add GSO support Add a new nsh/ directory. It currently holds only GSO functions but more will come: in particular, code shared by openvswitch and tc to manipulate NSH headers. For now, assume there's no hardware support for NSH segmentation. We can always introduce netdev->nsh_features later. Signed-off-by: Jiri Benc Signed-off-by: David S. Miller Signed-off-by: Yi Yang --- datapath/Modules.mk | 4 +++- datapath/datapath.c | 4 ++++ datapath/linux/compat/include/net/nsh.h | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/datapath/Modules.mk b/datapath/Modules.mk index 21f04a0..3643da4 100644 --- a/datapath/Modules.mk +++ b/datapath/Modules.mk @@ -26,13 +26,15 @@ openvswitch_sources = \ flow_table.c \ vport.c \ vport-internal_dev.c \ - vport-netdev.c + vport-netdev.c \ + nsh.c vport_geneve_sources = vport-geneve.c vport_vxlan_sources = vport-vxlan.c vport_gre_sources = vport-gre.c vport_lisp_sources = vport-lisp.c vport_stt_sources = vport-stt.c +nsh_sources = nsh.c openvswitch_headers = \ compat.h \ diff --git a/datapath/datapath.c b/datapath/datapath.c index 1780819..4272227 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -51,6 +51,7 @@ #include #include #include +#include #include "datapath.h" #include "conntrack.h" @@ -2408,6 +2409,7 @@ static int __init dp_init(void) pr_info("Open vSwitch switching datapath %s\n", VERSION); + ovs_nsh_init(); err = action_fifos_init(); if (err) goto error; @@ -2463,6 +2465,7 @@ error_unreg_rtnl_link: error_action_fifos_exit: action_fifos_exit(); error: + ovs_nsh_cleanup(); return err; } @@ -2478,6 +2481,7 @@ static void dp_cleanup(void) ovs_flow_exit(); ovs_internal_dev_rtnl_link_unregister(); action_fifos_exit(); + ovs_nsh_cleanup(); } module_init(dp_init); diff --git a/datapath/linux/compat/include/net/nsh.h b/datapath/linux/compat/include/net/nsh.h index a1eaea2..c9c30e0 100644 --- a/datapath/linux/compat/include/net/nsh.h +++ b/datapath/linux/compat/include/net/nsh.h @@ -304,4 +304,7 @@ static inline void nsh_set_flags_ttl_len(struct nshhdr *nsh, u8 flags, NSH_FLAGS_MASK | NSH_TTL_MASK | NSH_LEN_MASK); } +int ovs_nsh_init(void); +void ovs_nsh_cleanup(void); + #endif /* __NET_NSH_H */