Skip to content

Commit

Permalink
app/testpmd: release flows left before port stop
Browse files Browse the repository at this point in the history
[ upstream commit 0f93edb ]

According to RTE flow user guide, PMD will not keep flow rules after
port stop. Application resources that refer to flow rules become
obsolete after port stop and must not be used.
Testpmd maintains linked list of active flows for each port. Entries in
that list are allocated dynamically and must be explicitly released to
prevent memory leak.
The patch releases testpmd port flow_list that holds remaining flows
before port is stopped.

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
  • Loading branch information
getelson-at-mellanox authored and cpaelzer committed Feb 3, 2021
1 parent aa28e79 commit ba53d40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/test-pmd/testpmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2552,6 +2552,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),
Expand Down

0 comments on commit ba53d40

Please sign in to comment.