aboutgitcodebugslistschat
path: root/udp.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-04-25 10:41:55 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-04-25 10:41:55 +0200
commitb3b3451ae26ad53b80ee73182a333716573397f8 (patch)
tree032bcacd46795ce48932d8583b667d719e4f797f /udp.c
parent38b50dba4704856194ac02b98e492d2349d64058 (diff)
downloadpasst-b3b3451ae26ad53b80ee73182a333716573397f8.tar
passt-b3b3451ae26ad53b80ee73182a333716573397f8.tar.gz
passt-b3b3451ae26ad53b80ee73182a333716573397f8.tar.bz2
passt-b3b3451ae26ad53b80ee73182a333716573397f8.tar.lz
passt-b3b3451ae26ad53b80ee73182a333716573397f8.tar.xz
passt-b3b3451ae26ad53b80ee73182a333716573397f8.tar.zst
passt-b3b3451ae26ad53b80ee73182a333716573397f8.zip
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 <sbrivio@redhat.com>
Diffstat (limited to 'udp.c')
-rw-r--r--udp.c10
1 files 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;
}
}