From 3c116ca105c63765d5abd8bd5440bd3a161ab798 Mon Sep 17 00:00:00 2001 From: fukaige Date: Wed, 20 Feb 2019 19:40:43 +0800 Subject: [PATCH] tun: Increase tap device default txqueuelen to 5000 hulk inclusion category: bugfix bugzilla: 8110 CVE: NA ------------------------------------------------- The original read queue size for Tap dev is only 500, this will cause to drop some packets when send huge number packets: tap3: flags=4163 mtu 1500 inet6 fe80::fc16:3eff:fe06:be1c prefixlen 64 scopeid 0x20 ether fe:16:3e:06:be:1c txqueuelen 500 (Ethernet) RX packets 37 bytes 4004 (3.9 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 5100871 bytes 7712457890 (7.1 GiB) TX errors 0 dropped 1213 overruns 0 carrier 0 collisions 0 It shows that the tap3's packets loss rate reach 0.2%(1213/5100871), when we make the read queue size more bigger, it will not drop any packets, it means that the small read queue size is not suitable for high-speed network, so increase the number to 5000, and it will also useful for macvlan dev. Signed-off-by: fukaige Reviewed-by: Zhaoshenglong Signed-off-by: Ding Tianhong [Ding: modify the commit message] Signed-off-by: Hanjun Guo Signed-off-by: Wei Li Reviewed-by: Hanjun Guo Signed-off-by: Yang Yingliang --- include/uapi/linux/if_tun.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h index ee432cd3018c..43a1de86f17e 100644 --- a/include/uapi/linux/if_tun.h +++ b/include/uapi/linux/if_tun.h @@ -22,7 +22,7 @@ #include /* Read queue size */ -#define TUN_READQ_SIZE 500 +#define TUN_READQ_SIZE 5000 /* TUN device type flags: deprecated. Use IFF_TUN/IFF_TAP instead. */ #define TUN_TUN_DEV IFF_TUN #define TUN_TAP_DEV IFF_TAP -- GitLab