From 4b88be0201a947491130f174552a86a50c233dc2 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 3 Oct 2018 12:16:44 +0200 Subject: ipcpd: Bypass Qdisc in Ethernet IPCP Since Linux kernel 3.14 there is the option to bypass the kernel Qdisc. This will speed up the Ethernet IPCP. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- src/ipcpd/eth/eth.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ipcpd/eth') diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c index 8175d803..05dd9ac7 100644 --- a/src/ipcpd/eth/eth.c +++ b/src/ipcpd/eth/eth.c @@ -1199,6 +1199,9 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf) #endif #ifndef SHM_RDRB_MULTI_BLOCK size_t maxsz; +#endif +#if defined(HAVE_RAW_SOCKETS) + int qdisc_bypass = 1; #endif assert(conf); assert(conf->type == THIS_TYPE); @@ -1365,6 +1368,11 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf) return -1; } + if (setsockopt(eth_data.s_fd, SOL_PACKET, PACKET_QDISC_BYPASS, + &qdisc_bypass, sizeof(qdisc_bypass))) { + log_info("Qdisc bypass not supported."); + } + if (bind(eth_data.s_fd, (struct sockaddr *) ð_data.device, sizeof(eth_data.device))) { log_err("Failed to bind socket to interface"); -- cgit v1.2.3