From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 809692A5E for ; Thu, 8 Dec 2016 10:10:35 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 08 Dec 2016 01:10:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,318,1477983600"; d="scan'208";a="40364003" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga006.fm.intel.com with ESMTP; 08 Dec 2016 01:10:32 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Dec 2016 01:10:32 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Dec 2016 01:10:32 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.37]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.17]) with mapi id 14.03.0248.002; Thu, 8 Dec 2016 17:10:30 +0800 From: "Chen, Jing D" To: "Yigit, Ferruh" , "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 15/32] net/i40e: add VF vlan strip func Thread-Index: AQHSUDqVbz9GHDLwpk6SKDFR4QkVeqD8AuaAgAHBPIA= Date: Thu, 8 Dec 2016 09:10:29 +0000 Message-ID: <4341B239C0EFF9468EE453F9E9F4604D3A3D0F13@shsmsx102.ccr.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-16-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: 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 15/32] net/i40e: add VF vlan strip func 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: Thu, 08 Dec 2016 09:10:39 -0000 HI, Ferruh, Best Regards, Mark > -----Original Message----- > From: Yigit, Ferruh > Sent: Wednesday, December 07, 2016 10:18 PM > To: Lu, Wenzhuo ; dev@dpdk.org > Cc: Chen, Jing D > Subject: Re: [dpdk-dev] [PATCH v2 15/32] net/i40e: add VF vlan strip func >=20 > On 12/7/2016 3:31 AM, Wenzhuo Lu wrote: > > Add a function to configure vlan strip enable/disable for specific > > SRIOV VF device. > > > > Signed-off-by: Chen Jing D(Mark) > > --- >=20 > <...> >=20 > > + > > +/* Set vlan strip on/off for specific VF from host */ > > +int > > +rte_pmd_i40e_set_vf_vlan_stripq(uint8_t port, uint16_t vf_id, uint8_t = on) > > +{ > > + struct rte_eth_dev *dev; > > + struct i40e_pf *pf; > > + struct i40e_vsi *vsi; > > + > > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); > > + > > + dev =3D &rte_eth_devices[port]; > > + pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > > + > > + if (vf_id > pf->vf_num - 1 || !pf->vfs) { > > + PMD_DRV_LOG(ERR, "Invalid argument."); > > + return -EINVAL; > > + } > > + > > + vsi =3D pf->vfs[vf_id].vsi; > > + > > + if (vsi) > > + return i40e_vsi_config_vlan_stripping(vsi, !!on); > > + else >=20 > if vd_if is valid, can vsi be NULL? If so this check may be required in > some prev patches too. It's a little impossible. This sanity check just make the code stronger. >=20 > > + return -EINVAL; > > +} > > diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd= _i40e.h > > index ca5e05a..043ae62 100644 > > --- a/drivers/net/i40e/rte_pmd_i40e.h > > +++ b/drivers/net/i40e/rte_pmd_i40e.h > > @@ -187,4 +187,24 @@ int rte_pmd_i40e_set_vf_multicast_promisc(uint8_t = port, > > int rte_pmd_i40e_set_vf_mac_addr(uint8_t port, uint16_t vf_id, > > struct ether_addr *mac_addr); > > > > +/** > > + * Enable/Disable vf vlan strip for all queues in a pool > > + * > > + * @param port > > + * The port identifier of the Ethernet device. > > + * @param vf > > + * ID specifying VF. > > + * @param on > > + * 1 - Enable VF's vlan strip on RX queues. > > + * 0 - Disable VF's vlan strip on RX queues. > > + * > > + * @return > > + * - (0) if successful. > > + * - (-ENOTSUP) if hardware doesn't support this feature. >=20 > Is this error type returned? Good catch. Only -EINVAL and -ENODEV would be returned. >=20 > > + * - (-ENODEV) if *port* invalid. > > + * - (-EINVAL) if bad parameter. > > + */ > <...>