* [PATCH] acl: fix the value of the trans table
@ 2025-07-25 10:21 Huichao Cai
2025-07-25 11:03 ` Konstantin Ananyev
0 siblings, 1 reply; 2+ messages in thread
From: Huichao Cai @ 2025-07-25 10:21 UTC (permalink / raw)
To: konstantin.v.ananyev; +Cc: dev
The node_array[RTE_ACL_DFA_SIZE] is assigned to
RTE_ACL_IDLE_NODE and is used as a node of
RTE_ACL_NODE_SINGLE type, but it is currently based
on the implementation of idle arrays with a value of all
0 to point to itself, which is unsafe, if the value of the
idle array is not 0, it will produce undefined behavior,
so it needs to be given node_array[RTE_ACL_DFA_ SIZE]
plus RTE_ACL_QUAD_SINGLE.
Signed-off-by: Huichao Cai <chcchc88@163.com>
---
lib/acl/acl_gen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/acl/acl_gen.c b/lib/acl/acl_gen.c
index 3c53d24056..95c7888162 100644
--- a/lib/acl/acl_gen.c
+++ b/lib/acl/acl_gen.c
@@ -497,7 +497,7 @@ rte_acl_gen(struct rte_acl_ctx *ctx, struct rte_acl_trie *trie,
* highest index, that points to itself)
*/
- node_array[RTE_ACL_DFA_SIZE] = RTE_ACL_IDLE_NODE;
+ node_array[RTE_ACL_DFA_SIZE] = RTE_ACL_QUAD_SINGLE | RTE_ACL_IDLE_NODE;
for (n = 0; n < RTE_ACL_DFA_SIZE; n++)
node_array[n] = no_match;
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] acl: fix the value of the trans table
2025-07-25 10:21 [PATCH] acl: fix the value of the trans table Huichao Cai
@ 2025-07-25 11:03 ` Konstantin Ananyev
0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Ananyev @ 2025-07-25 11:03 UTC (permalink / raw)
To: Huichao Cai, konstantin.v.ananyev; +Cc: dev
Hi
> The node_array[RTE_ACL_DFA_SIZE] is assigned to
> RTE_ACL_IDLE_NODE and is used as a node of
> RTE_ACL_NODE_SINGLE type, but it is currently based
> on the implementation of idle arrays with a value of all
> 0 to point to itself, which is unsafe, if the value of the
> idle array is not 0, it will produce undefined behavior,
> so it needs to be given node_array[RTE_ACL_DFA_ SIZE]
> plus RTE_ACL_QUAD_SINGLE.
Not sure I understand what is the problem you are trying to fix?
Any test-case which can demonstrate the failure?
> Signed-off-by: Huichao Cai <chcchc88@163.com>
> ---
> lib/acl/acl_gen.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/acl/acl_gen.c b/lib/acl/acl_gen.c
> index 3c53d24056..95c7888162 100644
> --- a/lib/acl/acl_gen.c
> +++ b/lib/acl/acl_gen.c
> @@ -497,7 +497,7 @@ rte_acl_gen(struct rte_acl_ctx *ctx, struct rte_acl_trie *trie,
> * highest index, that points to itself)
> */
>
> - node_array[RTE_ACL_DFA_SIZE] = RTE_ACL_IDLE_NODE;
> + node_array[RTE_ACL_DFA_SIZE] = RTE_ACL_QUAD_SINGLE | RTE_ACL_IDLE_NODE;
>
> for (n = 0; n < RTE_ACL_DFA_SIZE; n++)
> node_array[n] = no_match;
> --
> 2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-25 11:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-25 10:21 [PATCH] acl: fix the value of the trans table Huichao Cai
2025-07-25 11:03 ` Konstantin Ananyev
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).