DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port
@ 2020-10-14  8:30 Junyu Jiang
  2020-10-14 10:16 ` Suanming Mou
  2020-10-16  2:03 ` [dpdk-dev] [PATCH v2] " Junyu Jiang
  0 siblings, 2 replies; 6+ messages in thread
From: Junyu Jiang @ 2020-10-14  8:30 UTC (permalink / raw)
  To: dev; +Cc: Beilei Xing, Wenzhuo Lu, Junyu Jiang, stable

There is no error info displayed when running flow flush
command with invalid port. This patch fixed the issue.

Fixes: 2a449871a12d ("app/testpmd: align behaviour of multi-port detach")
Cc: stable@dpdk.org

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
---
 app/test-pmd/config.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index fe31a9d52..cc4527386 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1775,16 +1775,17 @@ port_flow_flush(portid_t port_id)
 	struct rte_port *port = &ports[port_id];
 	int ret = 0;
 
+	if (port_id_is_invalid(port_id, ENABLED_WARN) ||
+		port_id == (portid_t)RTE_PORT_ALL)
+		return -EINVAL;
+
 	if (port->flow_list == NULL)
 		return ret;
 
 	/* Poisoning to make sure PMDs update it in case of error. */
 	memset(&error, 0x44, sizeof(error));
 	if (rte_flow_flush(port_id, &error)) {
-		ret = port_flow_complain(&error);
-		if (port_id_is_invalid(port_id, DISABLED_WARN) ||
-		    port_id == (portid_t)RTE_PORT_ALL)
-			return ret;
+		port_flow_complain(&error);
 	}
 
 	while (port->flow_list) {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port
  2020-10-14  8:30 [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port Junyu Jiang
@ 2020-10-14 10:16 ` Suanming Mou
  2020-10-15 22:14   ` Ferruh Yigit
  2020-10-16  2:03 ` [dpdk-dev] [PATCH v2] " Junyu Jiang
  1 sibling, 1 reply; 6+ messages in thread
From: Suanming Mou @ 2020-10-14 10:16 UTC (permalink / raw)
  To: Junyu Jiang, dev; +Cc: Beilei Xing, Wenzhuo Lu, stable

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Junyu Jiang
> Sent: Wednesday, October 14, 2020 4:30 PM
> To: dev@dpdk.org
> Cc: Beilei Xing <beilei.xing@intel.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>;
> Junyu Jiang <junyux.jiang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port
> 
> There is no error info displayed when running flow flush command with invalid
> port. This patch fixed the issue.
> 
> Fixes: 2a449871a12d ("app/testpmd: align behaviour of multi-port detach")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
> ---
>  app/test-pmd/config.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> fe31a9d52..cc4527386 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -1775,16 +1775,17 @@ port_flow_flush(portid_t port_id)
>  	struct rte_port *port = &ports[port_id];
>  	int ret = 0;
> 
> +	if (port_id_is_invalid(port_id, ENABLED_WARN) ||
> +		port_id == (portid_t)RTE_PORT_ALL)
> +		return -EINVAL;
> +

Also better to move the port initialize after this check to make the code clean?
Reviewed-by: Suanming Mou <suanmingm@nvidia.com>

>  	if (port->flow_list == NULL)
>  		return ret;
> 
>  	/* Poisoning to make sure PMDs update it in case of error. */
>  	memset(&error, 0x44, sizeof(error));
>  	if (rte_flow_flush(port_id, &error)) {
> -		ret = port_flow_complain(&error);
> -		if (port_id_is_invalid(port_id, DISABLED_WARN) ||
> -		    port_id == (portid_t)RTE_PORT_ALL)
> -			return ret;
> +		port_flow_complain(&error);
>  	}
> 
>  	while (port->flow_list) {
> --
> 2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port
  2020-10-14 10:16 ` Suanming Mou
@ 2020-10-15 22:14   ` Ferruh Yigit
  2020-10-16  1:27     ` Jiang, JunyuX
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2020-10-15 22:14 UTC (permalink / raw)
  To: Suanming Mou, Junyu Jiang, dev; +Cc: Beilei Xing, Wenzhuo Lu, stable

On 10/14/2020 11:16 AM, Suanming Mou wrote:
> Hi,
> 
>> -----Original Message-----
>> From: dev <dev-bounces@dpdk.org> On Behalf Of Junyu Jiang
>> Sent: Wednesday, October 14, 2020 4:30 PM
>> To: dev@dpdk.org
>> Cc: Beilei Xing <beilei.xing@intel.com>; Wenzhuo Lu <wenzhuo.lu@intel.com>;
>> Junyu Jiang <junyux.jiang@intel.com>; stable@dpdk.org
>> Subject: [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port
>>
>> There is no error info displayed when running flow flush command with invalid
>> port. This patch fixed the issue.
>>
>> Fixes: 2a449871a12d ("app/testpmd: align behaviour of multi-port detach")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
>> ---
>>   app/test-pmd/config.c | 9 +++++----
>>   1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
>> fe31a9d52..cc4527386 100644
>> --- a/app/test-pmd/config.c
>> +++ b/app/test-pmd/config.c
>> @@ -1775,16 +1775,17 @@ port_flow_flush(portid_t port_id)
>>   	struct rte_port *port = &ports[port_id];
>>   	int ret = 0;
>>
>> +	if (port_id_is_invalid(port_id, ENABLED_WARN) ||
>> +		port_id == (portid_t)RTE_PORT_ALL)
>> +		return -EINVAL;
>> +
> 
> Also better to move the port initialize after this check to make the code clean?
 >

+1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port
  2020-10-15 22:14   ` Ferruh Yigit
@ 2020-10-16  1:27     ` Jiang, JunyuX
  0 siblings, 0 replies; 6+ messages in thread
From: Jiang, JunyuX @ 2020-10-16  1:27 UTC (permalink / raw)
  To: Yigit, Ferruh, Suanming Mou, dev; +Cc: Xing, Beilei, Lu, Wenzhuo, stable

Hi,

> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> Sent: Friday, October 16, 2020 6:14 AM
> To: Suanming Mou <suanmingm@nvidia.com>; Jiang, JunyuX
> <junyux.jiang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port
> 
> On 10/14/2020 11:16 AM, Suanming Mou wrote:
> > Hi,
> >
> >> -----Original Message-----
> >> From: dev <dev-bounces@dpdk.org> On Behalf Of Junyu Jiang
> >> Sent: Wednesday, October 14, 2020 4:30 PM
> >> To: dev@dpdk.org
> >> Cc: Beilei Xing <beilei.xing@intel.com>; Wenzhuo Lu
> >> <wenzhuo.lu@intel.com>; Junyu Jiang <junyux.jiang@intel.com>;
> >> stable@dpdk.org
> >> Subject: [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid
> >> port
> >>
> >> There is no error info displayed when running flow flush command with
> >> invalid port. This patch fixed the issue.
> >>
> >> Fixes: 2a449871a12d ("app/testpmd: align behaviour of multi-port
> >> detach")
> >> Cc: stable@dpdk.org
> >>
> >> Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
> >> ---
> >>   app/test-pmd/config.c | 9 +++++----
> >>   1 file changed, 5 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> >> fe31a9d52..cc4527386 100644
> >> --- a/app/test-pmd/config.c
> >> +++ b/app/test-pmd/config.c
> >> @@ -1775,16 +1775,17 @@ port_flow_flush(portid_t port_id)
> >>   	struct rte_port *port = &ports[port_id];
> >>   	int ret = 0;
> >>
> >> +	if (port_id_is_invalid(port_id, ENABLED_WARN) ||
> >> +		port_id == (portid_t)RTE_PORT_ALL)
> >> +		return -EINVAL;
> >> +
> >
> > Also better to move the port initialize after this check to make the code
> clean?
>  >
> 
> +1
I will fix in V2.
Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] app/testpmd: fix flow flush with invalid port
  2020-10-14  8:30 [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port Junyu Jiang
  2020-10-14 10:16 ` Suanming Mou
@ 2020-10-16  2:03 ` " Junyu Jiang
  2020-10-16 13:04   ` Ferruh Yigit
  1 sibling, 1 reply; 6+ messages in thread
From: Junyu Jiang @ 2020-10-16  2:03 UTC (permalink / raw)
  To: dev
  Cc: Suanming Mou, Ferruh Yigit, Beilei Xing, Wenzhuo Lu, Junyu Jiang, stable

There is no error info displayed when running flow flush
command with invalid port. This patch fixed the issue.

Fixes: 2a449871a12d ("app/testpmd: align behaviour of multi-port detach")
Cc: stable@dpdk.org

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Reviewed-by: Suanming Mou <suanmingm@nvidia.com>
---
 app/test-pmd/config.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index fe31a9d52..541952ab8 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1772,19 +1772,22 @@ int
 port_flow_flush(portid_t port_id)
 {
 	struct rte_flow_error error;
-	struct rte_port *port = &ports[port_id];
+	struct rte_port *port;
 	int ret = 0;
 
+	if (port_id_is_invalid(port_id, ENABLED_WARN) ||
+		port_id == (portid_t)RTE_PORT_ALL)
+		return -EINVAL;
+
+	port = &ports[port_id];
+
 	if (port->flow_list == NULL)
 		return ret;
 
 	/* Poisoning to make sure PMDs update it in case of error. */
 	memset(&error, 0x44, sizeof(error));
 	if (rte_flow_flush(port_id, &error)) {
-		ret = port_flow_complain(&error);
-		if (port_id_is_invalid(port_id, DISABLED_WARN) ||
-		    port_id == (portid_t)RTE_PORT_ALL)
-			return ret;
+		port_flow_complain(&error);
 	}
 
 	while (port->flow_list) {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] app/testpmd: fix flow flush with invalid port
  2020-10-16  2:03 ` [dpdk-dev] [PATCH v2] " Junyu Jiang
@ 2020-10-16 13:04   ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2020-10-16 13:04 UTC (permalink / raw)
  To: Junyu Jiang, dev; +Cc: Suanming Mou, Beilei Xing, Wenzhuo Lu, stable

On 10/16/2020 3:03 AM, Junyu Jiang wrote:
> There is no error info displayed when running flow flush
> command with invalid port. This patch fixed the issue.
> 
> Fixes: 2a449871a12d ("app/testpmd: align behaviour of multi-port detach")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
> Reviewed-by: Suanming Mou <suanmingm@nvidia.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14  8:30 [dpdk-dev] [PATCH] app/testpmd: fix flow flush with invalid port Junyu Jiang
2020-10-14 10:16 ` Suanming Mou
2020-10-15 22:14   ` Ferruh Yigit
2020-10-16  1:27     ` Jiang, JunyuX
2020-10-16  2:03 ` [dpdk-dev] [PATCH v2] " Junyu Jiang
2020-10-16 13:04   ` Ferruh Yigit

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox