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>
This commit is contained in:
parent
38b50dba47
commit
b3b3451ae2
1 changed files with 2 additions and 8 deletions
10
udp.c
10
udp.c
|
@ -180,7 +180,7 @@ int udp_tap_handler(struct ctx *c, int af, void *addr,
|
||||||
return count;
|
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)
|
if (count < 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ int udp_tap_handler(struct ctx *c, int af, void *addr,
|
||||||
int udp_sock_init(struct ctx *c)
|
int udp_sock_init(struct ctx *c)
|
||||||
{
|
{
|
||||||
in_port_t port;
|
in_port_t port;
|
||||||
int s, one = 1;
|
int s;
|
||||||
|
|
||||||
c->udp.fd_min = INT_MAX;
|
c->udp.fd_min = INT_MAX;
|
||||||
c->udp.fd_max = 0;
|
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)
|
if ((s = sock_l4_add(c, 4, IPPROTO_UDP, port)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
setsockopt(s, SOL_SOCKET, SO_ZEROCOPY,
|
|
||||||
&one, sizeof(one));
|
|
||||||
|
|
||||||
udp4_sock_port[port] = s;
|
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)
|
if ((s = sock_l4_add(c, 6, IPPROTO_UDP, port)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
setsockopt(s, SOL_SOCKET, SO_ZEROCOPY,
|
|
||||||
&one, sizeof(one));
|
|
||||||
|
|
||||||
udp6_sock_port[port] = s;
|
udp6_sock_port[port] = s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue