[v3] net/i40e: fix FDIR check programming status error

Message ID 1531451793-37321-1-git-send-email-wei.zhao1@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v3] net/i40e: fix FDIR check programming status error |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Zhao1, Wei July 13, 2018, 3:16 a.m. UTC
  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(+)
  

Comments

Qi Zhang July 13, 2018, 3:51 a.m. UTC | #1
> -----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
  

Patch

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;