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 B8BAC1F5 for ; Thu, 29 Jan 2015 02:59:13 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 28 Jan 2015 17:59:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="446768169" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by FMSMGA003.fm.intel.com with ESMTP; 28 Jan 2015 17:45:20 -0800 Received: from kmsmsx154.gar.corp.intel.com (172.21.73.14) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 29 Jan 2015 09:56:50 +0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by KMSMSX154.gar.corp.intel.com (172.21.73.14) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 29 Jan 2015 09:56:50 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.253]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.129]) with mapi id 14.03.0195.001; Thu, 29 Jan 2015 09:56:09 +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 01:56:09 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CCD955@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> 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 01:59:14 -0000 On 1/29/2015 9:42 AM, Jingjing Wu wrote:=0A= > This patch enables PF's internal switch by setting ALLOWLOOPBACK=0A= > flag when VEB is created. With this patch, traffic from PF can be=0A= > switched on the VEB.=0A= >=0A= > Signed-off-by: Jingjing Wu =0A= > ---=0A= > lib/librte_pmd_i40e/i40e_ethdev.c | 36 +++++++++++++++++++++++++++++++++= +++=0A= > 1 file changed, 36 insertions(+)=0A= >=0A= > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c 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= > +{=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, 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= =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=0A= override this filled by "=3D".=0A= =0A= Thanks,=0A= Michael=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, 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=