[dpdk-dev] app/testpmd:add bond type description

Message ID 201706300244.v5U2i5VH060440@mse01.zte.com.cn (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Xie RongQiang June 30, 2017, 2:33 a.m. UTC
  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
  

Patch

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);
+	}
 
 }