* [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver @ 2015-01-29 1:41 Jingjing Wu 2015-01-29 1:41 ` [dpdk-dev] [PATCH 1/2] i40e: fix the bug when configuring vsi Jingjing Wu ` (5 more replies) 0 siblings, 6 replies; 12+ messages in thread From: Jingjing Wu @ 2015-01-29 1:41 UTC (permalink / raw) To: dev Enable SRIOV switch in i40e driver. With this patch set, SRIOV switch can be done on Fortville NICs. Jingjing Wu (2): i40e: fix the bug when configuring vsi i40e: enable internal switch of pf lib/librte_pmd_i40e/i40e_ethdev.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 1/2] i40e: fix the bug when configuring vsi 2015-01-29 1:41 [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver Jingjing Wu @ 2015-01-29 1:41 ` Jingjing Wu 2015-01-29 1:41 ` [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf Jingjing Wu ` (4 subsequent siblings) 5 siblings, 0 replies; 12+ messages in thread From: Jingjing Wu @ 2015-01-29 1:41 UTC (permalink / raw) To: dev In i40e_vsi_config_tc_queue_mapping, should add a flag to indicate another valid setting by OR operation, but not set this flag to valid_sections, otherwise it will overwrite the flags set before. Signed-off-by: Jingjing Wu <jingjing.wu@intel.com> --- lib/librte_pmd_i40e/i40e_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index b47a3d2..fe758c2 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -2632,7 +2632,7 @@ i40e_vsi_config_tc_queue_mapping(struct i40e_vsi *vsi, rte_cpu_to_le_16(I40E_AQ_VSI_QUE_MAP_CONTIG); info->queue_mapping[0] = rte_cpu_to_le_16(vsi->base_queue); } - info->valid_sections = + info->valid_sections |= rte_cpu_to_le_16(I40E_AQ_VSI_PROP_QUEUE_MAP_VALID); return I40E_SUCCESS; -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf 2015-01-29 1:41 [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver Jingjing Wu 2015-01-29 1:41 ` [dpdk-dev] [PATCH 1/2] i40e: fix the bug when configuring vsi Jingjing Wu @ 2015-01-29 1:41 ` Jingjing Wu 2015-01-29 1:56 ` Qiu, Michael 2015-02-04 7:41 ` [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver Liu, Jijiang ` (3 subsequent siblings) 5 siblings, 1 reply; 12+ messages in thread From: Jingjing Wu @ 2015-01-29 1:41 UTC (permalink / raw) To: dev 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 <jingjing.wu@intel.com> --- 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 = I40E_PF_TO_HW(pf); + struct i40e_vsi_context ctxt; + int ret; + + memset(&ctxt, 0, sizeof(ctxt)); + ctxt.seid = pf->main_vsi_seid; + ctxt.pf_num = hw->pf_id; + ret = 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 = I40E_AQ_VSI_TYPE_PF; + ctxt.info.valid_sections = + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); + ctxt.info.switch_id |= + rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); + + ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); + if (ret) + PMD_DRV_LOG(ERR, "update vsi switch failed, aq_err=%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 = rte_zmalloc("i40e_vsi", sizeof(struct i40e_vsi), 0); -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf 2015-01-29 1:41 ` [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf Jingjing Wu @ 2015-01-29 1:56 ` Qiu, Michael 2015-01-29 4:57 ` Wu, Jingjing 0 siblings, 1 reply; 12+ messages in thread From: Qiu, Michael @ 2015-01-29 1:56 UTC (permalink / raw) To: Wu, Jingjing, dev 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 <jingjing.wu@intel.com> > --- > 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 = I40E_PF_TO_HW(pf); > + struct i40e_vsi_context ctxt; > + int ret; > + > + memset(&ctxt, 0, sizeof(ctxt)); > + ctxt.seid = pf->main_vsi_seid; > + ctxt.pf_num = hw->pf_id; > + ret = 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 = I40E_AQ_VSI_TYPE_PF; > + ctxt.info.valid_sections = > + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); Here does it need to be "|=" ? 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 "=". Thanks, Michael > + ctxt.info.switch_id |= > + rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); > + > + ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); > + if (ret) > + PMD_DRV_LOG(ERR, "update vsi switch failed, aq_err=%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 = rte_zmalloc("i40e_vsi", sizeof(struct i40e_vsi), 0); ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf 2015-01-29 1:56 ` Qiu, Michael @ 2015-01-29 4:57 ` Wu, Jingjing 2015-01-29 6:06 ` Qiu, Michael 0 siblings, 1 reply; 12+ messages in thread From: Wu, Jingjing @ 2015-01-29 4:57 UTC (permalink / raw) To: Qiu, Michael, dev 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 <jingjing.wu@intel.com> > > --- > > 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 = I40E_PF_TO_HW(pf); > > + struct i40e_vsi_context ctxt; > > + int ret; > > + > > + memset(&ctxt, 0, sizeof(ctxt)); > > + ctxt.seid = pf->main_vsi_seid; > > + ctxt.pf_num = hw->pf_id; > > + ret = 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 = I40E_AQ_VSI_TYPE_PF; > > + ctxt.info.valid_sections = > > + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); > > Here does it need to be "|=" ? 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 "=". > > 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. Thanks Jingjing > > + ctxt.info.switch_id |= > > + rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); > > + > > + ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); > > + if (ret) > > + PMD_DRV_LOG(ERR, "update vsi switch failed, > aq_err=%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 = rte_zmalloc("i40e_vsi", sizeof(struct i40e_vsi), 0); ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf 2015-01-29 4:57 ` Wu, Jingjing @ 2015-01-29 6:06 ` Qiu, Michael 2015-01-29 6:26 ` Wu, Jingjing 0 siblings, 1 reply; 12+ messages in thread From: Qiu, Michael @ 2015-01-29 6:06 UTC (permalink / raw) To: Wu, Jingjing, dev 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 <jingjing.wu@intel.com> >>> --- >>> 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 = I40E_PF_TO_HW(pf); >>> + struct i40e_vsi_context ctxt; >>> + int ret; >>> + >>> + memset(&ctxt, 0, sizeof(ctxt)); >>> + ctxt.seid = pf->main_vsi_seid; >>> + ctxt.pf_num = hw->pf_id; >>> + ret = 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 = I40E_AQ_VSI_TYPE_PF; >>> + ctxt.info.valid_sections = >>> + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); >> Here does it need to be "|=" ? 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 "=". >> >> 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. Sorry, I make a mistake, what I mean is: 1. ret = i40e_aq_get_vsi_params(hw, &ctxt, NULL); here will fill the the field ctxt.info of struct i40e_vsi_context ctxt right? So ctxt.info is get from other place. 2. Then: + ctxt.info.valid_sections = + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); Has been override by assignment a value, so I just confuse whether it has some issue. If I'm wrong, please ignore. Thanks, Michael > Thanks > Jingjing > >>> + ctxt.info.switch_id |= >>> + rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); >>> + >>> + ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); >>> + if (ret) >>> + PMD_DRV_LOG(ERR, "update vsi switch failed, >> aq_err=%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 = rte_zmalloc("i40e_vsi", sizeof(struct i40e_vsi), 0); > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf 2015-01-29 6:06 ` Qiu, Michael @ 2015-01-29 6:26 ` Wu, Jingjing 2015-01-29 6:52 ` Qiu, Michael 0 siblings, 1 reply; 12+ messages in thread From: Wu, Jingjing @ 2015-01-29 6:26 UTC (permalink / raw) To: Qiu, Michael, dev 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 > > 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 <jingjing.wu@intel.com> > >>> --- > >>> 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 = I40E_PF_TO_HW(pf); > >>> + struct i40e_vsi_context ctxt; > >>> + int ret; > >>> + > >>> + memset(&ctxt, 0, sizeof(ctxt)); > >>> + ctxt.seid = pf->main_vsi_seid; > >>> + ctxt.pf_num = hw->pf_id; > >>> + ret = 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 = I40E_AQ_VSI_TYPE_PF; > >>> + ctxt.info.valid_sections = > >>> + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); > >> Here does it need to be "|=" ? 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 "=". > >> > >> 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. > > Sorry, I make a mistake, what I mean is: > > 1. ret = i40e_aq_get_vsi_params(hw, &ctxt, NULL); > here will fill the the field ctxt.info of struct i40e_vsi_context ctxt right? > So ctxt.info is get from other place. > > 2. Then: > > + ctxt.info.valid_sections = > + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); > > Has been override by assignment a value, so I just confuse whether it has > some issue. > > If I'm wrong, please ignore. > > > Thanks, > Michael > 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 in valid_section is set, it means the hw need to process corresponding section. > > Thanks > > Jingjing > > > >>> + ctxt.info.switch_id |= > >>> + rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); > >>> + > >>> + ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); > >>> + if (ret) > >>> + PMD_DRV_LOG(ERR, "update vsi switch failed, > >> aq_err=%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 = rte_zmalloc("i40e_vsi", sizeof(struct i40e_vsi), 0); > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf 2015-01-29 6:26 ` Wu, Jingjing @ 2015-01-29 6:52 ` Qiu, Michael 0 siblings, 0 replies; 12+ messages in thread From: Qiu, Michael @ 2015-01-29 6:52 UTC (permalink / raw) To: Wu, Jingjing, dev On 1/29/2015 2:27 PM, Wu, Jingjing wrote: > 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 >> >> 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 <jingjing.wu@intel.com> >>>>> --- >>>>> 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 = I40E_PF_TO_HW(pf); >>>>> + struct i40e_vsi_context ctxt; >>>>> + int ret; >>>>> + >>>>> + memset(&ctxt, 0, sizeof(ctxt)); >>>>> + ctxt.seid = pf->main_vsi_seid; >>>>> + ctxt.pf_num = hw->pf_id; >>>>> + ret = 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 = I40E_AQ_VSI_TYPE_PF; >>>>> + ctxt.info.valid_sections = >>>>> + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); >>>> Here does it need to be "|=" ? 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 "=". >>>> >>>> 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. >> Sorry, I make a mistake, what I mean is: >> >> 1. ret = i40e_aq_get_vsi_params(hw, &ctxt, NULL); >> here will fill the the field ctxt.info of struct i40e_vsi_context ctxt right? >> So ctxt.info is get from other place. >> >> 2. Then: >> >> + ctxt.info.valid_sections = >> + rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SWITCH_VALID); >> >> Has been override by assignment a value, so I just confuse whether it has >> some issue. >> >> If I'm wrong, please ignore. >> >> >> Thanks, >> Michael >> > 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 in valid_section is set, it means the > hw need to process corresponding section. OK, as it meaningless, I agree with you. Thanks, Michael >>> Thanks >>> Jingjing >>> >>>>> + ctxt.info.switch_id |= >>>>> + rte_cpu_to_le_16(I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB); >>>>> + >>>>> + ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); >>>>> + if (ret) >>>>> + PMD_DRV_LOG(ERR, "update vsi switch failed, >>>> aq_err=%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 = rte_zmalloc("i40e_vsi", sizeof(struct i40e_vsi), 0); > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver 2015-01-29 1:41 [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver Jingjing Wu 2015-01-29 1:41 ` [dpdk-dev] [PATCH 1/2] i40e: fix the bug when configuring vsi Jingjing Wu 2015-01-29 1:41 ` [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf Jingjing Wu @ 2015-02-04 7:41 ` Liu, Jijiang 2015-02-09 8:55 ` Zhang, Helin ` (2 subsequent siblings) 5 siblings, 0 replies; 12+ messages in thread From: Liu, Jijiang @ 2015-02-04 7:41 UTC (permalink / raw) To: Wu, Jingjing, dev > -----Original Message----- > From: Wu, Jingjing > Sent: Thursday, January 29, 2015 9:42 AM > To: dev@dpdk.org > Cc: Wu, Jingjing; Zhang, Helin; Chen, Jing D; Cao, Min > Subject: [PATCH 0/2] enable SRIOV switch in i40e driver > > Enable SRIOV switch in i40e driver. With this patch set, SRIOV switch can be > done on Fortville NICs. > > Jingjing Wu (2): > i40e: fix the bug when configuring vsi > i40e: enable internal switch of pf > > lib/librte_pmd_i40e/i40e_ethdev.c | 38 > +++++++++++++++++++++++++++++++++++++- > 1 file changed, 37 insertions(+), 1 deletion(-) > > -- > 1.9.3 Acked-by: Jijiang Liu <Jijiang.liu@intel.com> ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver 2015-01-29 1:41 [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver Jingjing Wu ` (2 preceding siblings ...) 2015-02-04 7:41 ` [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver Liu, Jijiang @ 2015-02-09 8:55 ` Zhang, Helin 2015-02-15 6:26 ` Cao, Min 2015-02-15 6:30 ` Cao, Min 5 siblings, 0 replies; 12+ messages in thread From: Zhang, Helin @ 2015-02-09 8:55 UTC (permalink / raw) To: Wu, Jingjing; +Cc: dev > -----Original Message----- > From: Wu, Jingjing > Sent: Thursday, January 29, 2015 9:42 AM > To: dev@dpdk.org > Cc: Wu, Jingjing; Zhang, Helin; Chen, Jing D; Cao, Min > Subject: [PATCH 0/2] enable SRIOV switch in i40e driver > > Enable SRIOV switch in i40e driver. With this patch set, SRIOV switch can be > done on Fortville NICs. > > Jingjing Wu (2): > i40e: fix the bug when configuring vsi > i40e: enable internal switch of pf > > lib/librte_pmd_i40e/i40e_ethdev.c | 38 > +++++++++++++++++++++++++++++++++++++- > 1 file changed, 37 insertions(+), 1 deletion(-) > > -- > 1.9.3 Applied. Thanks to Jingjing and Jijiang! ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver 2015-01-29 1:41 [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver Jingjing Wu ` (3 preceding siblings ...) 2015-02-09 8:55 ` Zhang, Helin @ 2015-02-15 6:26 ` Cao, Min 2015-02-15 6:30 ` Cao, Min 5 siblings, 0 replies; 12+ messages in thread From: Cao, Min @ 2015-02-15 6:26 UTC (permalink / raw) To: Wu, Jingjing, dev Test by: min.cao <min.cao@intel.com> Patch name: [PATCH 0/2] enable SRIOV switch in i40e driver Test Flag: Tested-by Tester name: min.cao@intel.com Result summary: total 1 cases, 1 passed, 0 failed Test Case 1: Name: packet forwarding of SRIOV switch in i40e driver Environment: OS: Fedora20 3.11.10-301.fc20.x86_64 gcc (GCC) 4.8.2 CPU: Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz NIC: Fortville eagle Test result: PASSED Detail: packet forwarding of SRIOV switch in i40e driver are successful between 2 vms. -----Original Message----- From: Wu, Jingjing Sent: Thursday, January 29, 2015 9:42 AM To: dev@dpdk.org Cc: Wu, Jingjing; Zhang, Helin; Chen, Jing D; Cao, Min Subject: [PATCH 0/2] enable SRIOV switch in i40e driver Enable SRIOV switch in i40e driver. With this patch set, SRIOV switch can be done on Fortville NICs. Jingjing Wu (2): i40e: fix the bug when configuring vsi i40e: enable internal switch of pf lib/librte_pmd_i40e/i40e_ethdev.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver 2015-01-29 1:41 [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver Jingjing Wu ` (4 preceding siblings ...) 2015-02-15 6:26 ` Cao, Min @ 2015-02-15 6:30 ` Cao, Min 5 siblings, 0 replies; 12+ messages in thread From: Cao, Min @ 2015-02-15 6:30 UTC (permalink / raw) To: Cao, Min, Wu, Jingjing, dev Tested-by: min.cao <min.cao@intel.com> Patch name: [PATCH 0/2] enable SRIOV switch in i40e driver Test Flag: Tested-by Tester name: min.cao@intel.com Result summary: total 1 cases, 1 passed, 0 failed Test Case 1: Name: packet forwarding of SRIOV switch in i40e driver Environment: OS: Fedora20 3.11.10-301.fc20.x86_64 gcc (GCC) 4.8.2 CPU: Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz NIC: Fortville eagle Test result: PASSED Detail: packet forwarding of SRIOV switch in i40e driver are successful between 2 vms. -----Original Message----- From: Wu, Jingjing Sent: Thursday, January 29, 2015 9:42 AM To: dev@dpdk.org Cc: Wu, Jingjing; Zhang, Helin; Chen, Jing D; Cao, Min Subject: [PATCH 0/2] enable SRIOV switch in i40e driver Enable SRIOV switch in i40e driver. With this patch set, SRIOV switch can be done on Fortville NICs. Jingjing Wu (2): i40e: fix the bug when configuring vsi i40e: enable internal switch of pf lib/librte_pmd_i40e/i40e_ethdev.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-02-15 6:30 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-01-29 1:41 [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver Jingjing Wu 2015-01-29 1:41 ` [dpdk-dev] [PATCH 1/2] i40e: fix the bug when configuring vsi Jingjing Wu 2015-01-29 1:41 ` [dpdk-dev] [PATCH 2/2] i40e: enable internal switch of pf Jingjing Wu 2015-01-29 1:56 ` Qiu, Michael 2015-01-29 4:57 ` Wu, Jingjing 2015-01-29 6:06 ` Qiu, Michael 2015-01-29 6:26 ` Wu, Jingjing 2015-01-29 6:52 ` Qiu, Michael 2015-02-04 7:41 ` [dpdk-dev] [PATCH 0/2] enable SRIOV switch in i40e driver Liu, Jijiang 2015-02-09 8:55 ` Zhang, Helin 2015-02-15 6:26 ` Cao, Min 2015-02-15 6:30 ` Cao, Min
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).