From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
by inbox.dpdk.org (Postfix) with ESMTP id A052B43F69;
Thu, 2 May 2024 16:16:51 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
by mails.dpdk.org (Postfix) with ESMTP id 308B4402B2;
Thu, 2 May 2024 16:16:51 +0200 (CEST)
Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178])
by mails.dpdk.org (Postfix) with ESMTP id A517340299
for ; Thu, 2 May 2024 16:16:49 +0200 (CEST)
Received: by inbox.dpdk.org (Postfix, from userid 33)
id 8842D43F6B; Thu, 2 May 2024 16:16:49 +0200 (CEST)
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/examples Bug 1434] l3fwd: crashes in ACL mode for mixed traffic
Date: Thu, 02 May 2024 14:16:49 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: DPDK
X-Bugzilla-Component: examples
X-Bugzilla-Version: 24.03
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: konstantin.v.ananyev@yandex.ru
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: Normal
X-Bugzilla-Assigned-To: dev@dpdk.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform
op_sys bug_status bug_severity priority component assigned_to reporter
target_milestone
Message-ID:
Content-Type: multipart/alternative; boundary=17146594091.ff8bCc089.3785808
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://bugs.dpdk.org/
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All
MIME-Version: 1.0
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: dev-bounces@dpdk.org
--17146594091.ff8bCc089.3785808
Date: Thu, 2 May 2024 16:16:49 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.dpdk.org/
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All
https://bugs.dpdk.org/show_bug.cgi?id=3D1434
Bug ID: 1434
Summary: l3fwd: crashes in ACL mode for mixed traffic
Product: DPDK
Version: 24.03
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: examples
Assignee: dev@dpdk.org
Reporter: konstantin.v.ananyev@yandex.ru
Target Milestone: ---
When running l3fwd in ACL mode, if we'll have mix of IPv4/IPv6 packets in t=
he
same burst,
It will most likely cause a crash. Something like:
#0 rte_eth_tx_burst (port_id=3D54, queue_id=3D0,
tx_pkts=3D0x4b249c0 , nb_pkts=3D32)
at ../lib/ethdev/rte_ethdev.h:6437
#1 0x0000000000503c0d in send_burst (qconf=3D0x4b20d40 ,
n=3D32, port=3D54) at ../examples/l3fwd/l3fwd.h:129
#2 0x0000000000503ced in send_single_packet (
qconf=3D0x4b20d40 , m=3D0x11fc70ba00, port=3D54)
at ../examples/l3fwd/l3fwd.h:152
#3 0x0000000000504138 in send_packets_single (
qconf=3D0x4b20d40 , pkts=3D0x7ffff2f24070,
hops=3D0x7ffff2f23ab0, nb_tx=3D32) at ../examples/l3fwd/l3fwd_acl_scala=
r.h:77
#4 0x0000000000504286 in l3fwd_acl_send_packets (
qconf=3D0x4b20d40 , pkts=3D0x7ffff2f24070,
res=3D0x7ffff2f23fe8, nb_tx=3D32) at ../examples/l3fwd/l3fwd_acl_scalar=
.h:106
#5 0x0000000000506870 in acl_main_loop (dummy=3D0x0)
#4 0x0000000000504286 in l3fwd_acl_send_packets (
qconf=3D0x4b20d40 , pkts=3D0x7ffff2f24070,
res=3D0x7ffff2f23fe8, nb_tx=3D32) at ../examples/l3fwd/l3fwd_acl_scalar=
.h:106
106 send_packets_single(qconf, pkts, dst_port, nb_tx);
And the array of dst_port[] will contain some junk values:
(gdb) print dst_port
$7 =3D {0 , 65535, 65535, 65535, 65535, 54, 65535, 65535,
65535, 65535, 65535, 65535, 32766, 58445, 65535, 65535, 65535}
And the reason for that is here:
acl_main_loop(__rte_unused void *dummy)
{
...
if (acl_search.num_ipv4) {
rte_acl_classify(
acl_config.acx_ipv4[socketi=
d],
acl_search.data_ipv4,
acl_search.res_ipv4,
acl_search.num_ipv4,
DEFAULT_MAX_CATEGORIES);
l3fwd_acl_send_packets(
qconf,
pkts_burst,
acl_search.res_ipv4,
nb_rx);
...
I.E. we split our burst of packets into 2 arrays - one for ipv4, anoterh for
ipv6 for classify(),
But then we try to send all packets as one burst again, not taking into acc=
ount
that acl_search.res_ipv4[] will be set only for ipv4 packets.
Same story for ipv6.
The fix is straightforward:
--- 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);
}
--=20
You are receiving this mail because:
You are the assignee for the bug.=
--17146594091.ff8bCc089.3785808
Date: Thu, 2 May 2024 16:16:49 +0200
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.dpdk.org/
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All
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. Something like:
#0 rte_eth_tx_burst (port_id=3D54, queue_id=3D0,
tx_pkts=3D0x4b249c0 <lcore_conf+550528>, nb_pkts=3D32)
at ../lib/ethdev/rte_ethdev.h:6437
#1 0x0000000000503c0d in send_burst (qconf=3D0x4b20d40 <lcore_conf+5350=
40>,
n=3D32, port=3D54) at ../examples/l3fwd/l3fwd.h:129
#2 0x0000000000503ced in send_single_packet (
qconf=3D0x4b20d40 <lcore_conf+535040>, m=3D0x11fc70ba00, port=3D5=
4)
at ../examples/l3fwd/l3fwd.h:152
#3 0x0000000000504138 in send_packets_single (
qconf=3D0x4b20d40 <lcore_conf+535040>, pkts=3D0x7ffff2f24070,
hops=3D0x7ffff2f23ab0, nb_tx=3D32) at ../examples/l3fwd/l3fwd_acl_scala=
r.h:77
#4 0x0000000000504286 in l3fwd_acl_send_packets (
qconf=3D0x4b20d40 <lcore_conf+535040>, pkts=3D0x7ffff2f24070,
res=3D0x7ffff2f23fe8, nb_tx=3D32) at ../examples/l3fwd/l3fwd_acl_scalar=
.h:106
#5 0x0000000000506870 in acl_main_loop (dummy=3D0x0)
#4 0x0000000000504286 in l3fwd_acl_send_packets (
qconf=3D0x4b20d40 <lcore_conf+535040>, pkts=3D0x7ffff2f24070,
res=3D0x7ffff2f23fe8, nb_tx=3D32) at ../examples/l3fwd/l3fwd_acl_scalar=
.h:106
106 send_packets_single(qconf, pkts, dst_port, nb_tx);
And the array of dst_port[] will contain some junk values:
(gdb) print dst_port
$7 =3D {0 <repeats 16 times>, 65535, 65535, 65535, 65535, 54, 65535, =
65535,
65535, 65535, 65535, 65535, 32766, 58445, 65535, 65535, 65535}
And the reason for that is here:
acl_main_loop(__rte_unused void *dummy)
{
...
if (acl_search.num_ipv4) {
rte_acl_classify(
acl_config.acx_ipv4[socketi=
d],
acl_search.data_ipv4,
acl_search.res_ipv4,
acl_search.num_ipv4,
DEFAULT_MAX_CATEGORIES);
l3fwd_acl_send_packets(
qconf,
pkts_burst,
acl_search.res_ipv4,
nb_rx);
...
I.E. we split our burst of packets into 2 arrays - one for ipv4, anoterh for
ipv6 for classify(),
But then we try to send all packets as one burst again, not taking into acc=
ount
that acl_search.res_ipv4[] will be set only for ipv4 packets.
Same story for ipv6.
The fix is straightforward:
--- a/examples/l3fwd/l3fwd_acl.c
+++ b/examples/l3fwd/l3fwd_acl.c
@@ -1073,9 +1073,9 @@ acl_main_loop(__rte_unused void *dumm=
y)
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 *dumm=
y)
l3fwd_acl_send_packets(
qconf,
- pkts_burst,
+ acl_search.m_ipv6,
acl_search.res_ipv6,
- nb_rx);
+ acl_search.num_ipv6);
}