From: Stephen Hemminger <stephen@networkplumber.org>
To: Alexander Kozyrev <akozyrev@nvidia.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>, <rasland@nvidia.com>,
<bingz@nvidia.com>, <orika@nvidia.com>
Subject: Re: [PATCH] app/testpmd: use table ID for jump to matcher action
Date: Thu, 25 Sep 2025 12:37:59 -0700 [thread overview]
Message-ID: <20250925123759.5ac936d9@hermes.local> (raw)
In-Reply-To: <20250819144508.722653-1-akozyrev@nvidia.com>
On Tue, 19 Aug 2025 17:45:05 +0300
Alexander Kozyrev <akozyrev@nvidia.com> wrote:
> Current implementation requires specifying the pointer to the table
> you want to jump to in the jump to matcher action. It is inconvenient
> since there is no table pointer shown anywhere in the table management.
> Table creation/destruction uses the standard table ID for that purpose.
> Use the table ID in the jump to matcher action as well.
>
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
The cmdline code doesn't guarantee that the space in the
context will be aligned. Therefore using memcpy like this
(untested) would be safer. Please review this as possiblity
and resubmit if needed.
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 5d9c8f04f2..04d3dbbdca 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -11221,7 +11221,7 @@ parse_jump_table_id(struct context *ctx, const struct token *token,
return len;
/* Get the parsed table ID from where parse_int stored it */
entry_ptr = (uint8_t *)ctx->object + arg->offset;
- table_id = *(uint32_t *)entry_ptr;
+ memcpy(&table_id, entry_ptr, sizeof(uint32_t));
/* Look up the table using table ID */
port = &ports[ctx->port];
for (pt = port->table_list; pt != NULL; pt = pt->next) {
@@ -11233,7 +11233,7 @@ parse_jump_table_id(struct context *ctx, const struct token *token,
return -1;
}
/* Replace the table ID with the table pointer */
- *(struct rte_flow_template_table **)entry_ptr = pt->table;
+ memcpy(entry_ptr, &pt->table, sizeof(struct rte_flow_template_table *));
return len;
}
next prev parent reply other threads:[~2025-09-25 19:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 14:45 Alexander Kozyrev
2025-08-19 14:50 ` Bing Zhao
2025-09-15 18:05 ` Stephen Hemminger
2025-09-25 19:37 ` Stephen Hemminger [this message]
2025-09-26 12:30 ` [PATCH v2] " Alexander Kozyrev
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=20250925123759.5ac936d9@hermes.local \
--to=stephen@networkplumber.org \
--cc=akozyrev@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=stable@dpdk.org \
/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).