From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CFEB4FA78 for ; Mon, 27 Mar 2017 12:37:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490611059; x=1522147059; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=8if/lWcLw1f+FTZc2CzCTNBKOutMmamex2EdoCQ7VxU=; b=BFhkf9IEg5E2vAtTtDwhXPyGVXN0ZCyFcMLPnSgXMjcR7NW3hNtOM2Au OzRPOJW9Ou3E1boW4d35Sd5kmbIrXQ==; Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2017 03:37:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,231,1486454400"; d="scan'208";a="838850369" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 27 Mar 2017 03:37:37 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 27 Mar 2017 03:37:37 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 27 Mar 2017 03:37:37 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.224]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.42]) with mapi id 14.03.0248.002; Mon, 27 Mar 2017 18:37:35 +0800 From: "Xing, Beilei" To: "Wu, Jingjing" CC: "Zhang, Helin" , "dev@dpdk.org" Thread-Topic: [PATCH v2 3/4] net/i40e: support tunnel filter to VF Thread-Index: AQHSpuAsdiqt5j/SxUKZeZs4Caps0qGofY0w Date: Mon, 27 Mar 2017 10:37:34 +0000 Message-ID: <94479800C636CB44BD422CB454846E01315C143B@SHSMSX101.ccr.corp.intel.com> References: <1488533497-27682-1-git-send-email-beilei.xing@intel.com> <1490265990-121019-1-git-send-email-beilei.xing@intel.com> <1490265990-121019-4-git-send-email-beilei.xing@intel.com> <9BB6961774997848B5B42BEC655768F810D14A62@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810D14A62@SHSMSX103.ccr.corp.intel.com> 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 Subject: Re: [dpdk-dev] [PATCH v2 3/4] net/i40e: support tunnel filter to VF 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: Mon, 27 Mar 2017 10:37:39 -0000 > -----Original Message----- > From: Wu, Jingjing > Sent: Monday, March 27, 2017 5:55 PM > To: Xing, Beilei > Cc: Zhang, Helin ; dev@dpdk.org > Subject: RE: [PATCH v2 3/4] net/i40e: support tunnel filter to VF >=20 >=20 >=20 > > -----Original Message----- > > From: Xing, Beilei > > Sent: Thursday, March 23, 2017 6:46 PM > > To: Wu, Jingjing > > Cc: Zhang, Helin ; dev@dpdk.org > > Subject: [PATCH v2 3/4] net/i40e: support tunnel filter to VF > > > > Previously, only tunnel filter to PF is supported. > > This patch adds i40e_dev_consistent_tunnel_filter_set > > function for consistent filter API to support tunnel filter to VF. > > > > Signed-off-by: Beilei Xing > > --- > > drivers/net/i40e/i40e_ethdev.c | 145 > > +++++++++++++++++++++++++++++++++++++++++ > > drivers/net/i40e/i40e_ethdev.h | 32 +++++++++ > > drivers/net/i40e/i40e_flow.c | 50 +++++++++----- > > 3 files changed, 212 insertions(+), 15 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.c index 5e6cc59..2b3d41b 100644 > > --- a/drivers/net/i40e/i40e_ethdev.c > > +++ b/drivers/net/i40e/i40e_ethdev.c > > @@ -6935,6 +6935,151 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, > > return ret; > > } > > > > +int > > +i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf, > > + struct i40e_tunnel_filter_conf *tunnel_filter, > > + uint8_t add) > > +{ > > + uint16_t ip_type; > > + uint32_t ipv4_addr; > > + uint8_t i, tun_type =3D 0; > > + /* internal variable to convert ipv6 byte order */ > > + uint32_t convert_ipv6[4]; > > + int val, ret =3D 0; > > + struct i40e_pf_vf *vf =3D NULL; > > + struct i40e_hw *hw =3D I40E_PF_TO_HW(pf); > > + struct i40e_vsi *vsi; > > + struct i40e_aqc_add_rm_cloud_filt_elem_ext *cld_filter; > > + struct i40e_aqc_add_rm_cloud_filt_elem_ext *pfilter; > > + struct i40e_tunnel_rule *tunnel_rule =3D &pf->tunnel; > > + struct i40e_tunnel_filter *tunnel, *node; > > + struct i40e_tunnel_filter check_filter; /* Check if filter exists */ > > + bool big_buffer =3D 0; > > + > > + cld_filter =3D rte_zmalloc("tunnel_filter", > > + sizeof(struct > i40e_aqc_add_rm_cloud_filt_elem_ext), > > + 0); > > + > > + if (cld_filter =3D=3D NULL) { > > + PMD_DRV_LOG(ERR, "Failed to alloc memory."); > > + return -EINVAL; > -EINVAL? I think -ENOMEM is better. Agree. >=20 >=20 > > + if (add) { > > + if (big_buffer) > > + ret =3D i40e_aq_add_cloud_filters_big_buffer(hw, > > + vsi->seid, cld_filter, 1); > > + else > > + ret =3D i40e_aq_add_cloud_filters(hw, > > + vsi->seid, &cld_filter->element, 1); > > + if (ret < 0) { > > + PMD_DRV_LOG(ERR, "Failed to add a tunnel filter."); > > + return ret; > Ret is type of "enum i40e_status_code". It will not be consistent. >=20 >=20 > > + > > #define I40E_MIRROR_MAX_ENTRIES_PER_RULE 64 > > #define I40E_MAX_MIRROR_RULES 64 > > /* > > @@ -718,6 +746,7 @@ union i40e_filter_t { > > struct rte_eth_ethertype_filter ethertype_filter; > > struct rte_eth_fdir_filter fdir_filter; > > struct rte_eth_tunnel_filter_conf tunnel_filter; > > + struct i40e_tunnel_filter_conf consistent_tunnel_filter; > > }; > > > I like to use driver specified structures instead of the old rte_eth_XX. > Glad to see this change, it will be better to change other structs. :) Thanks, what do you think we change other structures after this release? >=20 > Acked-by Jingjing Wu >=20 > Thanks > Jingjing