DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Aman Singh <aman.deep.singh@intel.com>,
	Yuying Zhang <yuying.zhang@intel.com>, Ori Kam <orika@nvidia.com>,
	Alexander Kozyrev <akozyrev@nvidia.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: [PATCH] app/testpmd: fix async flow create failure handling
Date: Wed, 28 Feb 2024 19:57:07 +0100	[thread overview]
Message-ID: <20240228185707.186522-1-dsosnowski@nvidia.com> (raw)

In case of an error when an asynchronous flow create operation was
enqueued, test-pmd attempted to enqueue a flow destroy operation
of that flow rule.
However, this was incorrect because:

- Flow rule index was used to enqueue a flow destroy operation.
  This flow rule index was not yet initialized, so flow rule number 0
  was always destroyed as a result.
- Since rte_flow_async_create() does not return a handle on error,
  then there is no flow rule to destroy.

test-pmd only needs to free internal memory allocated for
storing a flow rule. Any flow destroy operation is not needed
in this case.

Fixes: ecdc927b99f2 ("app/testpmd: add async flow create/destroy operations")
Cc: akozyrev@nvidia.com
Cc: stable@dpdk.org

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 app/test-pmd/config.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 08d7d0e2f8..8bf2e411b5 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2856,8 +2856,7 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id,
 		flow = rte_flow_async_create_by_index(port_id, queue_id, &op_attr, pt->table,
 			rule_idx, actions, actions_idx, job, &error);
 	if (!flow) {
-		uint64_t flow_id = pf->id;
-		port_queue_flow_destroy(port_id, queue_id, true, 1, &flow_id);
+		free(pf);
 		free(job);
 		return port_flow_complain(&error);
 	}
-- 
2.39.2


             reply	other threads:[~2024-02-28 18:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 18:57 Dariusz Sosnowski [this message]
2024-03-01 11:55 ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240228185707.186522-1-dsosnowski@nvidia.com \
    --to=dsosnowski@nvidia.com \
    --cc=akozyrev@nvidia.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=orika@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).