From: Konstantin Ananyev <konstantin.anan...@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: sta...@dpdk.org

Signed-off-by: Konstantin Ananyev <konstantin.anan...@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)
 
                                        l3fwd_acl_send_packets(
                                                qconf,
-                                               pkts_burst,
+                                               acl_search.m_ipv4,
                                                acl_search.res_ipv4,
-                                               nb_rx);
+                                               acl_search.num_ipv4);
                                }
 
                                if (acl_search.num_ipv6) {
@@ -1088,9 +1088,9 @@ acl_main_loop(__rte_unused void *dummy)
 
                                        l3fwd_acl_send_packets(
                                                qconf,
-                                               pkts_burst,
+                                               acl_search.m_ipv6,
                                                acl_search.res_ipv6,
-                                               nb_rx);
+                                               acl_search.num_ipv6);
                                }
                        }
                }
-- 
2.35.3

Reply via email to