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 6413A2A6C for ; Fri, 6 Jan 2017 12:38:30 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 06 Jan 2017 03:38:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,324,1477983600"; d="scan'208";a="1079882957" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by orsmga001.jf.intel.com with ESMTP; 06 Jan 2017 03:38:27 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.173]) by IRSMSX106.ger.corp.intel.com ([169.254.8.197]) with mapi id 14.03.0248.002; Fri, 6 Jan 2017 11:38:26 +0000 From: "Iremonger, Bernard" To: "Wu, Jingjing" , "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v7 17/27] net/i40e: set VF VLAN filter from PF Thread-Index: AQHSZY52/03kjXrxIEWH2oFUoqb2Z6EqnsQAgAC3dFA= Date: Fri, 6 Jan 2017 11:38:25 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C224D1B4A2@IRSMSX108.ger.corp.intel.com> References: <1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com> <1483426488-117332-1-git-send-email-wenzhuo.lu@intel.com> <1483426488-117332-18-git-send-email-wenzhuo.lu@intel.com> <9BB6961774997848B5B42BEC655768F810CC3D0F@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810CC3D0F@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGQ3MTBiY2MtOGQwNy00YzM2LWI3ODItOTdlOTkxZjZlZjQ0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjIuMTEuMCIsIlRydXN0ZWRMYWJlbEhhc2giOiI5OGJLSjV6MGV4XC9pK2VUUEZIMzFFNzRvdlJ5K1ZieVZjb05cL2ZzaENMcTQ9In0= 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 v7 17/27] 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: Fri, 06 Jan 2017 11:38:31 -0000 Hi Jinqjing, > -----Original Message----- > From: Wu, Jingjing > Sent: Friday, January 6, 2017 12:37 AM > To: Lu, Wenzhuo ; dev@dpdk.org > Cc: Iremonger, Bernard > Subject: RE: [dpdk-dev] [PATCH v7 17/27] net/i40e: set VF VLAN filter fro= m > PF >=20 >=20 >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > > Sent: Tuesday, January 3, 2017 2:55 PM > > To: dev@dpdk.org > > Cc: Iremonger, Bernard > > Subject: [dpdk-dev] [PATCH v7 17/27] net/i40e: set VF VLAN filter from > > PF > > > > From: Bernard Iremonger > > > > 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 filter= s. > > > > Signed-off-by: Bernard Iremonger > > --- > > drivers/net/i40e/i40e_ethdev.c | 52 > > +++++++++++++++++++++++++++++++ > > drivers/net/i40e/rte_pmd_i40e.h | 22 +++++++++++++ > > drivers/net/i40e/rte_pmd_i40e_version.map | 1 + > > 3 files changed, 75 insertions(+) > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.c index 4d2fb20..47e03d6 100644 > > --- a/drivers/net/i40e/i40e_ethdev.c > > +++ b/drivers/net/i40e/i40e_ethdev.c > > @@ -10428,3 +10428,55 @@ 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) { > > + struct rte_eth_dev *dev; > > + struct rte_eth_dev_info dev_info; > > + struct i40e_pf *pf; > > + uint16_t pool_idx; > > + int ret =3D I40E_SUCCESS; > > + > > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); > > + > > + dev =3D &rte_eth_devices[port]; > > + rte_eth_dev_info_get(port, &dev_info); > > + > > + if (vlan_id > ETHER_MAX_VLAN_ID) > > + return -EINVAL; > > + > > + if (on > 1) > > + return -EINVAL; > > + > > + pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > > + if ((pf->flags & I40E_FLAG_VMDQ) =3D=3D 0) { > > + PMD_INIT_LOG(ERR, "Firmware doesn't support VMDQ"); > > + return -ENOTSUP; > > + } > > + > > + if (!pf->vmdq) { > > + PMD_INIT_LOG(INFO, "VMDQ not configured"); > > + return -ENOTSUP; > > + } > > + > > + for (pool_idx =3D 0; > > + pool_idx < ETH_64_POOLS && > > + pool_idx < pf->nb_cfg_vmdq_vsi && > > + ret =3D=3D I40E_SUCCESS; > > + 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); > > + } > > + } >=20 > The head is saying "set VF VLAN filter", why do you deal with VMDQ VSIs? This API is modelled on the rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, = uint16_t vlan_id, uint64_t vf_mask, uint8_t on) which seems to use VMDq.= More investigation is needed here. Regards, Bernard.