app/testpmd: check port is stopped for QinQ setup
PATCH 1/1 app/testpmd: check port is stopped for QinQ setup
Check port is stopped before configuring it for QinQ, with the "vlan set qinq on <port_id>" command.
--- app/test-pmd/cmdline.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
app/test-pmd/cmdline.c +9 -3
@@ -1,7 +1,7 @@/*- * BSD LICENSE * -* Copyright(c) 2010-2016 Intel Corporation. All rights reserved. +* Copyright(c) 2010-2017 Intel Corporation. All rights reserved. * Copyright(c) 2014 6WIND S.A. * All rights reserved. *
@@ -3036,6 +3036,7 @@ cmd_vlan_offload_parsed(void *parsed_result,int i, len =0 ;portid_t port_id =0 ;unsigned int tmp; +struct rte_port *port; str = res->port_id; len =strnlen (str,STR_TOKEN_SIZE );
@@ -3053,6 +3054,7 @@ cmd_vlan_offload_parsed(void *parsed_result,if (tmp >=RTE_MAX_ETHPORTS )return ; port_id = (portid_t )tmp; + port = &ports[port_id];if (!strcmp (res->on,"on" )) on =1 ;
@@ -3079,9 +3081,13 @@ cmd_vlan_offload_parsed(void *parsed_result, }else if (!strcmp (res->what,"filter" ))rx_vlan_filter_set (port_id, on); -else +else { +if (port->port_status !=RTE_PORT_STOPPED ) { +printf ("Please stop port %d first\n" , port_id); +return ; + }vlan_extend_set (port_id, on); - + }return ; }
Signature · 1 line
2.11.0
Hi Bernard,
Quoted 8 lines
-----Original Message-----
From: Iremonger, Bernard
Sent: Thursday, April 20, 2017 11:14 PM
To: [email protected]; Xing, Beilei <[email protected]>; Zhang, Qi <[email protected]>
Cc: Iremonger, Bernard <[email protected]>
Subject: [PATCH] app/testpmd: check port is stopped for QinQ setup
Quoted 4 lines
Check port is stopped before configuring it for QinQ, with the "vlan set qinq on <
port_id>" command.Signed-off-by Bernard Iremonger <[email protected]>
Maybe it's better to introduce why stopping port is needed now in commit log.
PATCH v2 1/1 app/testpmd: check port is stopped for QinQ setup
In reply to Bernard IremongerCheck port is stopped before configuring it for QinQ, with the "vlan set qinq on <port_id>" command.
The above command sets the hw_vlan_extend flag. When the port is started it calls the i40e_rx_vec_dev_conf_condition_check_default function to decide whether or not to select the vector mode driver depending on the state of the hw_vlan_extend flag.
---
Changes in v2:
Rebased to latest dpdk-next-net
revised commit message.
add Fixes and Cc lines.
app/test-pmd/cmdline.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
app/test-pmd/cmdline.c +9 -3
@@ -1,7 +1,7 @@/*- * BSD LICENSE * -* Copyright(c) 2010-2016 Intel Corporation. All rights reserved. +* Copyright(c) 2010-2017 Intel Corporation. All rights reserved. * Copyright(c) 2014 6WIND S.A. * All rights reserved. *
@@ -3036,6 +3036,7 @@ cmd_vlan_offload_parsed(void *parsed_result,int i, len =0 ;portid_t port_id =0 ;unsigned int tmp; +struct rte_port *port; str = res->port_id; len =strnlen (str,STR_TOKEN_SIZE );
@@ -3053,6 +3054,7 @@ cmd_vlan_offload_parsed(void *parsed_result,if (tmp >=RTE_MAX_ETHPORTS )return ; port_id = (portid_t )tmp; + port = &ports[port_id];if (!strcmp (res->on,"on" )) on =1 ;
@@ -3079,9 +3081,13 @@ cmd_vlan_offload_parsed(void *parsed_result, }else if (!strcmp (res->what,"filter" ))rx_vlan_filter_set (port_id, on); -else +else { +if (port->port_status !=RTE_PORT_STOPPED ) { +printf ("Please stop port %d first\n" , port_id); +return ; + }vlan_extend_set (port_id, on); - + }return ; }
Signature · 1 line
2.11.0
Quoted 11 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Bernard Iremonger
Sent: Monday, April 24, 2017 6:25 PM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi <[email protected]>; Iremonger, Bernard <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2] app/testpmd: check port is stopped for QinQ setup
Quoted 9 lines
Check port is stopped before configuring it for QinQ, with the "vlan set qinq on <
port_id>" command.The above command sets the
hw_vlan_extendflag.
When the port is started it calls thei40e_rx_vec_dev_conf_condition_check_defaultfunction to decide whether or not to select the vector mode driver depending on the state of thehw_vlan_extendflag.
The command vlan set qinq on <port_id> is an common command, but not only For i40e. I think it's better to doc it somewhere instead of changing the default Behavior of this command.
Hi Jingjing,
Quoted 31 lines
-----Original Message-----
From: Wu, Jingjing
Sent: Tuesday, April 25, 2017 9:55 AM
To: Iremonger, Bernard <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi <[email protected]>; Iremonger, Bernard <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH v2] app/testpmd: check port is stopped for QinQ setupQuoted 2 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of BernardIremonger
Quoted 8 lines
Sent: Monday, April 24, 2017 6:25 PM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi <[email protected]>; Iremonger, Bernard <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2] app/testpmd: check port is stopped for QinQ setupQuoted 9 lines
Check port is stopped before configuring it for QinQ, with the "vlan set qinq on <
port_id>" command.The above command sets the
hw_vlan_extendflag.
When the port is started it calls thei40e_rx_vec_dev_conf_condition_check_defaultfunction to decide whether or not to select the vector mode driver depending on the state of thehw_vlan_extendflag.
Quoted 3 lines
The command vlan set qinq on <
port_id> is an common command, but not only For i40e. I think it's better to doc it somewhere instead of changing the default Behavior of this command.
There is a doc patch in flight:
http://dpdk.org/dev/patchwork/patch/23704/
Is this enough or should I send a v3 of this patch for the i40e PMD only?
Regards,
Bernard.
Quoted 11 lines
Quoted 5 lines
The command vlan set qinq on <
port_id> is an common command, but not only For i40e. I think it's better to doc it somewhere instead of changing the default Behavior of this command.There is a doc patch in flight:
http://dpdk.org/dev/patchwork/patch/23704/Is this enough or should I send a v3 of this patch for the i40e PMD only?
Yes. I think doc it is enough.
We don't need this patch.
Thanks
Jingjing
Hi Jingjing,
Quoted 19 lines
-----Original Message-----
From: Wu, Jingjing
Sent: Thursday, April 27, 2017 6:28 AM
To: Iremonger, Bernard <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH v2] app/testpmd: check port is stopped for QinQ setupQuoted 1 line
Quoted 1 line
The command vlan set qinq on <
port_id> is an common command, butnot
Quoted 6 lines
Quoted 2 lines
only For i40e. I think it's better to doc it somewhere instead of changing the default Behavior of this command.
There is a doc patch in flight:
http://dpdk.org/dev/patchwork/patch/23704/
Quoted 7 lines
Quoted 2 lines
Is this enough or should I send a v3 of this patch for the i40e PMD only?
Yes. I think doc it is enough.
We don't need this patch.Thanks
Jingjing
I will NAK this patch.
Self NAK
Regards,
Bernard.