Re: [PATCH 1/1] tun: change speed from 10M to dynamically configured
flat view
From: Sergei Shtylyov <hidden>
Date: 2015-02-13 10:45:12
On 2/13/2015 9:19 AM, Zhu Yanjun wrote:
The default speed of normal nic is 1000M while the default speed of tun is 10M. Now the default speed of tun is changed to 1000M. And there are 3 options: 10M, 100M and 1000M to the speed of tun. The command "ethtool -s tun0 speed 10/100/1000" can configure the speed of tun dynamically.
CC: Michael S. Tsirkin <mst@redhat.com> CC: Jason Wang <redacted> CC: Al Viro <viro@zeniv.linux.org.uk> Reviewed-by: Sergei Shtylyov <redacted> Reviewed-by: Jonathon Reinhart <redacted> Signed-off-by: Zhu Yanjun <redacted>
[...]
quoted hunk ↗ jump to hunk
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h index 50ae243..78a09a7 100644 --- a/include/uapi/linux/if_tun.h +++ b/include/uapi/linux/if_tun.h@@ -66,6 +66,11 @@ #define IFF_PERSIST 0x0800 #define IFF_NOFILTER 0x1000 +/*add speed control, default 1000M*/
Please do add spaces after /* and before */.
quoted hunk ↗ jump to hunk
+#define TUN_CTRL_SPD_10 0x0020 +#define TUN_CTRL_SPD_100 0x0040 +#define TUN_CTRL_SPD_1000 0x0080 + /* Socket options */ #define TUN_TX_TIMESTAMP 1
WBR, Sergei