* [dpdk-dev] [PATCH] net/i40e: fix FDIR check programming status error @ 2018-07-11 8:25 Wei Zhao 2018-07-13 3:05 ` Zhang, Qi Z 2018-07-13 3:09 ` [dpdk-dev] [PATCH v2] " Zhao Wei 0 siblings, 2 replies; 8+ messages in thread From: Wei Zhao @ 2018-07-11 8:25 UTC (permalink / raw) To: dev; +Cc: qi.z.zhang, stable, Wei Zhao In i40e FDIR PMD code for checking programming status function i40e_check_fdir_programming_status(), the initial value of return value ret should be set to -1 not 0, because if DD bit of I40E_RX_DESC_STATUS_DD is not write back, this function will return 0 to upper function, this give an error info to upper function, the fact for this is it is time out for DD write back and it should return -1. Fixes: 05999aab4ca6 ("i40e: add or delete flow director") Signed-off-by: Wei Zhao <wei.zhao1@intel.com> --- drivers/net/i40e/i40e_fdir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index d41601a..b958bf6 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -1315,7 +1315,7 @@ i40e_check_fdir_programming_status(struct i40e_rx_queue *rxq) uint32_t rx_status; uint32_t len, id; uint32_t error; - int ret = 0; + int ret = -1; rxdp = &rxq->rx_ring[rxq->rx_tail]; qword1 = rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len); @@ -1360,6 +1360,7 @@ i40e_check_fdir_programming_status(struct i40e_rx_queue *rxq) I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1); else I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_tail - 1); + ret = 0; } return ret; -- 2.7.5 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] net/i40e: fix FDIR check programming status error 2018-07-11 8:25 [dpdk-dev] [PATCH] net/i40e: fix FDIR check programming status error Wei Zhao @ 2018-07-13 3:05 ` Zhang, Qi Z 2018-07-13 3:11 ` Zhao1, Wei 2018-07-13 3:09 ` [dpdk-dev] [PATCH v2] " Zhao Wei 1 sibling, 1 reply; 8+ messages in thread From: Zhang, Qi Z @ 2018-07-13 3:05 UTC (permalink / raw) To: Zhao1, Wei, dev; +Cc: stable > -----Original Message----- > From: Zhao1, Wei > Sent: Wednesday, July 11, 2018 4:25 PM > To: dev@dpdk.org > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org; Zhao1, Wei > <wei.zhao1@intel.com> > Subject: [PATCH] net/i40e: fix FDIR check programming status error > > In i40e FDIR PMD code for checking programming status function > i40e_check_fdir_programming_status(), the initial value of return value ret > should be set to -1 not 0, because if DD bit of I40E_RX_DESC_STATUS_DD is not > write back, this function will return > 0 to upper function, this give an error info to upper function, the fact for this is > it is time out for DD write back and it should return -1. > > Fixes: 05999aab4ca6 ("i40e: add or delete flow director") > Signed-off-by: Wei Zhao <wei.zhao1@intel.com> > --- > drivers/net/i40e/i40e_fdir.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index > d41601a..b958bf6 100644 > --- a/drivers/net/i40e/i40e_fdir.c > +++ b/drivers/net/i40e/i40e_fdir.c > @@ -1315,7 +1315,7 @@ i40e_check_fdir_programming_status(struct > i40e_rx_queue *rxq) > uint32_t rx_status; > uint32_t len, id; > uint32_t error; > - int ret = 0; > + int ret = -1; > > rxdp = &rxq->rx_ring[rxq->rx_tail]; > qword1 = rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len); > @@ -1360,6 +1360,7 @@ i40e_check_fdir_programming_status(struct > i40e_rx_queue *rxq) > I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1); > else > I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_tail - 1); > + ret = 0; Is it possible to overwrite previous ret = -1 which is not what we want? I would prefer int ret = 0; If (dd bit is set) { If xxx Ret = -1; If xxx Ret = -1; } else { ret = -1; } return ret; > } > > return ret; > -- > 2.7.5 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] net/i40e: fix FDIR check programming status error 2018-07-13 3:05 ` Zhang, Qi Z @ 2018-07-13 3:11 ` Zhao1, Wei 2018-07-13 3:15 ` Zhang, Qi Z 0 siblings, 1 reply; 8+ messages in thread From: Zhao1, Wei @ 2018-07-13 3:11 UTC (permalink / raw) To: Zhang, Qi Z, dev; +Cc: stable This code change is ok also, but it seems need to add more Judging branch? IF you think it is almost the same, I WILL commit a new v2. > -----Original Message----- > From: Zhang, Qi Z > Sent: Friday, July 13, 2018 11:06 AM > To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org > Cc: stable@dpdk.org > Subject: RE: [PATCH] net/i40e: fix FDIR check programming status error > > > > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Wednesday, July 11, 2018 4:25 PM > > To: dev@dpdk.org > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org; Zhao1, Wei > > <wei.zhao1@intel.com> > > Subject: [PATCH] net/i40e: fix FDIR check programming status error > > > > In i40e FDIR PMD code for checking programming status function > > i40e_check_fdir_programming_status(), the initial value of return > > value ret should be set to -1 not 0, because if DD bit of > > I40E_RX_DESC_STATUS_DD is not write back, this function will return > > 0 to upper function, this give an error info to upper function, the > > fact for this is it is time out for DD write back and it should return -1. > > > > Fixes: 05999aab4ca6 ("i40e: add or delete flow director") > > Signed-off-by: Wei Zhao <wei.zhao1@intel.com> > > --- > > drivers/net/i40e/i40e_fdir.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/i40e/i40e_fdir.c > > b/drivers/net/i40e/i40e_fdir.c index > > d41601a..b958bf6 100644 > > --- a/drivers/net/i40e/i40e_fdir.c > > +++ b/drivers/net/i40e/i40e_fdir.c > > @@ -1315,7 +1315,7 @@ i40e_check_fdir_programming_status(struct > > i40e_rx_queue *rxq) > > uint32_t rx_status; > > uint32_t len, id; > > uint32_t error; > > - int ret = 0; > > + int ret = -1; > > > > rxdp = &rxq->rx_ring[rxq->rx_tail]; > > qword1 = rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len); > > @@ -1360,6 +1360,7 @@ i40e_check_fdir_programming_status(struct > > i40e_rx_queue *rxq) > > I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq- > >nb_rx_desc - 1); > > else > > I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_tail - 1); > > + ret = 0; > > Is it possible to overwrite previous ret = -1 which is not what we want? > > I would prefer > > int ret = 0; > > If (dd bit is set) { > If xxx > Ret = -1; > If xxx > Ret = -1; > } else { > ret = -1; > } > > return ret; > > > } > > > > return ret; > > -- > > 2.7.5 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] net/i40e: fix FDIR check programming status error 2018-07-13 3:11 ` Zhao1, Wei @ 2018-07-13 3:15 ` Zhang, Qi Z 2018-07-13 3:21 ` Zhao1, Wei 0 siblings, 1 reply; 8+ messages in thread From: Zhang, Qi Z @ 2018-07-13 3:15 UTC (permalink / raw) To: Zhao1, Wei, dev; +Cc: stable > -----Original Message----- > From: Zhao1, Wei > Sent: Friday, July 13, 2018 11:12 AM > To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org > Cc: stable@dpdk.org > Subject: RE: [PATCH] net/i40e: fix FDIR check programming status error > > This code change is ok also, I don't think so, with your change, it will always return 0 if DD bit is set, but we still need to return -1 if there is any error in descriptor, right? but it seems need to add more Judging branch? > IF you think it is almost the same, I WILL commit a new v2. > > > > -----Original Message----- > > From: Zhang, Qi Z > > Sent: Friday, July 13, 2018 11:06 AM > > To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org > > Cc: stable@dpdk.org > > Subject: RE: [PATCH] net/i40e: fix FDIR check programming status error > > > > > > > > > -----Original Message----- > > > From: Zhao1, Wei > > > Sent: Wednesday, July 11, 2018 4:25 PM > > > To: dev@dpdk.org > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org; Zhao1, Wei > > > <wei.zhao1@intel.com> > > > Subject: [PATCH] net/i40e: fix FDIR check programming status error > > > > > > In i40e FDIR PMD code for checking programming status function > > > i40e_check_fdir_programming_status(), the initial value of return > > > value ret should be set to -1 not 0, because if DD bit of > > > I40E_RX_DESC_STATUS_DD is not write back, this function will return > > > 0 to upper function, this give an error info to upper function, the > > > fact for this is it is time out for DD write back and it should return -1. > > > > > > Fixes: 05999aab4ca6 ("i40e: add or delete flow director") > > > Signed-off-by: Wei Zhao <wei.zhao1@intel.com> > > > --- > > > drivers/net/i40e/i40e_fdir.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/net/i40e/i40e_fdir.c > > > b/drivers/net/i40e/i40e_fdir.c index > > > d41601a..b958bf6 100644 > > > --- a/drivers/net/i40e/i40e_fdir.c > > > +++ b/drivers/net/i40e/i40e_fdir.c > > > @@ -1315,7 +1315,7 @@ i40e_check_fdir_programming_status(struct > > > i40e_rx_queue *rxq) > > > uint32_t rx_status; > > > uint32_t len, id; > > > uint32_t error; > > > - int ret = 0; > > > + int ret = -1; > > > > > > rxdp = &rxq->rx_ring[rxq->rx_tail]; > > > qword1 = rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len); > > > @@ -1360,6 +1360,7 @@ i40e_check_fdir_programming_status(struct > > > i40e_rx_queue *rxq) > > > I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq- nb_rx_desc - 1); > > > else > > > I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_tail - 1); > > > + ret = 0; > > > > Is it possible to overwrite previous ret = -1 which is not what we want? > > > > I would prefer > > > > int ret = 0; > > > > If (dd bit is set) { > > If xxx > > Ret = -1; > > If xxx > > Ret = -1; > > } else { > > ret = -1; > > } > > > > return ret; > > > > > } > > > > > > return ret; > > > -- > > > 2.7.5 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH] net/i40e: fix FDIR check programming status error 2018-07-13 3:15 ` Zhang, Qi Z @ 2018-07-13 3:21 ` Zhao1, Wei 0 siblings, 0 replies; 8+ messages in thread From: Zhao1, Wei @ 2018-07-13 3:21 UTC (permalink / raw) To: Zhang, Qi Z, dev; +Cc: stable > -----Original Message----- > From: Zhang, Qi Z > Sent: Friday, July 13, 2018 11:16 AM > To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org > Cc: stable@dpdk.org > Subject: RE: [PATCH] net/i40e: fix FDIR check programming status error > > > > > -----Original Message----- > > From: Zhao1, Wei > > Sent: Friday, July 13, 2018 11:12 AM > > To: Zhang, Qi Z <qi.z.zhang@intel.com>; dev@dpdk.org > > Cc: stable@dpdk.org > > Subject: RE: [PATCH] net/i40e: fix FDIR check programming status error > > > > This code change is ok also, > > I don't think so, with your change, it will always return 0 if DD bit is set, but > we still need to return -1 if there is any error in descriptor, right? Yes, you are right! I will commit v2!! I find a bug but give out an error fix patch, orz.... > > but it seems need to add more Judging branch? > > IF you think it is almost the same, I WILL commit a new v2. > > > > > > > -----Original Message----- > > > From: Zhang, Qi Z > > > Sent: Friday, July 13, 2018 11:06 AM > > > To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org > > > Cc: stable@dpdk.org > > > Subject: RE: [PATCH] net/i40e: fix FDIR check programming status > > > error > > > > > > > > > > > > > -----Original Message----- > > > > From: Zhao1, Wei > > > > Sent: Wednesday, July 11, 2018 4:25 PM > > > > To: dev@dpdk.org > > > > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org; Zhao1, > > > > Wei <wei.zhao1@intel.com> > > > > Subject: [PATCH] net/i40e: fix FDIR check programming status error > > > > > > > > In i40e FDIR PMD code for checking programming status function > > > > i40e_check_fdir_programming_status(), the initial value of return > > > > value ret should be set to -1 not 0, because if DD bit of > > > > I40E_RX_DESC_STATUS_DD is not write back, this function will > > > > return > > > > 0 to upper function, this give an error info to upper function, > > > > the fact for this is it is time out for DD write back and it should return -1. > > > > > > > > Fixes: 05999aab4ca6 ("i40e: add or delete flow director") > > > > Signed-off-by: Wei Zhao <wei.zhao1@intel.com> > > > > --- > > > > drivers/net/i40e/i40e_fdir.c | 3 ++- > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/net/i40e/i40e_fdir.c > > > > b/drivers/net/i40e/i40e_fdir.c index > > > > d41601a..b958bf6 100644 > > > > --- a/drivers/net/i40e/i40e_fdir.c > > > > +++ b/drivers/net/i40e/i40e_fdir.c > > > > @@ -1315,7 +1315,7 @@ i40e_check_fdir_programming_status(struct > > > > i40e_rx_queue *rxq) > > > > uint32_t rx_status; > > > > uint32_t len, id; > > > > uint32_t error; > > > > - int ret = 0; > > > > + int ret = -1; > > > > > > > > rxdp = &rxq->rx_ring[rxq->rx_tail]; > > > > qword1 = rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len); > > > > @@ -1360,6 +1360,7 @@ i40e_check_fdir_programming_status(struct > > > > i40e_rx_queue *rxq) > > > > I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq- nb_rx_desc > - 1); > > > > else > > > > I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_tail - 1); > > > > + ret = 0; > > > > > > Is it possible to overwrite previous ret = -1 which is not what we want? > > > > > > I would prefer > > > > > > int ret = 0; > > > > > > If (dd bit is set) { > > > If xxx > > > Ret = -1; > > > If xxx > > > Ret = -1; > > > } else { > > > ret = -1; > > > } > > > > > > return ret; > > > > > > > } > > > > > > > > return ret; > > > > -- > > > > 2.7.5 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v2] net/i40e: fix FDIR check programming status error 2018-07-11 8:25 [dpdk-dev] [PATCH] net/i40e: fix FDIR check programming status error Wei Zhao 2018-07-13 3:05 ` Zhang, Qi Z @ 2018-07-13 3:09 ` Zhao Wei 2018-07-13 3:16 ` [dpdk-dev] [PATCH v3] " Zhao Wei 1 sibling, 1 reply; 8+ messages in thread From: Zhao Wei @ 2018-07-13 3:09 UTC (permalink / raw) To: dev; +Cc: qi.z.zhang, stable, Wei Zhao In i40e FDIR PMD code for checking programming status function i40e_check_fdir_programming_status(), the initial value of return value ret should be set to -1 not 0, because if DD bit of I40E_RX_DESC_STATUS_DD is not write back, this function will return 0 to upper function, this give an error info to upper function, the fact for this is it is time out for DD write back and it should return -1. Fixes: 05999aab4ca6 ("i40e: add or delete flow director") Signed-off-by: Wei Zhao <wei.zhao1@intel.com> --- v2: -fix patch error in ret value set. --- drivers/net/i40e/i40e_fdir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index d41601a..a4c8722 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -1360,7 +1360,8 @@ i40e_check_fdir_programming_status(struct i40e_rx_queue *rxq) I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1); else I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_tail - 1); - } + } else + ret = -1; return ret; } -- 2.7.5 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v3] net/i40e: fix FDIR check programming status error 2018-07-13 3:09 ` [dpdk-dev] [PATCH v2] " Zhao Wei @ 2018-07-13 3:16 ` Zhao Wei 2018-07-13 3:51 ` Zhang, Qi Z 0 siblings, 1 reply; 8+ messages in thread From: Zhao Wei @ 2018-07-13 3:16 UTC (permalink / raw) To: dev; +Cc: qi.z.zhang, stable, Wei Zhao In i40e FDIR PMD code for checking programming status function i40e_check_fdir_programming_status(), the initial value of return value ret should be set to -1 not 0, because if DD bit of I40E_RX_DESC_STATUS_DD is not write back, this function will return 0 to upper function, this give an error info to upper function, the fact for this is it is time out for DD write back and it should return -1. Fixes: 05999aab4ca6 ("i40e: add or delete flow director") Signed-off-by: Wei Zhao <wei.zhao1@intel.com> --- v2: -fix patch error in ret value set. v3: -fix patch check warning. --- drivers/net/i40e/i40e_fdir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index d41601a..2b299c7 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -1360,6 +1360,8 @@ i40e_check_fdir_programming_status(struct i40e_rx_queue *rxq) I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1); else I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_tail - 1); + } else { + ret = -1; } return ret; -- 2.7.5 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v3] net/i40e: fix FDIR check programming status error 2018-07-13 3:16 ` [dpdk-dev] [PATCH v3] " Zhao Wei @ 2018-07-13 3:51 ` Zhang, Qi Z 0 siblings, 0 replies; 8+ messages in thread From: Zhang, Qi Z @ 2018-07-13 3:51 UTC (permalink / raw) To: Zhao1, Wei, dev; +Cc: stable > -----Original Message----- > From: Zhao1, Wei > Sent: Friday, July 13, 2018 11:17 AM > To: dev@dpdk.org > Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; stable@dpdk.org; Zhao1, Wei > <wei.zhao1@intel.com> > Subject: [PATCH v3] net/i40e: fix FDIR check programming status error > > In i40e FDIR PMD code for checking programming status function > i40e_check_fdir_programming_status(), the initial value of return value ret > should be set to -1 not 0, because if DD bit of I40E_RX_DESC_STATUS_DD is not > write back, this function will return > 0 to upper function, this give an error info to upper function, the fact for this is > it is time out for DD write back and it should return -1. > > Fixes: 05999aab4ca6 ("i40e: add or delete flow director") > Signed-off-by: Wei Zhao <wei.zhao1@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com> Applied to dpdk-next-net-intel. Thanks! Qi ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-07-13 3:51 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-07-11 8:25 [dpdk-dev] [PATCH] net/i40e: fix FDIR check programming status error Wei Zhao 2018-07-13 3:05 ` Zhang, Qi Z 2018-07-13 3:11 ` Zhao1, Wei 2018-07-13 3:15 ` Zhang, Qi Z 2018-07-13 3:21 ` Zhao1, Wei 2018-07-13 3:09 ` [dpdk-dev] [PATCH v2] " Zhao Wei 2018-07-13 3:16 ` [dpdk-dev] [PATCH v3] " Zhao Wei 2018-07-13 3:51 ` Zhang, Qi Z
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).