DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd:add bond type description
@ 2017-06-30  7:56 RongQiang Xie
  2017-06-30 15:39 ` Declan Doherty
  0 siblings, 1 reply; 6+ messages in thread
From: RongQiang Xie @ 2017-06-30  7:56 UTC (permalink / raw)
  To: jingjing.wu; +Cc: dev, RongQiang Xie

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 | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index ff8ffd2..45845a4 100644
--- 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
+	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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-08-24 11:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30  7:56 [dpdk-dev] [PATCH] app/testpmd:add bond type description RongQiang Xie
2017-06-30 15:39 ` Declan Doherty
2017-07-02 18:11   ` Thomas Monjalon
2017-08-16  2:31     ` [dpdk-dev] 答复: " xie.rongqiang
2017-08-23 20:22       ` Thomas Monjalon
2017-08-24 11:07         ` [dpdk-dev] 答复: " xie.rongqiang

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).