DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/pcap: set live interface as non-blocking
@ 2024-08-24 18:07 Stephen Hemminger
  2024-08-26 13:08 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2024-08-24 18:07 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Ofer Dagan

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


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

end of thread, other threads:[~2024-08-26 13:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-24 18:07 [PATCH] net/pcap: set live interface as non-blocking Stephen Hemminger
2024-08-26 13:08 ` Ferruh Yigit

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).