app/testpmd: fix flow rules list after port stop
diff mbox series

Message ID 20200811061443.8214-1-getelson@nvidia.com
State New
Delegated to: Ferruh Yigit
Headers show
Series
  • app/testpmd: fix flow rules list after port stop
Related show

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Gregory Etelson Aug. 11, 2020, 6:14 a.m. UTC
According to current RTE API, port flow rules must not be kept
after port stop.

Testpmd did not flush port flow rules after `port stop' command was
called. As the result, after the port was restarted, it showed bogus
flow rules.

Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")

Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ajit Khaparde Nov. 24, 2020, 2:42 p.m. UTC | #1
On Mon, Aug 10, 2020 at 11:15 PM Gregory Etelson <getelson@nvidia.com> wrote:
>
> According to current RTE API, port flow rules must not be kept
> after port stop.
>
> Testpmd did not flush port flow rules after `port stop' command was
> called. As the result, after the port was restarted, it showed bogus
> flow rules.
>
> Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")
>
> Cc: stable@dpdk.org
>
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Ori Kam <orika@nvidia.com>

Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

> ---
>  app/test-pmd/testpmd.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 7842c3b781..4ba5c41c6e 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -2627,6 +2627,9 @@ stop_port(portid_t pid)
>                                                 RTE_PORT_HANDLING) == 0)
>                         continue;
>
> +               if (port->flow_list)
> +                       port_flow_flush(pi);
> +
>                 rte_eth_dev_stop(pi);
>
>                 if (rte_atomic16_cmpset(&(port->port_status),
> --
> 2.25.1
>
Thomas Monjalon Nov. 26, 2020, 3:41 p.m. UTC | #2
24/11/2020 15:42, Ajit Khaparde:
> On Mon, Aug 10, 2020 at 11:15 PM Gregory Etelson <getelson@nvidia.com> wrote:
> >
> > According to current RTE API, port flow rules must not be kept
> > after port stop.
> >
> > Testpmd did not flush port flow rules after `port stop' command was
> > called. As the result, after the port was restarted, it showed bogus
> > flow rules.
> >
> > Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings")
> >
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> > Acked-by: Ori Kam <orika@nvidia.com>
> 
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

The rte_flow doc is now updated to make clear that flow rules
are not kept after port stop.
This testpmd patch should make clear that the need of flushing
is only for testpmd objects.
The change is postponed to DPDK 21.02.

Patch
diff mbox series

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 7842c3b781..4ba5c41c6e 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2627,6 +2627,9 @@  stop_port(portid_t pid)
 						RTE_PORT_HANDLING) == 0)
 			continue;
 
+		if (port->flow_list)
+			port_flow_flush(pi);
+
 		rte_eth_dev_stop(pi);
 
 		if (rte_atomic16_cmpset(&(port->port_status),