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 46AC25A80 for ; Thu, 29 Jan 2015 07:06:21 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 28 Jan 2015 22:06:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="446848696" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by FMSMGA003.fm.intel.com with ESMTP; 28 Jan 2015 21:52:30 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 29 Jan 2015 14:06:17 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.253]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.231]) with mapi id 14.03.0195.001; Thu, 29 Jan 2015 14:06:15 +0800 From: "Qiu, Michael" To: "Wu, Jingjing" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf Thread-Index: AQHQO2TkRD7sJiuwj0OtHhu3qh+/Pw== Date: Thu, 29 Jan 2015 06:06:15 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CCFC41@SHSMSX101.ccr.corp.intel.com> References: <1422495715-6450-1-git-send-email-jingjing.wu@intel.com> <1422495715-6450-3-git-send-email-jingjing.wu@intel.com> <533710CFB86FA344BFBF2D6802E60286CCD955@SHSMSX101.ccr.corp.intel.com> <9BB6961774997848B5B42BEC655768F8B86D0D@SHSMSX104.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 2/2] i40e: enable internal switch of pf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2015 06:06:21 -0000 On 1/29/2015 12:57 PM, Wu, Jingjing wrote:=0A= > Hi, Michael=0A= >=0A= >> -----Original Message-----=0A= >> From: Qiu, Michael=0A= >> Sent: Thursday, January 29, 2015 9:56 AM=0A= >> To: Wu, Jingjing; dev@dpdk.org=0A= >> Subject: Re: [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf= =0A= >>=0A= >> On 1/29/2015 9:42 AM, Jingjing Wu wrote:=0A= >>> This patch enables PF's internal switch by setting ALLOWLOOPBACK flag= =0A= >>> when VEB is created. With this patch, traffic from PF can be switched= =0A= >>> on the VEB.=0A= >>>=0A= >>> Signed-off-by: Jingjing Wu =0A= >>> ---=0A= >>> lib/librte_pmd_i40e/i40e_ethdev.c | 36=0A= >>> ++++++++++++++++++++++++++++++++++++=0A= >>> 1 file changed, 36 insertions(+)=0A= >>>=0A= >>> diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c=0A= >>> b/lib/librte_pmd_i40e/i40e_ethdev.c=0A= >>> index fe758c2..94fd36c 100644=0A= >>> --- a/lib/librte_pmd_i40e/i40e_ethdev.c=0A= >>> +++ b/lib/librte_pmd_i40e/i40e_ethdev.c=0A= >>> @@ -2854,6 +2854,40 @@ i40e_vsi_dump_bw_config(struct i40e_vsi *vsi)=0A= >>> return 0;=0A= >>> }=0A= >>>=0A= >>> +/*=0A= >>> + * i40e_enable_pf_lb=0A= >>> + * @pf: pointer to the pf structure=0A= >>> + *=0A= >>> + * allow loopback on pf=0A= >>> + */=0A= >>> +static inline void=0A= >>> +i40e_enable_pf_lb(struct i40e_pf *pf) {=0A= >>> + struct i40e_hw *hw =3D I40E_PF_TO_HW(pf);=0A= >>> + struct i40e_vsi_context ctxt;=0A= >>> + int ret;=0A= >>> +=0A= >>> + memset(&ctxt, 0, sizeof(ctxt));=0A= >>> + ctxt.seid =3D pf->main_vsi_seid;=0A= >>> + ctxt.pf_num =3D hw->pf_id;=0A= >>> + ret =3D i40e_aq_get_vsi_params(hw, &ctxt, NULL);=0A= >>> + if (ret) {=0A= >>> + PMD_DRV_LOG(ERR, "couldn't get pf vsi config, err %d,=0A= >> aq_err %d",=0A= >>> + ret, hw->aq.asq_last_status);=0A= >>> + return;=0A= >>> + }=0A= >>> + ctxt.flags =3D I40E_AQ_VSI_TYPE_PF;=0A= >>> + ctxt.info.valid_sections =3D=0A= >>> + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID);=0A= >> Here does it need to be "|=3D" ? As ctxt.infowill be filled in=0A= >> i40e_aq_get_vsi_params(), I don't know if it has other issue for overrid= e this=0A= >> filled by "=3D".=0A= >>=0A= >> Thanks,=0A= >> Michael=0A= > You can look at the following lines. What we called is i40e_aq_update_vsi= _params.=0A= > So we need only set the flag we want to update.=0A= =0A= Sorry, I make a mistake, what I mean is:=0A= =0A= 1. ret =3D i40e_aq_get_vsi_params(hw, &ctxt, NULL);=0A= here will fill the the field ctxt.info of struct i40e_vsi_context=0A= ctxt right?=0A= So ctxt.info is get from other place.=0A= =0A= 2. Then:=0A= =0A= + ctxt.info.valid_sections =3D=0A= + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID);=0A= =0A= Has been override by assignment a value, so I just confuse whether it has s= ome issue.=0A= =0A= If I'm wrong, please ignore.=0A= =0A= =0A= Thanks,=0A= Michael=0A= =0A= > Thanks=0A= > Jingjing=0A= >=0A= >>> + ctxt.info.switch_id |=3D=0A= >>> + rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB);=0A= >>> +=0A= >>> + ret =3D i40e_aq_update_vsi_params(hw, &ctxt, NULL);=0A= >>> + if (ret)=0A= >>> + PMD_DRV_LOG(ERR, "update vsi switch failed,=0A= >> aq_err=3D%d\n",=0A= >>> + hw->aq.asq_last_status);=0A= >>> +}=0A= >>> +=0A= >>> /* Setup a VSI */=0A= >>> struct i40e_vsi *=0A= >>> i40e_vsi_setup(struct i40e_pf *pf,=0A= >>> @@ -2889,6 +2923,8 @@ i40e_vsi_setup(struct i40e_pf *pf,=0A= >>> PMD_DRV_LOG(ERR, "VEB setup failed");=0A= >>> return NULL;=0A= >>> }=0A= >>> + /* set ALLOWLOOPBACk on pf, when veb is created */=0A= >>> + i40e_enable_pf_lb(pf);=0A= >>> }=0A= >>>=0A= >>> vsi =3D rte_zmalloc("i40e_vsi", sizeof(struct i40e_vsi), 0);=0A= >=0A= =0A=