[dpdk-dev] app/testpmd: remove port status check from TM node add cli

Message ID 20171110103049.82906-1-jasvinder.singh@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

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

Commit Message

Jasvinder Singh Nov. 10, 2017, 10:30 a.m. UTC
  Currently, testpmd CLI doesn't permit to add leaf and non-leaf node when
port is started. It doesn't work in case of i40e device as DCB
configuration is deleted when port is stopped. Therefore, removes the
port status check before invoking leaf and nonleaf node API in the cli.
If needed, device can add port status check at the driver layer. 

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 app/test-pmd/cmdline_tm.c | 12 ------------
 1 file changed, 12 deletions(-)
  

Comments

Wenzhuo Lu Nov. 10, 2017, 12:14 p.m. UTC | #1
Hi,

> -----Original Message-----
> From: Singh, Jasvinder
> Sent: Friday, November 10, 2017 6:31 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Pei, Yulong
> <yulong.pei@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: [PATCH] app/testpmd: remove port status check from TM node add
> cli
> 
> Currently, testpmd CLI doesn't permit to add leaf and non-leaf node when
> port is started. It doesn't work in case of i40e device as DCB configuration is
> deleted when port is stopped. Therefore, removes the port status check
> before invoking leaf and nonleaf node API in the cli.
> If needed, device can add port status check at the driver layer.
> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
  
Thomas Monjalon Nov. 11, 2017, 3:17 p.m. UTC | #2
> > Currently, testpmd CLI doesn't permit to add leaf and non-leaf node when
> > port is started. It doesn't work in case of i40e device as DCB configuration is
> > deleted when port is stopped. Therefore, removes the port status check
> > before invoking leaf and nonleaf node API in the cli.
> > If needed, device can add port status check at the driver layer.
> > 
> > Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Applied, thanks
  

Patch

diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c
index 4acef98..803fae4 100644
--- a/app/test-pmd/cmdline_tm.c
+++ b/app/test-pmd/cmdline_tm.c
@@ -1599,12 +1599,6 @@  static void cmd_add_port_tm_nonleaf_node_parsed(void *parsed_result,
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 
-	/* Port status */
-	if (port_is_started(port_id)) {
-		printf(" Port %u not stopped (error)\n", port_id);
-		return;
-	}
-
 	memset(&np, 0, sizeof(struct rte_tm_node_params));
 
 	/* Node parameters */
@@ -1759,12 +1753,6 @@  static void cmd_add_port_tm_leaf_node_parsed(void *parsed_result,
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 
-	/* Port status */
-	if (port_is_started(port_id)) {
-		printf(" Port %u not stopped (error)\n", port_id);
-		return;
-	}
-
 	memset(&np, 0, sizeof(struct rte_tm_node_params));
 
 	/* Node parameters */