From 9c10cd5c8db84e9b3fa6ca559cd2bce7a4235809 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 10 May 2026 17:45:56 +0200 Subject: ipcpd-eth: Tune raw sockets and retry queries Add IPCP_ETH_SNDBUF/RCVBUF cmake build options so deployments can size the AF_PACKET socket buffers without patching code. Drop the O_NONBLOCK fcntl on the raw socket in favour of per-recvfrom MSG_DONTWAIT so race-loser reader threads exit with EAGAIN without spamming the log. Track frame send failures and the SO_SNDBUF size in the eth/summary RIB; log a one-shot warning when the kernel reports AF_PACKET drops. Retry name queries up to NAME_QUERY_RETRIES times within NAME_QUERY_TIMEO; a single lost ARP-style mgmt frame no longer fails the query. Bump IRMd QUERY_TIMEOUT from 200 ms to 2200 ms so the IRMd budget exceeds the new shim retry window. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- cmake/config/ipcp/eth.cmake | 4 ++++ cmake/config/irmd.cmake | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'cmake/config') diff --git a/cmake/config/ipcp/eth.cmake b/cmake/config/ipcp/eth.cmake index 4b9007d2..d336d647 100644 --- a/cmake/config/ipcp/eth.cmake +++ b/cmake/config/ipcp/eth.cmake @@ -10,6 +10,10 @@ set(IPCP_ETH_WR_THR 1 CACHE STRING "Number of writer threads in Ethernet IPCP") set(IPCP_ETH_QDISC_BYPASS false CACHE BOOL "Bypass the Qdisc in the kernel when using raw sockets") +set(IPCP_ETH_SNDBUF 0 CACHE STRING + "Raw socket SO_SNDBUF in bytes; 0 = leave kernel default (wmem_default)") +set(IPCP_ETH_RCVBUF 0 CACHE STRING + "Raw socket SO_RCVBUF in bytes; 0 = leave kernel default (rmem_default)") set(IPCP_ETH_LO_MTU 9000 CACHE STRING "Restrict Ethernet MTU over loopback interfaces") set(IPCP_ETH_MGMT_FRAME_SIZE 9000 CACHE STRING diff --git a/cmake/config/irmd.cmake b/cmake/config/irmd.cmake index b86a40c5..45d9e73d 100644 --- a/cmake/config/irmd.cmake +++ b/cmake/config/irmd.cmake @@ -10,8 +10,8 @@ set(ENROLL_TIMEOUT 20000 CACHE STRING "Timeout for an IPCP to enroll (ms)") set(REG_TIMEOUT 20000 CACHE STRING "Timeout for registering a name (ms)") -set(QUERY_TIMEOUT 200 CACHE STRING - "Timeout to query a name with an IPCP (ms)") +set(QUERY_TIMEOUT 2000 CACHE STRING + "Timeout to query a name with an IPCP (ms); must exceed shim retry budget") set(CONNECT_TIMEOUT 20000 CACHE STRING "Timeout to connect an IPCP to another IPCP (ms)") set(FLOW_ALLOC_TIMEOUT 20000 CACHE STRING -- cgit v1.2.3