Skip to contentSkip to conversation

examples/vmdq: fix the output of pools/queues

PATCH Superseded Junyu Jiang 5 participants 8 messages Feb 26, 2020 – Mar 31, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/vmdq: fix the output of pools/queues

To match the pools/queues configuration, the pools/queues output should start from VMDQ base queue. This patch fixed the issue.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 examples/vmdq/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
examples/vmdq/main.c +5 -4
index 011110920..592f9bc62 100644
@@ -441,10 +441,11 @@ update_mac_address(struct rte_mbuf *m, unsigned dst_port)
 static void
 sighup_handler(int signum)
 {
-	unsigned q;
-	for (q = 0; q < num_queues; q++) {
-		if (q % (num_queues/num_pools) == 0)
-			printf("\nPool %u: ", q/(num_queues/num_pools));
+	unsigned q = vmdq_queue_base;;
+	for (; q < num_queues; q++) {
+		if (q % (num_vmdq_queues / num_pools) == 0)
+			printf("\nPool %u: ", (q - vmdq_queue_base) /
+			       (num_vmdq_queues / num_pools));
 		printf("%lu ", rxPackets[q]);
 	}
 	printf("\nFinished handling signal %d\n", signum);
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 examples/vmdq: fix the output of pools/queues

To match the pools/queues configuration, the pools/queues output should start from VMDQ base queue. This patch fixed the issue.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 examples/vmdq/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
examples/vmdq/main.c +5 -4
index 011110920..dcba3a708 100644
@@ -441,10 +441,11 @@ update_mac_address(struct rte_mbuf *m, unsigned dst_port)
 static void
 sighup_handler(int signum)
 {
-	unsigned q;
-	for (q = 0; q < num_queues; q++) {
-		if (q % (num_queues/num_pools) == 0)
-			printf("\nPool %u: ", q/(num_queues/num_pools));
+	unsigned int q = vmdq_queue_base;
+	for (; q < num_queues; q++) {
+		if (q % (num_vmdq_queues / num_pools) == 0)
+			printf("\nPool %u: ", (q - vmdq_queue_base) /
+			       (num_vmdq_queues / num_pools));
 		printf("%lu ", rxPackets[q]);
 	}
 	printf("\nFinished handling signal %d\n", signum);
Signature · 1 line
2.17.1
#2 lore raw
Quoted 27 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Junyu Jiang
Sent: Wednesday, February 26, 2020 16:35
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2] examples/vmdq: fix the output of pools/queues

To match the pools/queues configuration, the pools/queues output should start from VMDQ base queue. This patch fixed the issue.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 examples/vmdq/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
examples/vmdq/main.c index renamed from examples/vmdq/main.c +0 -0

011110920..dcba3a708 100644

examples/vmdq/main.c update_mac_address(struct rte_mbuf *m, · line 444

Quoted 8 lines
examples/vmdq/main.c +3 -4
@@ -441,10 +441,11 @@ update_mac_address(struct rte_mbuf *m,
 unsigned dst_port)  static void  sighup_handler(int signum)  {
-	unsigned q;
-	for (q = 0; q < num_queues; q++) {
-		if (q % (num_queues/num_pools) == 0)
-			printf("\nPool %u: ", q/(num_queues/num_pools));
+	unsigned int q = vmdq_queue_base;
+	for (; q < num_queues; q++) {
+		if (q % (num_vmdq_queues / num_pools) == 0)

What's the different between num_vmdq_queues and num_queues?

Quoted 7 lines
examples/vmdq/main.c +2 -1
+			printf("\nPool %u: ", (q - vmdq_queue_base) /
+			       (num_vmdq_queues / num_pools));
 		printf("%lu ", rxPackets[q]);
 	}
 	printf("\nFinished handling signal %d\n", signum);
--

2.17.1

#3 lore raw
In reply to Junyu Jiang

Hi

Quoted 24 lines

-----Original Message-----
From: Jiang, JunyuX
Sent: Wednesday, February 26, 2020 16:35
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [PATCH v2] examples/vmdq: fix the output of pools/queues

To match the pools/queues configuration, the pools/queues output should start from VMDQ base queue. This patch fixed the issue.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 examples/vmdq/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
examples/vmdq/main.c index renamed from examples/vmdq/main.c +0 -0

011110920..dcba3a708 100644

examples/vmdq/main.c update_mac_address(struct rte_mbuf *m, unsigned · line 444

Quoted 8 lines
examples/vmdq/main.c +3 -4
@@ -441,10 +441,11 @@ update_mac_address(struct rte_mbuf *m, unsigned
 dst_port)  static void  sighup_handler(int signum)  {
-	unsigned q;
-	for (q = 0; q < num_queues; q++) {
-		if (q % (num_queues/num_pools) == 0)
-			printf("\nPool %u: ", q/(num_queues/num_pools));
+	unsigned int q = vmdq_queue_base;
+	for (; q < num_queues; q++) {
+		if (q % (num_vmdq_queues / num_pools) == 0)

In your logic, this should be if ((q - vmdq_queue_base) % (num_vmdq_queues / num_pools) == 0)

Quoted 7 lines
examples/vmdq/main.c +2 -1
+			printf("\nPool %u: ", (q - vmdq_queue_base) /
+			       (num_vmdq_queues / num_pools));
 		printf("%lu ", rxPackets[q]);
 	}
 	printf("\nFinished handling signal %d\n", signum);
--

2.17.1

#4 lore raw

PATCH v3 1/1 examples/vmdq: fix the output of pools/queues

In reply to Junyu Jiang

To match the pools/queues configuration, the pools/queues output should start from VMDQ base queue. This patch fixed the issue.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 examples/vmdq/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
examples/vmdq/main.c +5 -4
index 011110920..5ab3427c0 100644
@@ -441,10 +441,11 @@ update_mac_address(struct rte_mbuf *m, unsigned dst_port)
 static void
 sighup_handler(int signum)
 {
-	unsigned q;
-	for (q = 0; q < num_queues; q++) {
-		if (q % (num_queues/num_pools) == 0)
-			printf("\nPool %u: ", q/(num_queues/num_pools));
+	unsigned int q = vmdq_queue_base;
+	for (; q < num_queues; q++) {
+		if ((q - vmdq_queue_base) % (num_vmdq_queues / num_pools) == 0)
+			printf("\nPool %u: ", (q - vmdq_queue_base) /
+			       (num_vmdq_queues / num_pools));
 		printf("%lu ", rxPackets[q]);
 	}
 	printf("\nFinished handling signal %d\n", signum);
Signature · 1 line
2.17.1
Acked-by on v3 1/1
#5 lore raw

Hi

Quoted 39 lines

-----Original Message-----
From: Jiang, JunyuX
Sent: Monday, March 2, 2020 14:41
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>; Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [PATCH v3] examples/vmdq: fix the output of pools/queues

To match the pools/queues configuration, the pools/queues output should start from VMDQ base queue. This patch fixed the issue.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 examples/vmdq/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
examples/vmdq/main.c index renamed from examples/vmdq/main.c +0 -0

011110920..5ab3427c0 100644

examples/vmdq/main.c +5 -5
@@ -441,10 +441,11 @@ update_mac_address(struct rte_mbuf *m, unsigned
 dst_port)  static void  sighup_handler(int signum)  {
-	unsigned q;
-	for (q = 0; q < num_queues; q++) {
-		if (q % (num_queues/num_pools) == 0)
-			printf("\nPool %u: ", q/(num_queues/num_pools));
+	unsigned int q = vmdq_queue_base;
+	for (; q < num_queues; q++) {
+		if ((q - vmdq_queue_base) % (num_vmdq_queues / num_pools)
 == 0)
+			printf("\nPool %u: ", (q - vmdq_queue_base) /
+			       (num_vmdq_queues / num_pools));
 		printf("%lu ", rxPackets[q]);
 	}
 	printf("\nFinished handling signal %d\n", signum);
--
Quoted 1 line

2.17.1

Tested-by Acked-by Xiaoyun Li
#6 lore raw

BRs,
Yingya
-----Original Message-----
From: stable <[email protected]> On Behalf Of Li, Xiaoyun
Sent: Monday, March 2, 2020 3:19 PM
To: Jiang, JunyuX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; [email protected]
Subject: Re: [dpdk-stable] [PATCH v3] examples/vmdq: fix the output of pools/queues

Hi

Quoted 40 lines

-----Original Message-----
From: Jiang, JunyuX
Sent: Monday, March 2, 2020 14:41
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>; Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [PATCH v3] examples/vmdq: fix the output of pools/queues

To match the pools/queues configuration, the pools/queues output should start from VMDQ base queue. This patch fixed the issue.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 examples/vmdq/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
examples/vmdq/main.c index renamed from examples/vmdq/main.c +0 -0

011110920..5ab3427c0 100644

examples/vmdq/main.c +5 -5
@@ -441,10 +441,11 @@ update_mac_address(struct rte_mbuf *m, unsigned
 dst_port)  static void  sighup_handler(int signum)  {
-	unsigned q;
-	for (q = 0; q < num_queues; q++) {
-		if (q % (num_queues/num_pools) == 0)
-			printf("\nPool %u: ", q/(num_queues/num_pools));
+	unsigned int q = vmdq_queue_base;
+	for (; q < num_queues; q++) {
+		if ((q - vmdq_queue_base) % (num_vmdq_queues / num_pools)
 == 0)
+			printf("\nPool %u: ", (q - vmdq_queue_base) /
+			       (num_vmdq_queues / num_pools));
 		printf("%lu ", rxPackets[q]);
 	}
 	printf("\nFinished handling signal %d\n", signum);
--
Quoted 1 line

2.17.1

Applied
#7 lore raw
Quoted 47 lines · YingyaX

BRs,
Yingya
-----Original Message-----
From: stable <[email protected]> On Behalf Of Li, Xiaoyun
Sent: Monday, March 2, 2020 3:19 PM
To: Jiang, JunyuX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; [email protected]
Subject: Re: [dpdk-stable] [PATCH v3] examples/vmdq: fix the output of pools/queues

Hi

Quoted 35 lines

-----Original Message-----
From: Jiang, JunyuX
Sent: Monday, March 2, 2020 14:41
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>; Yang, Qiming <[email protected]>; Jiang, JunyuX <[email protected]>; [email protected]
Subject: [PATCH v3] examples/vmdq: fix the output of pools/queues

To match the pools/queues configuration, the pools/queues output should start from VMDQ base queue. This patch fixed the issue.

Fixes 6bb97df521aa ("examples/vmdq: new app")
---
 examples/vmdq/main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
examples/vmdq/main.c index renamed from examples/vmdq/main.c +0 -0

011110920..5ab3427c0 100644

examples/vmdq/main.c +4 -4
@@ -441,10 +441,11 @@ update_mac_address(struct rte_mbuf *m, unsigned
 dst_port)  static void  sighup_handler(int signum)  {
-	unsigned q;
-	for (q = 0; q < num_queues; q++) {
-		if (q % (num_queues/num_pools) == 0)
-			printf("\nPool %u: ", q/(num_queues/num_pools));
+	unsigned int q = vmdq_queue_base;
+	for (; q < num_queues; q++) {
+		if ((q - vmdq_queue_base) % (num_vmdq_queues / num_pools)
 == 0)
+			printf("\nPool %u: ", (q - vmdq_queue_base) /
Quoted 9 lines
Quoted 6 lines
examples/vmdq/main.c +1 -1
+			       (num_vmdq_queues / num_pools));
 		printf("%lu ", rxPackets[q]);
 	}
 	printf("\nFinished handling signal %d\n", signum);
--

2.17.1

Applied to dpdk-next-net/master, thanks.