From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 7983728F2 for ; Mon, 7 Mar 2016 03:04:46 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 06 Mar 2016 18:04:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,549,1449561600"; d="scan'208";a="918221078" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 06 Mar 2016 18:04:45 -0800 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 6 Mar 2016 18:04:44 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 6 Mar 2016 18:04:44 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.232]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.132]) with mapi id 14.03.0248.002; Mon, 7 Mar 2016 10:04:43 +0800 From: "He, Shaopeng" To: "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 5/7] lib/librte_ether: support new l2 tunnel operation Thread-Index: AQHRafbDl6pA1wTpq0Oh1q8OC0ZinZ9Ihszg//+rzwCABRxM4A== Date: Mon, 7 Mar 2016 02:04:42 +0000 Message-ID: References: <1454051035-25757-1-git-send-email-wenzhuo.lu@intel.com> <1455763573-2867-1-git-send-email-wenzhuo.lu@intel.com> <1455763573-2867-6-git-send-email-wenzhuo.lu@intel.com> <6A0DE07E22DDAD4C9103DF62FEBC090903437A2D@shsmsx102.ccr.corp.intel.com> In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC090903437A2D@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 5/7] lib/librte_ether: support new l2 tunnel operation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2016 02:04:47 -0000 Hi Wenzhuo, > -----Original Message----- > From: Lu, Wenzhuo > Sent: Friday, March 04, 2016 11:31 AM > To: He, Shaopeng ; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v4 5/7] lib/librte_ether: support new l2 > tunnel operation >=20 > Hi Shaopeng, >=20 >=20 > > -----Original Message----- > > From: He, Shaopeng > > Sent: Friday, March 4, 2016 9:47 AM > > To: Lu, Wenzhuo; dev@dpdk.org > > Subject: RE: [dpdk-dev] [PATCH v4 5/7] lib/librte_ether: support new > > l2 tunnel operation > > > > Hi Wenzhuo, > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > > > Sent: Thursday, February 18, 2016 10:46 AM > > > To: dev@dpdk.org > > > Subject: [dpdk-dev] [PATCH v4 5/7] lib/librte_ether: support new l2 > > > tunnel operation > > > > > > Add functions to support the new l2 tunnel operation. > > > 1, Insertion and stripping for l2 tunnel tag. > > > 2, Forwarding the packets to a pool based on l2 tunnel tag. > > > > > > Signed-off-by: Wenzhuo Lu > > > --- > > > lib/librte_ether/rte_ethdev.c | 183 > > > ++++++++++++++++++++++++++++++++++++ > > > lib/librte_ether/rte_ethdev.h | 214 > > > ++++++++++++++++++++++++++++++++++++++++++ > > > 2 files changed, 397 insertions(+) > > > > > > diff --git a/lib/librte_ether/rte_ethdev.c > > > b/lib/librte_ether/rte_ethdev.c index c5c12cb..6bc19d4 100644 > > > --- a/lib/librte_ether/rte_ethdev.c > > > +++ b/lib/librte_ether/rte_ethdev.c > > > @@ -3298,3 +3298,186 @@ rte_eth_dev_l2_tunnel_disable(uint8_t > port_id, > > > -ENOTSUP); > > > return (*dev->dev_ops->l2_tunnel_disable)(dev, l2_tunnel_type); } > > > + > > > +int > > > +rte_eth_dev_l2_tunnel_insertion_enable(uint8_t port_id, > > > + struct rte_eth_l2_tunnel *l2_tunnel, > > > + uint16_t vf_id) > > > +{ > > > + struct rte_eth_dev *dev; > > > + > > > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > > > + if (l2_tunnel =3D=3D NULL) { > > > + RTE_PMD_DEBUG_TRACE("Invalid l2_tunnel parameter\n"); > > > + return -EINVAL; > > > + } > > > + > > > + if (l2_tunnel->l2_tunnel_type >=3D RTE_L2_TUNNEL_TYPE_MAX) { > > > > How about the value of RTE_L2_TUNNEL_TYPE_NONE here, is it an invalid > > type too? > Honestly, the purpose I check this tunnel type here is to avoid the subsc= ript > out of bound error if some NIC create an array which index is tunnel type= . > So, although type_none is an invalid type, I don't check it here. How do = you > think about it? Thanks. Ok for me if it will not cause problem and be checked in other place Thanks, --Shaopeng