app/testpmd: fix tunnel offload flows

Message ID 20210511080331.13971-1-getelson@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: fix tunnel offload flows |

Checks

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

Commit Message

Gregory Etelson May 11, 2021, 8:03 a.m. UTC
  Tunnel offload model requires application to obtain PMD related flow
items or actions to construct a flow rule. These elements acquire
internal PMD flow resources that must be explicitly released.

The patch destroys tunnel offload PMD resources after flow creation
failure.

Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload")

Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 app/test-pmd/config.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Ferruh Yigit May 11, 2021, 7:11 p.m. UTC | #1
On 5/11/2021 9:03 AM, Gregory Etelson wrote:
> Tunnel offload model requires application to obtain PMD related flow
> items or actions to construct a flow rule. These elements acquire
> internal PMD flow resources that must be explicitly released.
> 
> The patch destroys tunnel offload PMD resources after flow creation
> failure.
> 
> Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload")
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

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

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 01a541cdd6..43c79b5021 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1940,6 +1940,9 @@  port_flow_create(portid_t port_id,
 	memset(&error, 0x22, sizeof(error));
 	flow = rte_flow_create(port_id, attr, pattern, actions, &error);
 	if (!flow) {
+		if (tunnel_ops->enabled)
+			port_flow_tunnel_offload_cmd_release(port_id,
+							     tunnel_ops, pft);
 		free(pf);
 		return port_flow_complain(&error);
 	}