From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9DD4D2934 for ; Fri, 9 Dec 2016 04:07:07 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP; 08 Dec 2016 19:07:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,322,1477983600"; d="scan'208";a="38427772" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 08 Dec 2016 19:07:05 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Dec 2016 19:07:05 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 8 Dec 2016 19:07:05 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.11]) by shsmsx102.ccr.corp.intel.com ([169.254.2.37]) with mapi id 14.03.0248.002; Fri, 9 Dec 2016 11:07:02 +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: AQHSUDqVbz9GHDLwpk6SKDFR4QkVeqD8AuaAgAHBPID//5UeAIABmDkQ Date: Fri, 9 Dec 2016 03:07:02 +0000 Message-ID: <4341B239C0EFF9468EE453F9E9F4604D3A3DC831@SHSMSX104.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> <4341B239C0EFF9468EE453F9E9F4604D3A3D0F13@shsmsx102.ccr.corp.intel.com> <8d2aeee4-f751-c312-7a08-6a5393f20c75@intel.com> In-Reply-To: <8d2aeee4-f751-c312-7a08-6a5393f20c75@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 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: Fri, 09 Dec 2016 03:07:08 -0000 Hi, Ferruh, > -----Original Message----- > From: Yigit, Ferruh > Sent: Thursday, December 08, 2016 6:43 PM > To: Chen, Jing D ; Lu, Wenzhuo ; > dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 15/32] net/i40e: add VF vlan strip func >=20 > On 12/8/2016 9:10 AM, Chen, Jing D wrote: > > 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 f= unc > >> > >> 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) > >>> --- > >> > >> <...> > >> > >>> + > >>> +/* 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 > >> > >> if vd_if is valid, can vsi be NULL? If so this check may be required i= n > >> some prev patches too. > > > > It's a little impossible. This sanity check just make the code stronger= . > > >=20 > If it is impossible, do you agree to remove this? And if this can be > possible we must update other patches, almost all other patches assume > this can't be NULL. I'll recommend other patches to add it, too. The reason is we can't image if there is some code change have impact in future, the necessary sanity check in slow patch make code stronger.