From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Ofer Dagan <ofer.d@claroty.com>
Subject: [PATCH] net/pcap: set live interface as non-blocking
Date: Sat, 24 Aug 2024 11:07:10 -0700 [thread overview]
Message-ID: <20240824180717.14293-1-stephen@networkplumber.org> (raw)
The DPDK PMD's are supposed to be non-blocking and poll for packets.
Configure PCAP to do this on live interface.
Bugzilla ID: 1526
Reported-by: Ofer Dagan <ofer.d@claroty.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/pcap/pcap_ethdev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/pcap/pcap_ethdev.c b/drivers/net/pcap/pcap_ethdev.c
index bfec085045..c4e6c93d4a 100644
--- a/drivers/net/pcap/pcap_ethdev.c
+++ b/drivers/net/pcap/pcap_ethdev.c
@@ -522,6 +522,12 @@ open_iface_live(const char *iface, pcap_t **pcap) {
return -1;
}
+ if (pcap_setnonblock(*pcap, 1, errbuf)) {
+ PMD_LOG(ERR, "Couldn't set non-blocking on %s: %s", iface, errbuf);
+ pcap_close(*pcap);
+ return -1;
+ }
+
return 0;
}
--
2.43.0
next reply other threads:[~2024-08-24 18:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-24 18:07 Stephen Hemminger [this message]
2024-08-26 13:08 ` Ferruh Yigit
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=20240824180717.14293-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=ofer.d@claroty.com \
/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;
as well as URLs for NNTP newsgroup(s).