From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 76A5A2C36 for ; Fri, 6 Jan 2017 09:20:19 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP; 06 Jan 2017 00:20:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,323,1477983600"; d="scan'208";a="46241598" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 06 Jan 2017 00:20:18 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 6 Jan 2017 00:20:17 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 6 Jan 2017 00:20:17 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.03.0248.002; Fri, 6 Jan 2017 16:20:11 +0800 From: "Lu, Wenzhuo" To: "Wu, Jingjing" , "dev@dpdk.org" CC: "Iremonger, Bernard" Thread-Topic: [dpdk-dev] [PATCH v7 14/27] net/i40e: set VF VLAN insertion from PF Thread-Index: AQHSZY7wHr2eNWc+YUq2AHWDT0PuEKEqF7qAgAEIP/A= Date: Fri, 6 Jan 2017 08:20:10 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B55669B@shsmsx102.ccr.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-15-git-send-email-wenzhuo.lu@intel.com> <9BB6961774997848B5B42BEC655768F810CC3CCD@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810CC3CCD@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 v7 14/27] net/i40e: set VF VLAN insertion 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 08:20:20 -0000 Hi Jingjing, Bernard, > -----Original Message----- > From: Wu, Jingjing > Sent: Friday, January 6, 2017 8:33 AM > To: Lu, Wenzhuo; dev@dpdk.org > Cc: Iremonger, Bernard > Subject: RE: [dpdk-dev] [PATCH v7 14/27] net/i40e: set VF VLAN insertion = from > 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 14/27] net/i40e: set VF VLAN insertion > > from PF > > > > From: Bernard Iremonger > > > > Support inserting VF VLAN id from PF. > > User can call the API on PF to insert a VLAN id to a specific VF. > > > > Signed-off-by: Bernard Iremonger > > --- > > drivers/net/i40e/i40e_ethdev.c | 56 > > +++++++++++++++++++++++++++++++ > > drivers/net/i40e/rte_pmd_i40e.h | 19 +++++++++++ > > drivers/net/i40e/rte_pmd_i40e_version.map | 1 + > > 3 files changed, 76 insertions(+) > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.c index 7ab1c93..31c387d 100644 > > --- a/drivers/net/i40e/i40e_ethdev.c > > +++ b/drivers/net/i40e/i40e_ethdev.c > > @@ -10266,3 +10266,59 @@ static void i40e_set_default_mac_addr(struct > > rte_eth_dev *dev, > > else > > return -EINVAL; > > } > > + > > +int rte_pmd_i40e_set_vf_vlan_insert(uint8_t port, uint16_t vf_id, > > + uint16_t vlan_id) > > +{ > > + struct rte_eth_dev *dev; > > + struct rte_eth_dev_info dev_info; > > + struct i40e_pf *pf; > > + struct i40e_hw *hw; > > + struct i40e_vsi *vsi; > > + struct i40e_vsi_context ctxt; > > + int ret; > > + > > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); > > + > > + dev =3D &rte_eth_devices[port]; > > + rte_eth_dev_info_get(port, &dev_info); >=20 > It looks dev_info is not used in this function. I'll delete it. >=20 > > + pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > > + hw =3D I40E_PF_TO_HW(pf); > > + > > + /** > > + * return -ENODEV if SRIOV not enabled, VF number not configured > > + * or no queue assigned. > > + */ > > + if (!hw->func_caps.sr_iov_1_1 || pf->vf_num =3D=3D 0 || > > + pf->vf_nb_qps =3D=3D 0) > > + return -ENODEV; > > + > > + if (vf_id >=3D pf->vf_num || !pf->vfs) > > + return -EINVAL; > > + > > + if (vlan_id > ETHER_MAX_VLAN_ID) > > + return -EINVAL; > > + > > + vsi =3D pf->vfs[vf_id].vsi; > > + if (!vsi) > > + return -EINVAL; > > + > > + vsi->info.valid_sections =3D > > cpu_to_le16(I40E_AQ_VSI_PROP_VLAN_VALID); > > + vsi->info.pvid =3D vlan_id; > > + if (vlan_id > 0) > > + vsi->info.port_vlan_flags |=3D > I40E_AQ_VSI_PVLAN_INSERT_PVID; > > + else > > + vsi->info.port_vlan_flags &=3D > > ~I40E_AQ_VSI_PVLAN_INSERT_PVID; > So, Pvid is used here for insert. Does it has any relationship with vlan = anti- > spoof patch? > If so, it's better to consider how to deal with that. It's vlan insertion not filtering. So I think not related. >=20 > Thanks > Jingjing