From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH] test/pmd_af_packet: cleanups
Date: Mon, 22 Jun 2026 16:21:00 -0700 [thread overview]
Message-ID: <20260622232100.63865-1-stephen@networkplumber.org> (raw)
Fix two coverity bugs where fcntl() return value not checked.
Also mark some other cases as FAILED instead of skipped.
Such as failure to transmit or failure to allocate mbuf's.
Coverity ID: 503765
Coverity ID: 503766
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/test_pmd_af_packet.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/app/test/test_pmd_af_packet.c b/app/test/test_pmd_af_packet.c
index b668ca5b81..9fe595d606 100644
--- a/app/test/test_pmd_af_packet.c
+++ b/app/test/test_pmd_af_packet.c
@@ -556,19 +556,22 @@ test_af_packet_loopback(void)
/* Set TAP fd to non-blocking for reading */
int flags = fcntl(tap_fd, F_GETFL, 0);
- fcntl(tap_fd, F_SETFL, flags | O_NONBLOCK);
+ if (flags < 0 || fcntl(tap_fd, F_SETFL, flags | O_NONBLOCK) < 0) {
+ printf("fcntl failed: %s\n", strerror(errno));
+ return TEST_FAILED;
+ }
/* Allocate and send packets */
allocated = alloc_tx_mbufs(tx_bufs, BURST_SIZE);
if (allocated == 0) {
- printf("SKIPPED: Could not allocate mbufs\n");
- return TEST_SKIPPED;
+ printf("Could not allocate mbufs\n");
+ return TEST_FAILED;
}
nb_tx = do_tx_burst(port_id, 0, tx_bufs, allocated);
if (nb_tx == 0) {
- printf("SKIPPED: No packets transmitted\n");
- return TEST_SKIPPED;
+ printf("No packets transmitted\n");
+ return TEST_FAILED;
}
/*
--
2.53.0
reply other threads:[~2026-06-22 23:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260622232100.63865-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox