From b3b3451ae26ad53b80ee73182a333716573397f8 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sun, 25 Apr 2021 10:41:55 +0200 Subject: udp: Disable SO_ZEROCOPY again ...on a second thought, this won't really help with veth, and actually causes a significant overhead as we get EPOLLERR whenever another process is tapping on the traffic. Signed-off-by: Stefano Brivio --- udp.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/udp.c b/udp.c index edb73de..255787a 100644 --- a/udp.c +++ b/udp.c @@ -180,7 +180,7 @@ int udp_tap_handler(struct ctx *c, int af, void *addr, return count; } - count = sendmmsg(s, mm, count, MSG_DONTWAIT | MSG_NOSIGNAL | MSG_ZEROCOPY); + count = sendmmsg(s, mm, count, MSG_DONTWAIT | MSG_NOSIGNAL); if (count < 0) return 1; @@ -196,7 +196,7 @@ int udp_tap_handler(struct ctx *c, int af, void *addr, int udp_sock_init(struct ctx *c) { in_port_t port; - int s, one = 1; + int s; c->udp.fd_min = INT_MAX; c->udp.fd_max = 0; @@ -206,9 +206,6 @@ int udp_sock_init(struct ctx *c) if ((s = sock_l4_add(c, 4, IPPROTO_UDP, port)) < 0) return -1; - setsockopt(s, SOL_SOCKET, SO_ZEROCOPY, - &one, sizeof(one)); - udp4_sock_port[port] = s; } @@ -216,9 +213,6 @@ int udp_sock_init(struct ctx *c) if ((s = sock_l4_add(c, 6, IPPROTO_UDP, port)) < 0) return -1; - setsockopt(s, SOL_SOCKET, SO_ZEROCOPY, - &one, sizeof(one)); - udp6_sock_port[port] = s; } } -- cgit v1.2.3