From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 741513777 for ; Thu, 5 Jan 2017 04:12:05 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 04 Jan 2017 19:12:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,319,1477983600"; d="scan'208";a="209802419" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by fmsmga004.fm.intel.com with ESMTP; 04 Jan 2017 19:12:03 -0800 Received: from pgsmsx110.gar.corp.intel.com (10.221.44.111) by KMSMSX152.gar.corp.intel.com (172.21.73.87) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 5 Jan 2017 11:12:02 +0800 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.52]) by PGSMSX110.gar.corp.intel.com ([10.221.44.111]) with mapi id 14.03.0248.002; Thu, 5 Jan 2017 11:12:01 +0800 From: "Zhao1, Wei" To: Adrien Mazarguil CC: "dev@dpdk.org" , "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH v2 14/18] net/ixgbe: parse L2 tunnel filter Thread-Index: AQHSYnKGbgyMSrDVT0SMOweHfQBB4aEmSpKAgALyJTA= Date: Thu, 5 Jan 2017 03:12:01 +0000 Message-ID: References: <1483084390-53159-1-git-send-email-wei.zhao1@intel.com> <1483084390-53159-15-git-send-email-wei.zhao1@intel.com> <20170103140759.GA12822@6wind.com> In-Reply-To: <20170103140759.GA12822@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 14/18] net/ixgbe: parse L2 tunnel filter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2017 03:12:06 -0000 Hi, adrien > -----Original Message----- > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > Sent: Tuesday, January 3, 2017 10:08 PM > To: Zhao1, Wei > Cc: dev@dpdk.org; Lu, Wenzhuo > Subject: Re: [dpdk-dev] [PATCH v2 14/18] net/ixgbe: parse L2 tunnel filte= r >=20 > Hi Wei, >=20 > On Fri, Dec 30, 2016 at 03:53:06PM +0800, Wei Zhao wrote: > > check if the rule is a L2 tunnel rule, and get the L2 tunnel info. > > > > Signed-off-by: Wei Zhao > > Signed-off-by: Wenzhuo Lu > > > > --- > > > > v2: > > --add new error set function > > --change return value type of parser function > > --- > > drivers/net/ixgbe/ixgbe_ethdev.c | 269 > +++++++++++++++++++++++++++++++++++---- > > lib/librte_ether/rte_flow.h | 32 +++++ > > 2 files changed, 273 insertions(+), 28 deletions(-) > [...] > > diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h > > index 98084ac..e9e6220 100644 > > --- a/lib/librte_ether/rte_flow.h > > +++ b/lib/librte_ether/rte_flow.h > > @@ -268,6 +268,13 @@ enum rte_flow_item_type { > > * See struct rte_flow_item_vxlan. > > */ > > RTE_FLOW_ITEM_TYPE_VXLAN, > > + > > + /** > > + * Matches a E_TAG header. > > + * > > + * See struct rte_flow_item_e_tag. > > + */ > > + RTE_FLOW_ITEM_TYPE_E_TAG, > > }; > > > > /** > > @@ -454,6 +461,31 @@ struct rte_flow_item_vxlan { }; > > > > /** > > + * RTE_FLOW_ITEM_TYPE_E_TAG. > > + * > > + * Matches a E-tag header. > > + */ > > +struct rte_flow_item_e_tag { > > + struct ether_addr dst; /**< Destination MAC. */ > > + struct ether_addr src; /**< Source MAC. */ > > + uint16_t e_tag_ethertype; /**< E-tag EtherType, 0x893F. */ > > + uint16_t e_pcp:3; /**< E-PCP */ > > + uint16_t dei:1; /**< DEI */ > > + uint16_t in_e_cid_base:12; /**< Ingress E-CID base */ > > + uint16_t rsv:2; /**< reserved */ > > + uint16_t grp:2; /**< GRP */ > > + uint16_t e_cid_base:12; /**< E-CID base */ > > + uint16_t in_e_cid_ext:8; /**< Ingress E-CID extend */ > > + uint16_t e_cid_ext:8; /**< E-CID extend */ > > + uint16_t type; /**< MAC type. */ > > + unsigned int tags; /**< Number of 802.1Q/ad tags defined. */ > > + struct { > > + uint16_t tpid; /**< Tag protocol identifier. */ > > + uint16_t tci; /**< Tag control information. */ > > + } tag[]; /**< 802.1Q/ad tag definitions, outermost first. */ }; > [...] >=20 > See my previous reply [1], this definition is not endian-safe and compris= es > protocols defined as independent items (namely ETH and VLAN). Here is an > untested suggestion: >=20 > struct rte_flow_item_e_tag { > uint16_t tpid; /**< Tag protocol identifier (0x893F). */ > /** E-Tag control information (E-TCI). */ > uint16_t epcp_edei_in_ecid_b; /**< E-PCP (3b), E-DEI (1b), ingress E= -CID > base (12b). */ > uint16_t rsvd_grp_ecid_b; /**< Reserved (2b), GRP (2b), E-CID base (= 12b). > */ > uint8_t in_ecid_e; /**< Ingress E-CID ext. */ > uint8_t ecid_e; /**< E-CID ext. */ > }; >=20 > Applications are responsibile for breaking down and filling individual fi= elds > properly. Ethernet header would be provided as its own item as shown in > this testpmd flow command example: >=20 > flow create 0 ingress pattern eth / e_tag in_ecid_base is 42 / end actio= ns > drop / end >=20 In this case , is eth an option or mandatory?=20 I think it is optional, because user may do not have any parameter in ETH = config. > Note, all multibyte values are in network order like other protocol heade= r > definitions. >=20 > [1] http://dpdk.org/ml/archives/dev/2016-December/053181.html > Message ID: 20161223081310.GH10340@6wind.com >=20 > -- > Adrien Mazarguil > 6WIND