From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D567A3DC for ; Wed, 7 Dec 2016 18:41:22 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 07 Dec 2016 09:41:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,310,1477983600"; d="scan'208";a="1069219543" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga001.jf.intel.com with ESMTP; 07 Dec 2016 09:41:21 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.159]) by IRSMSX151.ger.corp.intel.com ([169.254.4.16]) with mapi id 14.03.0248.002; Wed, 7 Dec 2016 17:41:20 +0000 From: "Iremonger, Bernard" To: "Yigit, Ferruh" , "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 19/32] net/i40e: set VF VLAN filter from PF Thread-Index: AQHSUDqXTxjbFTkjA0mmsq8kRbLwj6D8kNqAgAAwfuA= Date: Wed, 7 Dec 2016 17:41:20 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C224D05919@IRSMSX108.ger.corp.intel.com> References: <1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com> <1481081535-37448-1-git-send-email-wenzhuo.lu@intel.com> <1481081535-37448-20-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTcwNTA1N2UtMDJhNy00ZWI2LWJiNTYtZWQxM2Y4ZDcxNDBkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjIuMTEuMCIsIlRydXN0ZWRMYWJlbEhhc2giOiJNZGVZcjBCb201SEY5Q1JKRkZCMmRZYm1Fb1I4and2QmE4Q1wvbWM4XC9yVjA9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 19/32] net/i40e: set VF VLAN filter from PF 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: Wed, 07 Dec 2016 17:41:23 -0000 Hi Ferruh, > -----Original Message----- > From: Yigit, Ferruh > Sent: Wednesday, December 7, 2016 2:46 PM > To: Lu, Wenzhuo ; dev@dpdk.org > Cc: Iremonger, Bernard > Subject: Re: [dpdk-dev] [PATCH v2 19/32] net/i40e: set VF VLAN filter fro= m > PF >=20 > On 12/7/2016 3:32 AM, Wenzhuo Lu wrote: > > add rte_pmd_i40e_set_vf_vlan_filter API. > > User can call the API on PF to enable/disable a set of VF's VLAN > > filters. > > > > Signed-off-by: Bernard Iremonger > > --- > > drivers/net/i40e/i40e_ethdev.c | 50 > +++++++++++++++++++++++++++++++ > > drivers/net/i40e/rte_pmd_i40e.h | 22 ++++++++++++++ > > drivers/net/i40e/rte_pmd_i40e_version.map | 1 + > > 3 files changed, 73 insertions(+) > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.c index 601e933..bc96698 100644 > > --- a/drivers/net/i40e/i40e_ethdev.c > > +++ b/drivers/net/i40e/i40e_ethdev.c > > @@ -10516,3 +10516,53 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint8_t > > port, uint16_t vf_id, uint8_t on) > > > > return ret; > > } > > + > > +int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id, > > + uint64_t vf_mask, uint8_t on) { > <...> > > + > > + for (pool_idx =3D 0; > > + pool_idx < ETH_64_POOLS && pool_idx < pf->nb_cfg_vmdq_vsi; > > + pool_idx++) { > > + if (vf_mask & ((uint64_t)(1ULL << pool_idx))) { > > + if (on) > > + ret =3D i40e_vsi_add_vlan(pf- > >vmdq[pool_idx].vsi, > > + vlan_id); > > + else > > + ret =3D i40e_vsi_delete_vlan( > > + pf->vmdq[pool_idx].vsi, vlan_id); > > + } > > + } > > + > > + if (ret !=3D I40E_SUCCESS) > > + PMD_DRV_LOG(ERR, "Failed to set VF VLAN filter, on =3D %d", > on); >=20 > Since loop not break on error, this will only log the last one, if the er= ror is in > the middle, it is missed. It would be better to break out of the loop on error. >=20 > <...> Regards, Bernard.