Skip to contentSkip to conversation

net/iavf: fix unchecked return value

PATCH Applied Leyi Rong 3 participants 5 messages Oct 14, 2020 – Oct 20, 2020 Network drivers

lore
Share & tools
lore

Leyi Rong

author
#0 lore raw

PATCH 1/1 net/iavf: fix unchecked return value

Fixes coverity unchecked return value issue.

Coverity issue: 363045

Fixes 02d212ca3125 ("net/iavf: rename remaining avf strings")
---
 drivers/net/iavf/iavf_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/iavf/iavf_rxtx.c +1 -1
index 7e6e425ac..ca0f5d072 100644
@@ -2077,7 +2077,7 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 	/* Check if the descriptor ring needs to be cleaned. */
 	if (txq->nb_free < txq->free_thresh)
-		iavf_xmit_cleanup(txq);
+		(void)iavf_xmit_cleanup(txq);
 
 	for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
 		td_cmd = 0;
Signature · 1 line
2.17.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Rong, Leyi <[email protected]>
Sent: Wednesday, October 14, 2020 4:29 PM
To: Zhang, Qi Z <[email protected]>
Cc: [email protected]; Rong, Leyi <[email protected]>
Subject: [PATCH] net/iavf: fix unchecked return value

Quoted 6 lines

Fixes coverity unchecked return value issue.

Coverity issue: 363045

Fixes 02d212ca3125 ("net/iavf: rename remaining avf strings")

Applied to dpdk-next-net-intel.

Thanks
Qi

#2 lore raw
In reply to Leyi Rong
Quoted 5 lines · Leyi Rong

Fixes coverity unchecked return value issue.

Coverity issue: 363045

Fixes 02d212ca3125 ("net/iavf: rename remaining avf strings")

Hi Leyi,

Can you please put some justification to the commit log, why return value can be ignored instead of handling it?

Technically this patch doesn't put you in a better place, still you are not checking the return value, indeed it is worse since it is silenced and even coverity can't warn you anymore.

Quoted 19 lines
---
  drivers/net/iavf/iavf_rxtx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/iavf/iavf_rxtx.c +1 -1
index 7e6e425ac..ca0f5d072 100644
@@ -2077,7 +2077,7 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
  	/* Check if the descriptor ring needs to be cleaned. */
  	if (txq->nb_free < txq->free_thresh)
-		iavf_xmit_cleanup(txq);
+		(void)iavf_xmit_cleanup(txq);
 
  	for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
  		td_cmd = 0;
author
#3 lore raw

PATCH v2 1/1 net/iavf: fix unchecked Tx cleanup error

In reply to Leyi Rong

Coverity complains of unchecked return value warning of iavf_xmit_cleanup, while this cleanup is opportunistic and will not cause problems if it fails. So instead of checking the return value of iavf_xmit_cleanup and return in case of cleanup failure, we directly cast it to void function to make the Coverity happy.

Coverity issue: 363045

Fixes 02d212ca3125 ("net/iavf: rename remaining avf strings")

---
v2:
- More detailed commit log.

---
 drivers/net/iavf/iavf_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/iavf/iavf_rxtx.c +1 -1
index 1b0efe043..591795f3b 100644
@@ -1890,7 +1890,7 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 	/* Check if the descriptor ring needs to be cleaned. */
 	if (txq->nb_free < txq->free_thresh)
-		iavf_xmit_cleanup(txq);
+		(void)iavf_xmit_cleanup(txq);
 
 	for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
 		td_cmd = 0;
Signature · 1 line
2.17.1
Acked-by on v2 1/1 Applied
#4 lore raw

Re: [dpdk-dev] [PATCH v2] net/iavf: fix unchecked Tx cleanup error

Quoted 14 lines

-----Original Message-----
From: Rong, Leyi <[email protected]>
Sent: Monday, October 19, 2020 1:43 PM
To: Zhang, Qi Z <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: [email protected]; Rong, Leyi <[email protected]>; [email protected]
Subject: [PATCH v2] net/iavf: fix unchecked Tx cleanup error

Coverity complains of unchecked return value warning of iavf_xmit_cleanup, while this cleanup is opportunistic and will not cause problems if it fails. So instead of checking the return value of iavf_xmit_cleanup and return in case of cleanup failure, we directly cast it to void function to make the Coverity happy.

Quoted 5 lines

Coverity issue: 363045

Fixes 02d212ca3125 ("net/iavf: rename remaining avf strings")

Applied to dpdk-next-net-intel.

Thanks
Qi