From: Danylo Vodopianov <dvo-plv@napatech.com>
To: thomas@monjalon.net, aman.deep.singh@intel.com,
yuying.zhang@intel.com, orika@nvidia.com, mko-plv@napatech.com,
ckm@napatech.com, dsosnowski@nvidia.com, sil-plv@napatech.com
Cc: getelson@nvidia.com, akozyrev@nvidia.com, dev@dpdk.org,
stable@dpdk.org, ferruh.yigit@amd.com
Subject: [PATCH v2 1/2] app/testpmd: fix flow update
Date: Mon, 18 Nov 2024 11:25:27 +0100 [thread overview]
Message-ID: <20241118102528.1858308-2-dvo-plv@napatech.com> (raw)
In-Reply-To: <20241118102528.1858308-1-dvo-plv@napatech.com>
If actions provided to “flow update…“ command contained an age
action, then testpmd did not update the age action context
accordingly.
Thus "flow aged <port_id> destroy" command can not
execute successfully.
Fix was done with next steps
1. Generate new port flow entry to add/replace action(s).
2. Set age context if age action is present.
3. Replace flow in the flow list.
Fixes: 2d9c7e56e52c ("app/testpmd: support updating flow rule actions")
Cc: stable@dpdk.org
Signed-off-by: Danylo Vodopianov <dvo-plv@napatech.com>
---
app/test-pmd/config.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 88770b4dfc..c831166431 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -3882,7 +3882,8 @@ port_flow_update(portid_t port_id, uint32_t rule_id,
const struct rte_flow_action *actions, bool is_user_id)
{
struct rte_port *port;
- struct port_flow **flow_list;
+ struct port_flow **flow_list, *uf;
+ struct rte_flow_action_age *age = age_action_get(actions);
if (port_id_is_invalid(port_id, ENABLED_WARN) ||
port_id == (portid_t)RTE_PORT_ALL)
@@ -3897,6 +3898,16 @@ port_flow_update(portid_t port_id, uint32_t rule_id,
flow_list = &flow->next;
continue;
}
+
+ /* Update flow action(s) with new action(s) */
+ uf = port_flow_new(flow->rule.attr_ro, flow->rule.pattern_ro, actions, &error);
+ if (!uf)
+ return port_flow_complain(&error);
+ if (age) {
+ flow->age_type = ACTION_AGE_CONTEXT_TYPE_FLOW;
+ age->context = &flow->age_type;
+ }
+
/*
* Poisoning to make sure PMDs update it in case
* of error.
@@ -3913,6 +3924,14 @@ port_flow_update(portid_t port_id, uint32_t rule_id,
printf("Flow rule #%"PRIu64
" updated with new actions\n",
flow->id);
+
+ uf->next = flow->next;
+ uf->id = flow->id;
+ uf->user_id = flow->user_id;
+ uf->flow = flow->flow;
+ *flow_list = uf;
+
+ free(flow);
return 0;
}
printf("Failed to find flow %"PRIu32"\n", rule_id);
--
2.43.5
next prev parent reply other threads:[~2024-11-18 17:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241031150010.2991953-1-dvo-plv@napatech.com>
2024-11-18 10:25 ` [PATCH v2 0/2] Testpmd flow update/destroy fixes Danylo Vodopianov
2024-11-18 10:25 ` Danylo Vodopianov [this message]
2024-11-18 10:38 ` [PATCH v2 1/2] app/testpmd: fix flow update Dariusz Sosnowski
2024-11-18 10:25 ` [PATCH v2 2/2] app/testpmd: fix aged flow destroy Danylo Vodopianov
2024-11-18 10:43 ` [PATCH v2 0/2] Testpmd flow update/destroy fixes Dariusz Sosnowski
[not found] ` <PAWP190MB2160717526F6D67E34952D2E8B272@PAWP190MB2160.EURP190.PROD.OUTLOOK.COM>
2024-11-18 10:59 ` Dariusz Sosnowski
2024-11-18 11:26 ` Danylo Vodopianov
2024-11-18 11:26 ` [PATCH v2 1/2] app/testpmd: fix flow update Danylo Vodopianov
2024-11-18 12:40 ` Dariusz Sosnowski
2024-11-18 18:02 ` [PATCH v2 0/2] Testpmd flow update/destroy fixes Danylo Vodopianov
2024-11-18 18:02 ` [PATCH v2 1/2] app/testpmd: fix flow update Danylo Vodopianov
2024-11-18 18:02 ` [PATCH v2 2/2] app/testpmd: fix aged flow destroy Danylo Vodopianov
2024-11-18 18:03 ` [PATCH v3 0/2] Testpmd flow update/destroy fixes Danylo Vodopianov
2024-11-18 18:03 ` [PATCH v3 1/2] app/testpmd: fix flow update Danylo Vodopianov
2024-11-18 18:25 ` Dariusz Sosnowski
2024-11-18 18:03 ` [PATCH v3 2/2] app/testpmd: fix aged flow destroy Danylo Vodopianov
2024-11-18 18:25 ` Dariusz Sosnowski
2024-11-19 22:34 ` [PATCH v3 0/2] Testpmd flow update/destroy fixes Thomas Monjalon
2024-11-18 11:26 ` [PATCH v2 2/2] app/testpmd: fix aged flow destroy Danylo Vodopianov
2024-11-18 13:37 ` Dariusz Sosnowski
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=20241118102528.1858308-2-dvo-plv@napatech.com \
--to=dvo-plv@napatech.com \
--cc=akozyrev@nvidia.com \
--cc=aman.deep.singh@intel.com \
--cc=ckm@napatech.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=ferruh.yigit@amd.com \
--cc=getelson@nvidia.com \
--cc=mko-plv@napatech.com \
--cc=orika@nvidia.com \
--cc=sil-plv@napatech.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
--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).