* [dpdk-dev] [PATCH] net/i40e: fix PF notify issue when VF not up @ 2017-07-24 18:42 Xiaoyun Li 2017-07-26 6:14 ` Yang, Qiming 2017-07-28 11:39 ` [dpdk-dev] [PATCH v2] " Xiaoyun Li 0 siblings, 2 replies; 8+ messages in thread From: Xiaoyun Li @ 2017-07-24 18:42 UTC (permalink / raw) To: dev; +Cc: jingjing.wu, Xiaoyun Li, stable This patch modifies PF notify error to warning when not starting up VF. Fixes: 4861cde46116 ("i40e: new poll mode driver") Cc: stable@dpdk.org Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> --- drivers/net/i40e/i40e_pf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index b4cf57f..2a29f1a 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -267,8 +267,12 @@ i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf, ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval, msg, msglen, NULL); if (ret) { - PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", - hw->aq.asq_last_status); + if (vf->state == I40E_VF_INACTIVE) + PMD_DRV_LOG(WARNING, "Warning! VF %u is inactive now!", + abs_vf_id); + else + PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", + hw->aq.asq_last_status); } return ret; -- 2.7.4 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] net/i40e: fix PF notify issue when VF not up 2017-07-24 18:42 [dpdk-dev] [PATCH] net/i40e: fix PF notify issue when VF not up Xiaoyun Li @ 2017-07-26 6:14 ` Yang, Qiming 2017-07-28 11:39 ` [dpdk-dev] [PATCH v2] " Xiaoyun Li 1 sibling, 0 replies; 8+ messages in thread From: Yang, Qiming @ 2017-07-26 6:14 UTC (permalink / raw) To: Li, Xiaoyun, dev; +Cc: Wu, Jingjing, Li, Xiaoyun, stable > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xiaoyun Li > Sent: Tuesday, July 25, 2017 2:43 AM > To: dev@dpdk.org > Cc: Wu, Jingjing <jingjing.wu@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>; > stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/i40e: fix PF notify issue when VF not up > > This patch modifies PF notify error to warning when not starting up VF. > > Fixes: 4861cde46116 ("i40e: new poll mode driver") > Cc: stable@dpdk.org > > Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> > --- > drivers/net/i40e/i40e_pf.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index > b4cf57f..2a29f1a 100644 > --- a/drivers/net/i40e/i40e_pf.c > +++ b/drivers/net/i40e/i40e_pf.c > @@ -267,8 +267,12 @@ i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf, > ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval, > msg, msglen, NULL); > if (ret) { > - PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", > - hw->aq.asq_last_status); > + if (vf->state == I40E_VF_INACTIVE) > + PMD_DRV_LOG(WARNING, "Warning! VF %u is inactive > now!", > + abs_vf_id); > + else > + PMD_INIT_LOG(ERR, "Fail to send message to VF, > err %u", > + hw->aq.asq_last_status); > } > > return ret; > -- > 2.7.4 Reviewed-by: Qiming Yang <Qiming.yang@intel.com> ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v2] net/i40e: fix PF notify issue when VF not up 2017-07-24 18:42 [dpdk-dev] [PATCH] net/i40e: fix PF notify issue when VF not up Xiaoyun Li 2017-07-26 6:14 ` Yang, Qiming @ 2017-07-28 11:39 ` Xiaoyun Li 2017-07-28 6:52 ` Wu, Jingjing 2017-07-28 15:48 ` [dpdk-dev] [PATCH v3] " Xiaoyun Li 1 sibling, 2 replies; 8+ messages in thread From: Xiaoyun Li @ 2017-07-28 11:39 UTC (permalink / raw) To: jingjing.wu; +Cc: dev, Xiaoyun Li, stable This patch modifies PF notify error to warning when not starting up VF and modifies VF state to active when VF reset is completed. Fixes: 4861cde46116 ("i40e: new poll mode driver") Cc: stable@dpdk.org Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> --- v2 changes: * add VF state modification when VF reset is done. --- drivers/net/i40e/i40e_pf.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index b4cf57f..5d5d24a 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -152,22 +152,23 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset) val |= I40E_VPGEN_VFRTRIG_VFSWR_MASK; I40E_WRITE_REG(hw, I40E_VPGEN_VFRTRIG(vf_id), val); I40E_WRITE_FLUSH(hw); - } #define VFRESET_MAX_WAIT_CNT 100 - /* Wait until VF reset is done */ - for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) { - rte_delay_us(10); - val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); - if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) - break; - } + /* Wait until VF reset is done */ + for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) { + rte_delay_us(10); + val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); + if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) { + vf->state = I40E_VF_ACTIVE; + break; + } + } - if (i >= VFRESET_MAX_WAIT_CNT) { - PMD_DRV_LOG(ERR, "VF reset timeout"); - return -ETIMEDOUT; + if (i >= VFRESET_MAX_WAIT_CNT) { + PMD_DRV_LOG(ERR, "VF reset timeout"); + return -ETIMEDOUT; + } } - /* This is not first time to do reset, do cleanup job first */ if (vf->vsi) { /* Disable queues */ @@ -267,8 +268,12 @@ i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf, ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval, msg, msglen, NULL); if (ret) { - PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", - hw->aq.asq_last_status); + if (vf->state == I40E_VF_INACTIVE) + PMD_DRV_LOG(WARNING, "Warning! VF %u is inactive now!", + abs_vf_id); + else + PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", + hw->aq.asq_last_status); } return ret; -- 2.7.4 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/i40e: fix PF notify issue when VF not up 2017-07-28 11:39 ` [dpdk-dev] [PATCH v2] " Xiaoyun Li @ 2017-07-28 6:52 ` Wu, Jingjing 2017-07-28 7:06 ` Li, Xiaoyun 2017-07-28 15:48 ` [dpdk-dev] [PATCH v3] " Xiaoyun Li 1 sibling, 1 reply; 8+ messages in thread From: Wu, Jingjing @ 2017-07-28 6:52 UTC (permalink / raw) To: Li, Xiaoyun; +Cc: dev, stable > -----Original Message----- > From: Li, Xiaoyun > Sent: Friday, July 28, 2017 7:40 PM > To: Wu, Jingjing <jingjing.wu@intel.com> > Cc: dev@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>; stable@dpdk.org > Subject: [PATCH v2] net/i40e: fix PF notify issue when VF not up > > This patch modifies PF notify error to warning when not starting > up VF and modifies VF state to active when VF reset is completed. > > Fixes: 4861cde46116 ("i40e: new poll mode driver") > Cc: stable@dpdk.org > > Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> > --- > v2 changes: > * add VF state modification when VF reset is done. > --- > drivers/net/i40e/i40e_pf.c | 33 +++++++++++++++++++-------------- > 1 file changed, 19 insertions(+), 14 deletions(-) > > diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c > index b4cf57f..5d5d24a 100644 > --- a/drivers/net/i40e/i40e_pf.c > +++ b/drivers/net/i40e/i40e_pf.c > @@ -152,22 +152,23 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset) > val |= I40E_VPGEN_VFRTRIG_VFSWR_MASK; > I40E_WRITE_REG(hw, I40E_VPGEN_VFRTRIG(vf_id), val); > I40E_WRITE_FLUSH(hw); > - } > > #define VFRESET_MAX_WAIT_CNT 100 > - /* Wait until VF reset is done */ > - for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) { > - rte_delay_us(10); > - val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); > - if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) > - break; > - } > + /* Wait until VF reset is done */ > + for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) { > + rte_delay_us(10); > + val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); > + if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) { > + vf->state = I40E_VF_ACTIVE; > + break; > + } > + } > > - if (i >= VFRESET_MAX_WAIT_CNT) { > - PMD_DRV_LOG(ERR, "VF reset timeout"); > - return -ETIMEDOUT; > + if (i >= VFRESET_MAX_WAIT_CNT) { > + PMD_DRV_LOG(ERR, "VF reset timeout"); > + return -ETIMEDOUT; > + } It's much clearer to add "vf->state = I40E_VF_ACTIVE;" here but not above. > } > - > /* This is not first time to do reset, do cleanup job first */ > if (vf->vsi) { > /* Disable queues */ > @@ -267,8 +268,12 @@ i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf, > ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval, > msg, msglen, NULL); > if (ret) { > - PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", > - hw->aq.asq_last_status); > + if (vf->state == I40E_VF_INACTIVE) > + PMD_DRV_LOG(WARNING, "Warning! VF %u is inactive now!", > + abs_vf_id); How about just don't send msg to inactive VF but not print warning? > + else > + PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", > + hw->aq.asq_last_status); > } > > return ret; > -- > 2.7.4 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/i40e: fix PF notify issue when VF not up 2017-07-28 6:52 ` Wu, Jingjing @ 2017-07-28 7:06 ` Li, Xiaoyun 0 siblings, 0 replies; 8+ messages in thread From: Li, Xiaoyun @ 2017-07-28 7:06 UTC (permalink / raw) To: Wu, Jingjing; +Cc: dev, stable 1. At first, I add vs state modification as follows, but it will show a warning when I check the patch. The warning says that usually the else after return or break would not be executed. if (i >= VFRESET_MAX_WAIT_CNT) { PMD_DRV_LOG(ERR, "VF reset timeout"); return -ETIMEDOUT; } else vf->state = I40E_VF_ACTIVE; 2. Does it mean if vf state isn't inactive, the function will do "ret = i40e_aq_send_msg_to_vf();" and following statements ? -----Original Message----- From: Wu, Jingjing Sent: Friday, July 28, 2017 14:53 To: Li, Xiaoyun <xiaoyun.li@intel.com> Cc: dev@dpdk.org; stable@dpdk.org Subject: RE: [PATCH v2] net/i40e: fix PF notify issue when VF not up > -----Original Message----- > From: Li, Xiaoyun > Sent: Friday, July 28, 2017 7:40 PM > To: Wu, Jingjing <jingjing.wu@intel.com> > Cc: dev@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>; stable@dpdk.org > Subject: [PATCH v2] net/i40e: fix PF notify issue when VF not up > > This patch modifies PF notify error to warning when not starting up VF > and modifies VF state to active when VF reset is completed. > > Fixes: 4861cde46116 ("i40e: new poll mode driver") > Cc: stable@dpdk.org > > Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> > --- > v2 changes: > * add VF state modification when VF reset is done. > --- > drivers/net/i40e/i40e_pf.c | 33 +++++++++++++++++++-------------- > 1 file changed, 19 insertions(+), 14 deletions(-) > > diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c > index b4cf57f..5d5d24a 100644 > --- a/drivers/net/i40e/i40e_pf.c > +++ b/drivers/net/i40e/i40e_pf.c > @@ -152,22 +152,23 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset) > val |= I40E_VPGEN_VFRTRIG_VFSWR_MASK; > I40E_WRITE_REG(hw, I40E_VPGEN_VFRTRIG(vf_id), val); > I40E_WRITE_FLUSH(hw); > - } > > #define VFRESET_MAX_WAIT_CNT 100 > - /* Wait until VF reset is done */ > - for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) { > - rte_delay_us(10); > - val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); > - if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) > - break; > - } > + /* Wait until VF reset is done */ > + for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) { > + rte_delay_us(10); > + val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); > + if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) { > + vf->state = I40E_VF_ACTIVE; > + break; > + } > + } > > - if (i >= VFRESET_MAX_WAIT_CNT) { > - PMD_DRV_LOG(ERR, "VF reset timeout"); > - return -ETIMEDOUT; > + if (i >= VFRESET_MAX_WAIT_CNT) { > + PMD_DRV_LOG(ERR, "VF reset timeout"); > + return -ETIMEDOUT; > + } It's much clearer to add "vf->state = I40E_VF_ACTIVE;" here but not above. > } > - > /* This is not first time to do reset, do cleanup job first */ > if (vf->vsi) { > /* Disable queues */ > @@ -267,8 +268,12 @@ i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf, > ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval, > msg, msglen, NULL); > if (ret) { > - PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", > - hw->aq.asq_last_status); > + if (vf->state == I40E_VF_INACTIVE) > + PMD_DRV_LOG(WARNING, "Warning! VF %u is inactive now!", > + abs_vf_id); How about just don't send msg to inactive VF but not print warning? > + else > + PMD_INIT_LOG(ERR, "Fail to send message to VF, err %u", > + hw->aq.asq_last_status); > } > > return ret; > -- > 2.7.4 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v3] net/i40e: fix PF notify issue when VF not up 2017-07-28 11:39 ` [dpdk-dev] [PATCH v2] " Xiaoyun Li 2017-07-28 6:52 ` Wu, Jingjing @ 2017-07-28 15:48 ` Xiaoyun Li 2017-07-31 2:50 ` Wu, Jingjing 1 sibling, 1 reply; 8+ messages in thread From: Xiaoyun Li @ 2017-07-28 15:48 UTC (permalink / raw) To: jingjing.wu; +Cc: dev, Xiaoyun Li, stable This patch stops PF from sending messages to inactive VF and modifies VF state to active when VF reset is completed. Fixes: 4861cde46116 ("i40e: new poll mode driver") Cc: stable@dpdk.org Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> --- drivers/net/i40e/i40e_pf.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index b4cf57f..e64f849 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -152,22 +152,22 @@ i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset) val |= I40E_VPGEN_VFRTRIG_VFSWR_MASK; I40E_WRITE_REG(hw, I40E_VPGEN_VFRTRIG(vf_id), val); I40E_WRITE_FLUSH(hw); - } #define VFRESET_MAX_WAIT_CNT 100 - /* Wait until VF reset is done */ - for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) { - rte_delay_us(10); - val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); - if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) - break; - } + /* Wait until VF reset is done */ + for (i = 0; i < VFRESET_MAX_WAIT_CNT; i++) { + rte_delay_us(10); + val = I40E_READ_REG(hw, I40E_VPGEN_VFRSTAT(vf_id)); + if (val & I40E_VPGEN_VFRSTAT_VFRD_MASK) + break; + } - if (i >= VFRESET_MAX_WAIT_CNT) { - PMD_DRV_LOG(ERR, "VF reset timeout"); - return -ETIMEDOUT; + if (i >= VFRESET_MAX_WAIT_CNT) { + PMD_DRV_LOG(ERR, "VF reset timeout"); + return -ETIMEDOUT; + } + vf->state = I40E_VF_ACTIVE; } - /* This is not first time to do reset, do cleanup job first */ if (vf->vsi) { /* Disable queues */ @@ -262,7 +262,10 @@ i40e_pf_host_send_msg_to_vf(struct i40e_pf_vf *vf, { struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf); uint16_t abs_vf_id = hw->func_caps.vf_base_id + vf->vf_idx; - int ret; + int ret = I40E_ERR_ADMIN_QUEUE_ERROR; + + if (vf->state == I40E_VF_INACTIVE) + return ret; ret = i40e_aq_send_msg_to_vf(hw, abs_vf_id, opcode, retval, msg, msglen, NULL); -- 2.7.4 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v3] net/i40e: fix PF notify issue when VF not up 2017-07-28 15:48 ` [dpdk-dev] [PATCH v3] " Xiaoyun Li @ 2017-07-31 2:50 ` Wu, Jingjing 2017-07-31 14:41 ` Ferruh Yigit 0 siblings, 1 reply; 8+ messages in thread From: Wu, Jingjing @ 2017-07-31 2:50 UTC (permalink / raw) To: Li, Xiaoyun; +Cc: dev, stable > -----Original Message----- > From: Li, Xiaoyun > Sent: Friday, July 28, 2017 11:48 PM > To: Wu, Jingjing <jingjing.wu@intel.com> > Cc: dev@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>; stable@dpdk.org > Subject: [PATCH v3] net/i40e: fix PF notify issue when VF not up > > This patch stops PF from sending messages to inactive VF > and modifies VF state to active when VF reset is completed. > > Fixes: 4861cde46116 ("i40e: new poll mode driver") > Cc: stable@dpdk.org > > Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com> Thanks Jingjing ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v3] net/i40e: fix PF notify issue when VF not up 2017-07-31 2:50 ` Wu, Jingjing @ 2017-07-31 14:41 ` Ferruh Yigit 0 siblings, 0 replies; 8+ messages in thread From: Ferruh Yigit @ 2017-07-31 14:41 UTC (permalink / raw) To: Wu, Jingjing, Li, Xiaoyun; +Cc: dev, stable On 7/31/2017 3:50 AM, Wu, Jingjing wrote: > > >> -----Original Message----- >> From: Li, Xiaoyun >> Sent: Friday, July 28, 2017 11:48 PM >> To: Wu, Jingjing <jingjing.wu@intel.com> >> Cc: dev@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>; stable@dpdk.org >> Subject: [PATCH v3] net/i40e: fix PF notify issue when VF not up >> >> This patch stops PF from sending messages to inactive VF >> and modifies VF state to active when VF reset is completed. >> >> Fixes: 4861cde46116 ("i40e: new poll mode driver") >> Cc: stable@dpdk.org >> >> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> > Acked-by: Jingjing Wu <jingjing.wu@intel.com> Applied to dpdk-next-net/master, thanks. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-07-31 14:41 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-07-24 18:42 [dpdk-dev] [PATCH] net/i40e: fix PF notify issue when VF not up Xiaoyun Li 2017-07-26 6:14 ` Yang, Qiming 2017-07-28 11:39 ` [dpdk-dev] [PATCH v2] " Xiaoyun Li 2017-07-28 6:52 ` Wu, Jingjing 2017-07-28 7:06 ` Li, Xiaoyun 2017-07-28 15:48 ` [dpdk-dev] [PATCH v3] " Xiaoyun Li 2017-07-31 2:50 ` Wu, Jingjing 2017-07-31 14:41 ` Ferruh Yigit
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).