Skip to contentSkip to conversation

net/pcap: set live interface as non-blocking

PATCH Applied Stephen Hemminger 2 participants 2 messages Aug 24, 2024 – Aug 26, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/pcap: set live interface as non-blocking

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

---
 drivers/net/pcap/pcap_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/pcap/pcap_ethdev.c +6 -0
index bfec085045..c4e6c93d4a 100644
@@ -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;
 }
 
Signature · 1 line
2.43.0
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 7 lines · Stephen Hemminger

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

    Bugzilla ID: 1526
    Fixes: 4c173302c307 ("pcap: add new driver")
    Cc: [email protected]

Applied to dpdk-next-net/main, thanks.