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 50CA9234 for ; Thu, 29 Jan 2015 07:27:05 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 28 Jan 2015 22:23:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="446859408" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by FMSMGA003.fm.intel.com with ESMTP; 28 Jan 2015 22:13:14 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 29 Jan 2015 14:27:01 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.231]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.253]) with mapi id 14.03.0195.001; Thu, 29 Jan 2015 14:27:00 +0800 From: "Wu, Jingjing" To: "Qiu, Michael" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf Thread-Index: AQHQO2TNavgUER8W3UWkPkOFIBAwYpzWn62A Date: Thu, 29 Jan 2015 06:26:58 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8B86F0A@SHSMSX104.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> <533710CFB86FA344BFBF2D6802E60286CCFC41@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E60286CCFC41@SHSMSX101.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:27:05 -0000 Hi, Michael > -----Original Message----- > From: Qiu, Michael > Sent: Thursday, January 29, 2015 2:06 PM > To: Wu, Jingjing; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf >=20 > On 1/29/2015 12:57 PM, Wu, Jingjing wrote: > > Hi, Michael > > > >> -----Original Message----- > >> From: Qiu, Michael > >> Sent: Thursday, January 29, 2015 9:56 AM > >> To: Wu, Jingjing; dev@dpdk.org > >> Subject: Re: [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of > >> pf > >> > >> On 1/29/2015 9:42 AM, Jingjing Wu wrote: > >>> This patch enables PF's internal switch by setting ALLOWLOOPBACK > >>> flag when VEB is created. With this patch, traffic from PF can be > >>> switched on the VEB. > >>> > >>> Signed-off-by: Jingjing Wu > >>> --- > >>> lib/librte_pmd_i40e/i40e_ethdev.c | 36 > >>> ++++++++++++++++++++++++++++++++++++ > >>> 1 file changed, 36 insertions(+) > >>> > >>> diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > >>> b/lib/librte_pmd_i40e/i40e_ethdev.c > >>> index fe758c2..94fd36c 100644 > >>> --- a/lib/librte_pmd_i40e/i40e_ethdev.c > >>> +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > >>> @@ -2854,6 +2854,40 @@ i40e_vsi_dump_bw_config(struct i40e_vsi > *vsi) > >>> return 0; > >>> } > >>> > >>> +/* > >>> + * i40e_enable_pf_lb > >>> + * @pf: pointer to the pf structure > >>> + * > >>> + * allow loopback on pf > >>> + */ > >>> +static inline void > >>> +i40e_enable_pf_lb(struct i40e_pf *pf) { > >>> + struct i40e_hw *hw =3D I40E_PF_TO_HW(pf); > >>> + struct i40e_vsi_context ctxt; > >>> + int ret; > >>> + > >>> + memset(&ctxt, 0, sizeof(ctxt)); > >>> + ctxt.seid =3D pf->main_vsi_seid; > >>> + ctxt.pf_num =3D hw->pf_id; > >>> + ret =3D i40e_aq_get_vsi_params(hw, &ctxt, NULL); > >>> + if (ret) { > >>> + PMD_DRV_LOG(ERR, "couldn't get pf vsi config, err %d, > >> aq_err %d", > >>> + ret, hw->aq.asq_last_status); > >>> + return; > >>> + } > >>> + ctxt.flags =3D I40E_AQ_VSI_TYPE_PF; > >>> + ctxt.info.valid_sections =3D > >>> + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); > >> Here does it need to be "|=3D" ? As ctxt.infowill be filled in > >> i40e_aq_get_vsi_params(), I don't know if it has other issue for > >> override this filled by "=3D". > >> > >> Thanks, > >> Michael > > You can look at the following lines. What we called is > i40e_aq_update_vsi_params. > > So we need only set the flag we want to update. >=20 > Sorry, I make a mistake, what I mean is: >=20 > 1. ret =3D i40e_aq_get_vsi_params(hw, &ctxt, NULL); > here will fill the the field ctxt.info of struct i40e_vsi_context ct= xt right? > So ctxt.info is get from other place. >=20 > 2. Then: >=20 > + ctxt.info.valid_sections =3D > + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); >=20 > Has been override by assignment a value, so I just confuse whether it has > some issue. >=20 > If I'm wrong, please ignore.=20 >=20 >=20 > Thanks, > Michael >=20 I get your idea now. Some elements in ctxt is meaningless and not set when = getting, and others are meaningful when updating. The valid_sections is only meaningful when setting. If one flag i= n valid_section is set, it means the hw need to process corresponding section. > > Thanks > > Jingjing > > > >>> + ctxt.info.switch_id |=3D > >>> + rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); > >>> + > >>> + ret =3D i40e_aq_update_vsi_params(hw, &ctxt, NULL); > >>> + if (ret) > >>> + PMD_DRV_LOG(ERR, "update vsi switch failed, > >> aq_err=3D%d\n", > >>> + hw->aq.asq_last_status); > >>> +} > >>> + > >>> /* Setup a VSI */ > >>> struct i40e_vsi * > >>> i40e_vsi_setup(struct i40e_pf *pf, > >>> @@ -2889,6 +2923,8 @@ i40e_vsi_setup(struct i40e_pf *pf, > >>> PMD_DRV_LOG(ERR, "VEB setup failed"); > >>> return NULL; > >>> } > >>> + /* set ALLOWLOOPBACk on pf, when veb is created */ > >>> + i40e_enable_pf_lb(pf); > >>> } > >>> > >>> vsi =3D rte_zmalloc("i40e_vsi", sizeof(struct i40e_vsi), 0); > >