Skip to contentSkip to conversation

iptuntap: fix multi-queue flag display

PATCH In review David Marchand 2 participants 2 messages Sep 1, 2021 – Sep 14, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iptuntap: fix multi-queue flag display

When creating a tap with multi_queue flag, this flag is not displayed when dumping:

$ ip tuntap add tap23 mode tap multi_queue
$ ip tuntap
tap23: tap persist0x100

While at it, add a space between known flags and hexdump of unknown ones.

Fixes c41e038f48a3 ("iptuntap: allow creation of multi-queue tun/tap device")
---
 ip/iptuntap.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
ip/iptuntap.c +6 -2
index 9cdb4a80..96ca1ae7 100644
@@ -243,6 +243,9 @@ static void print_flags(long flags)
 	if (flags & IFF_ONE_QUEUE)
 		print_string(PRINT_ANY, NULL, " %s", "one_queue");
 
+	if (flags & IFF_MULTI_QUEUE)
+		print_string(PRINT_ANY, NULL, " %s", "multi_queue");
+
 	if (flags & IFF_VNET_HDR)
 		print_string(PRINT_ANY, NULL, " %s", "vnet_hdr");
 
@@ -253,9 +256,10 @@ static void print_flags(long flags)
 		print_string(PRINT_ANY, NULL, " %s", "filter");
 
 	flags &= ~(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE |
-		   IFF_VNET_HDR | IFF_PERSIST | IFF_NOFILTER);
+		   IFF_MULTI_QUEUE | IFF_VNET_HDR | IFF_PERSIST |
+		   IFF_NOFILTER);
 	if (flags)
-		print_0xhex(PRINT_ANY, NULL, "%#llx", flags);
+		print_0xhex(PRINT_ANY, NULL, " %#llx", flags);
 
 	close_json_array(PRINT_JSON, NULL);
 }
Signature · 1 line
2.23.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 34 lines · David Marchand

When creating a tap with multi_queue flag, this flag is not displayed when dumping:

$ ip tuntap add tap23 mode tap multi_queue
$ ip tuntap
tap23: tap persist0x100

While at it, add a space between known flags and hexdump of unknown ones.

Fixes c41e038f48a3 ("iptuntap: allow creation of multi-queue tun/tap device")
---
 ip/iptuntap.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
ip/iptuntap.c +3 -0
index 9cdb4a80..96ca1ae7 100644
@@ -243,6 +243,9 @@ static void print_flags(long flags)
 	if (flags & IFF_ONE_QUEUE)
 		print_string(PRINT_ANY, NULL, " %s", "one_queue");
 
+	if (flags & IFF_MULTI_QUEUE)
+		print_string(PRINT_ANY, NULL, " %s", "multi_queue");
+
 	if (flags & IFF_VNET_HDR)
 		print_string(PRINT_ANY, NULL, " %s", "vnet_hdr");
 
@@ -253,9 +256,10 @@ static void print_flags(long flags)
 		print_string(PRINT_ANY, NULL, " %s", "filter");
 

ip/iptuntap.c static void print_flags(long flags) · line 265

Quoted 10 lines
ip/iptuntap.c +3 -2
 	flags &= ~(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE |
-		   IFF_VNET_HDR | IFF_PERSIST | IFF_NOFILTER);
+		   IFF_MULTI_QUEUE | IFF_VNET_HDR | IFF_PERSIST |
+		   IFF_NOFILTER);
 	if (flags)
-		print_0xhex(PRINT_ANY, NULL, "%#llx", flags);
+		print_0xhex(PRINT_ANY, NULL, " %#llx", flags);
 
 	close_json_array(PRINT_JSON, NULL);
 }

Thanks,
Maxime