[v2] app/testpmd: remove port stop check for macsec

Message ID 1557477677-54876-1-git-send-email-wei.zhao1@intel.com
State Superseded
Delegated to: Ferruh Yigit
Headers show
Series
  • [v2] app/testpmd: remove port stop check for macsec
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Wei Zhao May 10, 2019, 8:41 a.m.
There is no need to do such a check when set macsec for ixgbe,
reconfig_device_queueand is also useless. If we do not delete this
unnessary code, users have to sotp port before enable or disable
macsec, then restart this port after make configuration. All these
process is useless. As this cmdline is a private API which is only
used by ixgbe NIC, so remove it.

Fixes: 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

---

v2:
-update log info and delete code in disable function
---
 app/test-pmd/cmdline.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Wei Zhao May 13, 2019, 3:30 a.m. | #1
Tested-by: Peng Yuan <yuan.peng@intel.com>


> -----Original Message-----
> From: Zhao1, Wei
> Sent: Friday, May 10, 2019 4:41 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Peng, Yuan <yuan.peng@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: [PATCH v2] app/testpmd: remove port stop check for macsec
> 
> There is no need to do such a check when set macsec for ixgbe,
> reconfig_device_queueand is also useless. If we do not delete this unnessary
> code, users have to sotp port before enable or disable macsec, then restart this
> port after make configuration. All these process is useless. As this cmdline is a
> private API which is only used by ixgbe NIC, so remove it.
> 
> Fixes: 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> 
> ---
> 
> v2:
> -update log info and delete code in disable function
> ---
>  app/test-pmd/cmdline.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> c1042dd..dd0f698 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -14044,10 +14044,6 @@ cmd_set_macsec_offload_on_parsed(
> 
>  	if (port_id_is_invalid(port_id, ENABLED_WARN))
>  		return;
> -	if (!port_is_stopped(port_id)) {
> -		printf("Please stop port %d first\n", port_id);
> -		return;
> -	}
> 
>  	rte_eth_dev_info_get(port_id, &dev_info);
>  	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT)
> { @@ -14062,7 +14058,6 @@ cmd_set_macsec_offload_on_parsed(
>  	case 0:
>  		ports[port_id].dev_conf.txmode.offloads |=
> 
> 	DEV_TX_OFFLOAD_MACSEC_INSERT;
> -		cmd_reconfig_device_queue(port_id, 1, 1);
>  		break;
>  	case -ENODEV:
>  		printf("invalid port_id %d\n", port_id); @@ -14138,10 +14133,6
> @@ cmd_set_macsec_offload_off_parsed(
> 
>  	if (port_id_is_invalid(port_id, ENABLED_WARN))
>  		return;
> -	if (!port_is_stopped(port_id)) {
> -		printf("Please stop port %d first\n", port_id);
> -		return;
> -	}
> 
>  	rte_eth_dev_info_get(port_id, &dev_info);
>  	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT)
> { @@ -14153,7 +14144,6 @@ cmd_set_macsec_offload_off_parsed(
>  	case 0:
>  		ports[port_id].dev_conf.txmode.offloads &=
> 
> 	~DEV_TX_OFFLOAD_MACSEC_INSERT;
> -		cmd_reconfig_device_queue(port_id, 1, 1);
>  		break;
>  	case -ENODEV:
>  		printf("invalid port_id %d\n", port_id);
> --
> 2.7.5
Iremonger, Bernard June 7, 2019, 1:59 p.m. | #2
Hi Wei,

<snip>

> > Subject: [PATCH v2] app/testpmd: remove port stop check for macsec
> >
> > There is no need to do such a check when set macsec for ixgbe,
> > reconfig_device_queueand is also useless. If we do not delete this

Typo: space missing before "and" in previous line.

> > unnessary code, users have to sotp port before enable or disable

Typo: "sotp" should be "stop"

> > macsec, then restart this port after make configuration. All these

Typo: "these" should be "this"

> > process is useless. As this cmdline is a private API which is only used by ixgbe
> NIC, so remove it.
> >
> > Fixes: 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

Otherwise
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Wei Zhao June 10, 2019, 6:40 a.m. | #3
Thank you, update in v3.

> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Friday, June 7, 2019 9:59 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org; Peng, Yuan <yuan.peng@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: RE: [dpdk-dev] [PATCH v2] app/testpmd: remove port stop check for
> macsec
> 
> Hi Wei,
> 
> <snip>
> 
> > > Subject: [PATCH v2] app/testpmd: remove port stop check for macsec
> > >
> > > There is no need to do such a check when set macsec for ixgbe,
> > > reconfig_device_queueand is also useless. If we do not delete this
> 
> Typo: space missing before "and" in previous line.
> 
> > > unnessary code, users have to sotp port before enable or disable
> 
> Typo: "sotp" should be "stop"
> 
> > > macsec, then restart this port after make configuration. All these
> 
> Typo: "these" should be "this"
> 
> > > process is useless. As this cmdline is a private API which is only
> > > used by ixgbe
> > NIC, so remove it.
> > >
> > > Fixes: 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> 
> Otherwise
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index c1042dd..dd0f698 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -14044,10 +14044,6 @@  cmd_set_macsec_offload_on_parsed(
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
-	if (!port_is_stopped(port_id)) {
-		printf("Please stop port %d first\n", port_id);
-		return;
-	}
 
 	rte_eth_dev_info_get(port_id, &dev_info);
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
@@ -14062,7 +14058,6 @@  cmd_set_macsec_offload_on_parsed(
 	case 0:
 		ports[port_id].dev_conf.txmode.offloads |=
 						DEV_TX_OFFLOAD_MACSEC_INSERT;
-		cmd_reconfig_device_queue(port_id, 1, 1);
 		break;
 	case -ENODEV:
 		printf("invalid port_id %d\n", port_id);
@@ -14138,10 +14133,6 @@  cmd_set_macsec_offload_off_parsed(
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
-	if (!port_is_stopped(port_id)) {
-		printf("Please stop port %d first\n", port_id);
-		return;
-	}
 
 	rte_eth_dev_info_get(port_id, &dev_info);
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MACSEC_INSERT) {
@@ -14153,7 +14144,6 @@  cmd_set_macsec_offload_off_parsed(
 	case 0:
 		ports[port_id].dev_conf.txmode.offloads &=
 						~DEV_TX_OFFLOAD_MACSEC_INSERT;
-		cmd_reconfig_device_queue(port_id, 1, 1);
 		break;
 	case -ENODEV:
 		printf("invalid port_id %d\n", port_id);