Skip to contentSkip to conversation

app/testpmd: remove port stop check for macsec

PATCH Superseded Wei Zhao 4 participants 9 messages May 9, 2019 – Jul 1, 2019

lore
Share & tools
lore

Wei Zhao

author
#0 lore raw

PATCH 1/1 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 ew do not delete this unnessarycode, users have to sotp port before enable macsec, then restart this port after make configuration. All these process is useless. As this cmdline is a private API only use by ixgbe NIC, so remove it.

Fixes 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")
---
 app/test-pmd/cmdline.c | 5 -----
 1 file changed, 5 deletions(-)
app/test-pmd/cmdline.c +0 -5
index c1042dd..b969745 100644
@@ -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);
Signature · 1 line
2.7.5
author
#1 lore raw

PATCH v2 1/1 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")

---

v2:
-update log info and delete code in disable function

---
 app/test-pmd/cmdline.c | 10 ----------
 1 file changed, 10 deletions(-)
app/test-pmd/cmdline.c +0 -10
index c1042dd..dd0f698 100644
@@ -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);
Signature · 1 line
2.7.5
author Tested-by Peng Yuan on v2 1/1
#2 lore raw
Quoted 74 lines

-----Original Message-----
From: Zhao1, Wei
Sent: Friday, May 10, 2019 4:41 PM
To: [email protected]
Cc: [email protected]; Peng, Yuan <[email protected]>; Yigit, Ferruh <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhao1, Wei <[email protected]>
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")

---

v2:

(quoted diff) +0 -2
-update log info and delete code in disable function
---
 app/test-pmd/cmdline.c | 10 ----------
 1 file changed, 10 deletions(-)
app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0 -0

c1042dd..dd0f698 100644

app/test-pmd/cmdline.c +0 -4
@@ -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(

app/test-pmd/cmdline.c +0 -0
 	case 0:
 		ports[port_id].dev_conf.txmode.offloads |=
	DEV_TX_OFFLOAD_MACSEC_INSERT;
app/test-pmd/cmdline.c +0 -1
-		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(

app/test-pmd/cmdline.c +0 -4
 	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(

app/test-pmd/cmdline.c +0 -0
 	case 0:
 		ports[port_id].dev_conf.txmode.offloads &=
	~DEV_TX_OFFLOAD_MACSEC_INSERT;
app/test-pmd/cmdline.c +0 -2
-		cmd_reconfig_device_queue(port_id, 1, 1);
 		break;
 	case -ENODEV:
 		printf("invalid port_id %d\n", port_id);
--

2.7.5

#3 lore raw

Hi Wei,

<snip>

Quoted 4 lines
Quoted 4 lines

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.

Quoted 1 line
Quoted 1 line

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

Typo: "sotp" should be "stop"

Quoted 1 line
Quoted 1 line

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

Typo: "these" should be "this"

Quoted 7 lines
Quoted 1 line

process is useless. As this cmdline is a private API which is only used by ixgbe

NIC, so remove it.

Quoted 5 lines
Fixes 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")

Otherwise

author
#4 lore raw

Thank you, update in v3.

Quoted 39 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Friday, June 7, 2019 9:59 PM
To: Zhao1, Wei <[email protected]>; [email protected]
Cc: [email protected]; Peng, Yuan <[email protected]>; Yigit, Ferruh <[email protected]>; Lu, Wenzhuo <[email protected]>
Subject: RE: [dpdk-dev] [PATCH v2] app/testpmd: remove port stop check for macsec

Hi Wei,

<snip>

Quoted 4 lines
Quoted 4 lines

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.

Quoted 1 line
Quoted 1 line

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

Typo: "sotp" should be "stop"

Quoted 1 line
Quoted 1 line

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

Typo: "these" should be "this"

Quoted 8 lines
Quoted 2 lines

process is useless. As this cmdline is a private API which is only used by ixgbe

NIC, so remove it.

Quoted 5 lines
Fixes 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")

Otherwise

author
#5 lore raw

PATCH v3 1/1 app/testpmd: remove port stop check for macsec

In reply to Wei Zhao

There is no need to do such a check when set macsec for ixgbe, and reconfig_device_queueand is also useless. If we do not delete this unnessary code, users have to stop port before enable or disable macsec, then restart this port after make configuration. All these process are 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")

---

v2:
-update log info and delete code in disable function

v3:
-update typo in log

---
 app/test-pmd/cmdline.c | 10 ----------
 1 file changed, 10 deletions(-)
app/test-pmd/cmdline.c +0 -10
index d1e0d44..e7c4bee 100644
@@ -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);
Signature · 1 line
2.7.5
Applied
#6 lore raw
Quoted 7 lines · Wei Zhao

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

Quoted 6 lines
Fixes 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")

Applied to dpdk-next-net/master, thanks.

#7 lore raw

27/06/2019 19:23, Ferruh Yigit:

Quoted 8 lines · Wei Zhao
Quoted 7 lines

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

Quoted 8 lines
Quoted 6 lines
Fixes 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")

Applied to dpdk-next-net/master, thanks.

I disagree with the purpose of this patch.
It is removing some "generic" code with the argument that it is not needed in the case of ixgbe, and ixgbe is the only user. We may (and probably will) have other PMDs using this command, so the argument is not OK.

I do not merge this patch in master for now.
Sorry for the inconvenience.

#8 lore raw
Quoted 18 lines · Thomas Monjalon

27/06/2019 19:23, Ferruh Yigit:

Quoted 8 lines · Wei Zhao
Quoted 7 lines

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

Quoted 8 lines
Quoted 6 lines
Fixes 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")

Applied to dpdk-next-net/master, thanks.

Quoted 8 lines

I disagree with the purpose of this patch.
It is removing some "generic" code with the argument that it is not needed in the case of ixgbe, and ixgbe is the only user. We may (and probably will) have other PMDs using this command, so the argument is not OK.

I do not merge this patch in master for now.
Sorry for the inconvenience.

Dropped from the next-net based on nack