[1/2] examples/l3fwd: fix crash in ACL mode for mixed traffic

Message ID 20240502152816.65562-2-konstantin.v.ananyev@yandex.ru (mailing list archive)
State New
Delegated to: Thomas Monjalon
Series examples/l3fwd: ACL mode fixups and improvements |


Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Konstantin Ananyev May 2, 2024, 3:28 p.m. UTC
  From: Konstantin Ananyev <konstantin.ananyev@huawei.com>

When running l3fwd in ACL mode, if we'll have mix of IPv4/IPv6 packets in
the same burst, it will most likely cause a crash.
The reason for that is that we split our burst of packets into 2 arrays -
one for ipv4, another for ipv6 for classify().
But then we try to send all packets as one burst again, not taking into account
that acl_search.res_ipv4[] will be set only for ipv4 packets.
Same story for ipv6.
The fix is straightforward: use two already split arrays for TX.

Bugzilla ID: 1434
Fixes: 6de0ea50e9b9 ("examples/l3fwd: merge l3fwd-acl example")
Cc: stable@dpdk.org

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
 examples/l3fwd/l3fwd_acl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


diff --git a/examples/l3fwd/l3fwd_acl.c b/examples/l3fwd/l3fwd_acl.c
index 401692bcec..d9e4ae543f 100644
--- a/examples/l3fwd/l3fwd_acl.c
+++ b/examples/l3fwd/l3fwd_acl.c
@@ -1073,9 +1073,9 @@  acl_main_loop(__rte_unused void *dummy)
-						pkts_burst,
+						acl_search.m_ipv4,
-						nb_rx);
+						acl_search.num_ipv4);
 				if (acl_search.num_ipv6) {
@@ -1088,9 +1088,9 @@  acl_main_loop(__rte_unused void *dummy)
-						pkts_burst,
+						acl_search.m_ipv6,
-						nb_rx);
+						acl_search.num_ipv6);