[v2,2/5] net/nfb: do not report zero-sized TX burst

Message ID 20220215125543.142108-3-spinler@cesnet.cz (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/nfb: add missing libfdt dependency for build |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Martin Spinler Feb. 15, 2022, 12:55 p.m. UTC
  From: Martin Spinler <spinler@cesnet.cz>

Zero-sized TX burst floods the log no more.

Signed-off-by: Martin Spinler <spinler@cesnet.cz>
---
 drivers/net/nfb/nfb_tx.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/nfb/nfb_tx.h b/drivers/net/nfb/nfb_tx.h
index d3cbe3e6b3..910020e9e9 100644
--- a/drivers/net/nfb/nfb_tx.h
+++ b/drivers/net/nfb/nfb_tx.h
@@ -136,7 +136,10 @@  nfb_eth_ndp_tx(void *queue,
 
 	struct ndp_packet packets[nb_pkts];
 
-	if (unlikely(ndp->queue == NULL || nb_pkts == 0)) {
+	if (unlikely(nb_pkts == 0))
+		return 0;
+
+	if (unlikely(ndp->queue == NULL)) {
 		RTE_LOG(ERR, PMD, "TX invalid arguments!\n");
 		return 0;
 	}