From: Sriram Narasimhan Date: Thu, 23 May 2013 12:36:29 +0000 (+0000) Subject: iptuntap: allow creation of multi-queue tun/tap device X-Git-Tag: v3.10.0~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c41e038f48a3da9d39df00614c2f7c9429cae5b1;p=thirdparty%2Fiproute2.git iptuntap: allow creation of multi-queue tun/tap device This patch adds multi_queue option to ip tuntap. This allows IFF_MULTI_QUEUE flag to be specified during tun/tap device creation enabling multi-queue support in tun/tap device. Example: ip tuntap add dev tap0 mode tap multi_queue Signed-off-by: Sriram Narasimhan --- diff --git a/ip/iptuntap.c b/ip/iptuntap.c index 3d9ad7ded..2391af2bf 100644 --- a/ip/iptuntap.c +++ b/ip/iptuntap.c @@ -38,7 +38,7 @@ static void usage(void) { fprintf(stderr, "Usage: ip tuntap { add | del } [ dev PHYS_DEV ] \n"); fprintf(stderr, " [ mode { tun | tap } ] [ user USER ] [ group GROUP ]\n"); - fprintf(stderr, " [ one_queue ] [ pi ] [ vnet_hdr ]\n"); + fprintf(stderr, " [ one_queue ] [ pi ] [ vnet_hdr ] [ multi_queue ]\n"); fprintf(stderr, "\n"); fprintf(stderr, "Where: USER := { STRING | NUMBER }\n"); fprintf(stderr, " GROUP := { STRING | NUMBER }\n"); @@ -168,6 +168,8 @@ static int parse_args(int argc, char **argv, struct ifreq *ifr, uid_t *uid, gid_ ifr->ifr_flags |= IFF_ONE_QUEUE; } else if (matches(*argv, "vnet_hdr") == 0) { ifr->ifr_flags |= IFF_VNET_HDR; + } else if (matches(*argv, "multi_queue") == 0) { + ifr->ifr_flags |= IFF_MULTI_QUEUE; } else if (matches(*argv, "dev") == 0) { NEXT_ARG(); strncpy(ifr->ifr_name, *argv, IFNAMSIZ-1);