DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/iavf: fix unchecked return value
@ 2020-10-14  8:28 Leyi Rong
  2020-10-14 11:51 ` Zhang, Qi Z
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Leyi Rong @ 2020-10-14  8:28 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev, Leyi Rong

Fixes coverity unchecked return value issue.

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

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 7e6e425ac..ca0f5d072 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -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;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/iavf: fix unchecked return value
  2020-10-14  8:28 [dpdk-dev] [PATCH] net/iavf: fix unchecked return value Leyi Rong
@ 2020-10-14 11:51 ` Zhang, Qi Z
  2020-10-14 12:41 ` Ferruh Yigit
  2020-10-19  5:42 ` [dpdk-dev] [PATCH v2] net/iavf: fix unchecked Tx cleanup error Leyi Rong
  2 siblings, 0 replies; 5+ messages in thread
From: Zhang, Qi Z @ 2020-10-14 11:51 UTC (permalink / raw)
  To: Rong, Leyi; +Cc: dev



> -----Original Message-----
> From: Rong, Leyi <leyi.rong@intel.com>
> Sent: Wednesday, October 14, 2020 4:29 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Rong, Leyi <leyi.rong@intel.com>
> Subject: [PATCH] net/iavf: fix unchecked return value
> 
> Fixes coverity unchecked return value issue.
> 
> Coverity issue: 363045
> Fixes: 02d212ca3125 ("net/iavf: rename remaining avf strings")
> 
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/iavf: fix unchecked return value
  2020-10-14  8:28 [dpdk-dev] [PATCH] net/iavf: fix unchecked return value Leyi Rong
  2020-10-14 11:51 ` Zhang, Qi Z
@ 2020-10-14 12:41 ` Ferruh Yigit
  2020-10-19  5:42 ` [dpdk-dev] [PATCH v2] net/iavf: fix unchecked Tx cleanup error Leyi Rong
  2 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2020-10-14 12:41 UTC (permalink / raw)
  To: Leyi Rong, qi.z.zhang; +Cc: dev

On 10/14/2020 9:28 AM, Leyi Rong wrote:
> 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.

> Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> ---
>   drivers/net/iavf/iavf_rxtx.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
> index 7e6e425ac..ca0f5d072 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -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;
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v2] net/iavf: fix unchecked Tx cleanup error
  2020-10-14  8:28 [dpdk-dev] [PATCH] net/iavf: fix unchecked return value Leyi Rong
  2020-10-14 11:51 ` Zhang, Qi Z
  2020-10-14 12:41 ` Ferruh Yigit
@ 2020-10-19  5:42 ` Leyi Rong
  2020-10-20 10:27   ` Zhang, Qi Z
  2 siblings, 1 reply; 5+ messages in thread
From: Leyi Rong @ 2020-10-19  5:42 UTC (permalink / raw)
  To: qi.z.zhang, ferruh.yigit; +Cc: dev, Leyi Rong, stable

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")
Cc: stable@dpdk.org

Signed-off-by: Leyi Rong <leyi.rong@intel.com>

---
v2:
- More detailed commit log.
---
 drivers/net/iavf/iavf_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 1b0efe043..591795f3b 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -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;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/iavf: fix unchecked Tx cleanup error
  2020-10-19  5:42 ` [dpdk-dev] [PATCH v2] net/iavf: fix unchecked Tx cleanup error Leyi Rong
@ 2020-10-20 10:27   ` Zhang, Qi Z
  0 siblings, 0 replies; 5+ messages in thread
From: Zhang, Qi Z @ 2020-10-20 10:27 UTC (permalink / raw)
  To: Rong, Leyi, Yigit, Ferruh; +Cc: dev, stable



> -----Original Message-----
> From: Rong, Leyi <leyi.rong@intel.com>
> Sent: Monday, October 19, 2020 1:43 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Cc: dev@dpdk.org; Rong, Leyi <leyi.rong@intel.com>; stable@dpdk.org
> 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.
> 
> Coverity issue: 363045
> Fixes: 02d212ca3125 ("net/iavf: rename remaining avf strings")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-20 10:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14  8:28 [dpdk-dev] [PATCH] net/iavf: fix unchecked return value Leyi Rong
2020-10-14 11:51 ` Zhang, Qi Z
2020-10-14 12:41 ` Ferruh Yigit
2020-10-19  5:42 ` [dpdk-dev] [PATCH v2] net/iavf: fix unchecked Tx cleanup error Leyi Rong
2020-10-20 10:27   ` 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).