DPDK patches and discussions
 help / color / mirror / Atom feed
From: RongQiang Xie <xie.rongqiang@zte.com.cn>
To: jingjing.wu@intel.com
Cc: dev@dpdk.org, RongQiang Xie <xie.rongqiang@zte.com.cn>
Subject: [dpdk-dev] [PATCH] app/testpmd:add bond type description
Date: Fri, 30 Jun 2017 15:35:25 +0800	[thread overview]
Message-ID: <201706300746.v5U7kspw066651@mse01.zte.com.cn> (raw)

In function cmd_show_bonding_config_parsed() used number represent
the bond type,in order more detailed,add bond type description
otherwise we may confused about the number type.
And also,the primary port just use in mode active backup and tlb,
so,when the mode is active backup or tlb show the primary port info
may be more appropriate.

Signed-off-by: RongQiang Xie <xie.rongqiang@zte.com.cn>
---
 0001-app-testpmd-add-bond-type-description.patch | 60 ++++++++++++++++++++++++
 app/test-pmd/cmdline.c                           | 15 ++++--
 2 files changed, 70 insertions(+), 5 deletions(-)
 create mode 100644 0001-app-testpmd-add-bond-type-description.patch

diff --git a/0001-app-testpmd-add-bond-type-description.patch b/0001-app-testpmd-add-bond-type-description.patch
new file mode 100644
index 0000000..20252af
--- /dev/null
+++ b/0001-app-testpmd-add-bond-type-description.patch
@@ -0,0 +1,60 @@
+From 74563db80f4bfbf91e949a9a575cd67e84a9b4a3 Mon Sep 17 00:00:00 2001
+From: RongQiang Xie <xie.rongqiang@zte.com.cn>
+Date: Fri, 30 Jun 2017 10:26:39 +0800
+Subject: [PATCH] app/testpmd:add bond type description
+
+In function cmd_show_bonding_config_parsed() used number represent
+the bond type,in order more detailed,add bond type description
+otherwise we may confused about the number type.
+And also,the primary port just use in mode active backup and tlb,
+so,when the mode is active backup or tlb show the primary port info
+may be more appropriate.
+
+Signed-off-by: RongQiang Xie <xie.rongqiang@zte.com.cn>
+---
+ app/test-pmd/cmdline.c | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+ mode change 100644 => 100755 app/test-pmd/cmdline.c
+
+diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
+old mode 100644
+new mode 100755
+index ff8ffd2..3878934
+--- a/app/test-pmd/cmdline.c
++++ b/app/test-pmd/cmdline.c
+@@ -4390,7 +4390,9 @@ static void cmd_show_bonding_config_parsed(void *parsed_result,
+ 		printf("\tFailed to get bonding mode for port = %d\n", port_id);
+ 		return;
+ 	} else
+-		printf("\tBonding mode: %d\n", bonding_mode);
++		printf("\tBonding mode: %d ", bonding_mode);
++	printf("[0:Round Robin, 1:Active Backup, 2:Balance, 3:Broadcast, ");
++	printf("\n\t\t\t4:802.3AD, 5:Adaptive TLB, 6:Adaptive Load Balancing]\n");
+ 
+ 	if (bonding_mode == BONDING_MODE_BALANCE) {
+ 		int balance_xmit_policy;
+@@ -4454,12 +4456,15 @@ static void cmd_show_bonding_config_parsed(void *parsed_result,
+ 
+ 	}
+ 
+-	primary_id = rte_eth_bond_primary_get(port_id);
+-	if (primary_id < 0) {
+-		printf("\tFailed to get primary slave for port = %d\n", port_id);
+-		return;
+-	} else
+-		printf("\tPrimary: [%d]\n", primary_id);
++	if (bonding_mode == BONDING_MODE_ACTIVE_BACKUP ||
++			bonding_mode == BONDING_MODE_TLB) {
++		primary_id = rte_eth_bond_primary_get(port_id);
++		if (primary_id < 0) {
++			printf("\tFailed to get primary slave for port = %d\n", port_id);
++			return;
++		} else
++			printf("\tPrimary: [%d]\n", primary_id);
++	}
+ 
+ }
+ 
+-- 
+1.8.3.1
+
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index ff8ffd2..be4b80b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -4391,6 +4391,8 @@ static void cmd_show_bonding_config_parsed(void *parsed_result,
 		return;
 	} else
 		printf("\tBonding mode: %d\n", bonding_mode);
+	printf("[0:Round Robin, 1:Active Backup, 2:Balance, 3:Broadcast, ");
+	printf("\n\t\t\t4:802.3AD, 5:Adaptive TLB, 6:Adaptive Load Balancing]\n");
 
 	if (bonding_mode == BONDING_MODE_BALANCE) {
 		int balance_xmit_policy;
@@ -4454,12 +4456,15 @@ static void cmd_show_bonding_config_parsed(void *parsed_result,
 
 	}
 
-	primary_id = rte_eth_bond_primary_get(port_id);
-	if (primary_id < 0) {
-		printf("\tFailed to get primary slave for port = %d\n", port_id);
-		return;
-	} else
+	if (bonding_mode == BONDING_MODE_ACTIVE_BACKUP || 
+			bonding_mode == BONDING_MODE_TLB) {
+		primary_id = rte_eth_bond_primary_get(port_id);
+		if (primary_id < 0) {
+			printf("\tFailed to get primary slave for port = %d\n", port_id);
+			return;
+		}
 		printf("\tPrimary: [%d]\n", primary_id);
+	}
 
 }
 
-- 
1.8.3.1

             reply	other threads:[~2017-06-30  7:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30  7:35 RongQiang Xie [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-25  2:49 Rongqiang XIE
2017-08-24 10:55 Rongqiang XIE
2017-06-30  7:56 RongQiang Xie
2017-06-30 15:39 ` Declan Doherty
2017-07-02 18:11   ` Thomas Monjalon
2017-06-30  2:33 RongQiang Xie
2017-06-30  1:52 RongQiang Xie
2017-06-30 13:47 ` Declan Doherty
2017-06-30 13:52   ` Declan Doherty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201706300746.v5U7kspw066651@mse01.zte.com.cn \
    --to=xie.rongqiang@zte.com.cn \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).