From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 5051C29C7 for ; Wed, 9 Mar 2016 02:15:44 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 08 Mar 2016 17:15:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,559,1449561600"; d="scan'208";a="666158428" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 08 Mar 2016 17:15:43 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 8 Mar 2016 17:15:43 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 8 Mar 2016 17:15:42 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.232]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.18]) with mapi id 14.03.0248.002; Wed, 9 Mar 2016 09:15:40 +0800 From: "Lu, Wenzhuo" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v6 2/5] lib/librte_ether: support l2 tunnel operations Thread-Index: AQHReQdK6QGKNeET50qQOU5kJQOG9Z9PuSoAgACTSyA= Date: Wed, 9 Mar 2016 01:15:40 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC090903439197@shsmsx102.ccr.corp.intel.com> References: <1454051035-25757-1-git-send-email-wenzhuo.lu@intel.com> <1457420017-15345-1-git-send-email-wenzhuo.lu@intel.com> <1457420017-15345-3-git-send-email-wenzhuo.lu@intel.com> <1879903.OgO4X0RlNL@xps13> In-Reply-To: <1879903.OgO4X0RlNL@xps13> Accept-Language: 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 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v6 2/5] lib/librte_ether: support l2 tunnel operations 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: Wed, 09 Mar 2016 01:15:44 -0000 Hi Thomas, > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Wednesday, March 9, 2016 8:15 AM > To: Lu, Wenzhuo > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v6 2/5] lib/librte_ether: support l2 tunne= l > operations >=20 > 2016-03-08 14:53, Wenzhuo Lu: > > +/** > > + * l2 tunnel type. > > + */ > > +enum rte_eth_l2_tunnel_type { > > + RTE_L2_TUNNEL_TYPE_NONE =3D 0, > > + RTE_L2_TUNNEL_TYPE_E_TAG, > > + RTE_L2_TUNNEL_TYPE_MAX, > > +}; >=20 > We already have rte_eth_tunnel_type. Seems the tunnels in rte_eth_tunnel_type are all L3 packets. So, I want to = add a new type for e-tag, s-tag... as they're l2 packets. Do you suggest to merge it into rte_eth_tunnel_type? > Why this struct is in rte_eth_ctrl.h and not used with rte_eth_dev_filter= _ctrl? Just want to put it together with rte_eth_tunnel_type :) >=20 > > + /** > > + * Config l2 tunnel ether type of an Ethernet device for filtering > > +specific > > + * tunnel packets by ether type. > > + * > > + * @param port_id > > + * The port identifier of the Ethernet device. > > + * @param l2_tunnel > > + * l2 tunnel configuration. > > + * > > + * @return > > + * - (0) if successful. > > + * - (-ENODEV) if port identifier is invalid. > > + * - (-ENOTSUP) if hardware doesn't support tunnel type. > > + */ > > +int > > +rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id, > > + struct rte_eth_l2_tunnel *l2_tunnel); > > + > > + /** > > + * Enable/disable l2 tunnel offload functions. Include, > > + * 1, The ability of parsing a type of l2 tunnel of an Ethernet device= . > > + * Filtering, forwarding and offloading this type of tunnel packets= depend on > > + * this ability. > > + * 2, Stripping the l2 tunnel tag. > > + * 3, Insertion of the l2 tunnel tag. > > + * 4, Forwarding the packets based on the l2 tunnel tag. > > + * > > + * @param port_id > > + * The port identifier of the Ethernet device. > > + * @param l2_tunnel > > + * l2 tunnel parameters. > > + * @param mask > > + * Indicate the offload function. > > + * @param en > > + * Enable or disable this function. > > + * > > + * @return > > + * - (0) if successful. > > + * - (-ENODEV) if port identifier is invalid. > > + * - (-ENOTSUP) if hardware doesn't support tunnel type. > > + */ > > +int > > +rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id, > > + struct rte_eth_l2_tunnel *l2_tunnel, > > + uint32_t mask, > > + uint8_t en); > > + > > + /** > > + * Add a filter for packet forwarding based on l2 tunnel tag of an > > +Ethernet > > + * device for specific tunnel packets. > > + * > > + * @param port_id > > + * The port identifier of the Ethernet device. > > + * @param l2_tunnel > > + * l2 tunnel configuration. > > + * > > + * @return > > + * - (0) if successful. > > + * - (-ENODEV) if port identifier is invalid. > > + * - (-ENOTSUP) if hardware doesn't support tunnel type. > > + */ > > +int > > +rte_eth_dev_l2_tunnel_filter_add(uint8_t port_id, > > + struct rte_eth_l2_tunnel *l2_tunnel); > > + > > + /** > > + * Delete a filter for packet forwarding based on l2 tunnel tag of an > > +Ethernet > > + * device for specific tunnel packets. > > + * > > + * @param port_id > > + * The port identifier of the Ethernet device. > > + * @param l2_tunnel > > + * l2 tunnel configuration. > > + * > > + * @return > > + * - (0) if successful. > > + * - (-ENODEV) if port identifier is invalid. > > + * - (-ENOTSUP) if hardware doesn't support tunnel type. > > + */ > > +int > > +rte_eth_dev_l2_tunnel_filter_del(uint8_t port_id, > > + struct rte_eth_l2_tunnel *l2_tunnel); > > + >=20 > Why are we still adding some filtering functions after having the asserti= on that > the new filtering API in lib/librte_ether/rte_eth_ctrl.h was generic enou= gh? > The filtering API v2 was a total failure. > Are we going to add new functions each time a new bit of a header must be > parsed by an offloaded filtering? > Are we going to add new functions for each new filter of a NIC? Sorry, my bad. I'll try to use the existing filter API. Thanks. >=20 >=20 > > --- a/lib/librte_ether/rte_ether_version.map > > +++ b/lib/librte_ether/rte_ether_version.map > > @@ -114,6 +114,10 @@ DPDK_2.2 { > > rte_eth_tx_queue_setup; > > rte_eth_xstats_get; > > rte_eth_xstats_reset; > > + rte_eth_dev_l2_tunnel_eth_type_conf; > > + rte_eth_dev_l2_tunnel_offload_set; > > + rte_eth_dev_l2_tunnel_filter_add; > > + rte_eth_dev_l2_tunnel_filter_del; >=20 > It is not the right section but it doesn't really matter. I didn't notice the DPDK_2.2. I'll do it correctly.