From patchwork Fri Mar 1 16:39:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Ananyev X-Patchwork-Id: 137690 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 73BE043C0C; Fri, 1 Mar 2024 17:42:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55865402CD; Fri, 1 Mar 2024 17:42:15 +0100 (CET) Received: from forward101b.mail.yandex.net (forward101b.mail.yandex.net [178.154.239.148]) by mails.dpdk.org (Postfix) with ESMTP id 8BF30402C0; Fri, 1 Mar 2024 17:42:14 +0100 (CET) Received: from mail-nwsmtp-smtp-production-main-31.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-31.sas.yp-c.yandex.net [IPv6:2a02:6b8:c08:de2c:0:640:e39b:0]) by forward101b.mail.yandex.net (Yandex) with ESMTPS id BAFBC60A8B; Fri, 1 Mar 2024 19:42:13 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-31.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id ZfeOElCl80U0-5LbaZL2u; Fri, 01 Mar 2024 19:42:12 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1709311332; bh=PUaKS56CdO1I3nfug2auCypLz3vgvLacc4x4TCxTSh4=; h=Message-Id:Date:Cc:Subject:To:From; b=LMcHwg7OK2MKC0R07KtU3NGbE6MkKBjTCqrzj5EYuDiOcWdKBptVg2fK1nyPeazJ5 m90XgeFkJtTZy4rEQB4S2xZbnxLiNwTVrxjcyCSZnKHFLvx2In94YAqKF0rpwKblsp 2QZVLJUKZZoJHzo4ASxbVAzeujQqLjsjB1wJ9pNE= Authentication-Results: mail-nwsmtp-smtp-production-main-31.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Konstantin Ananyev To: dev@dpdk.org Cc: jerinj@marvell.com, pbhagavatula@marvell.com, Konstantin Ananyev , stable@dpdk.org Subject: [PATCH] examples/l3fwd: fix Rx over not ready port Date: Fri, 1 Mar 2024 16:39:31 +0000 Message-Id: <20240301163931.107036-1-konstantin.v.ananyev@yandex.ru> X-Mailer: git-send-email 2.34.1 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 From: Konstantin Ananyev Running l3fwd in event mode with SW eventdev, service cores can start RX before main thread is finished with PMD installation. to reproduce: ./dpdk-l3fwd --lcores=49,51 -n 6 -a ca:00.0 -s 0x8000000000000 \ --vdev event_sw0 -- \ -L -P -p 1 --mode eventdev --eventq-sched=ordered \ --rule_ipv4=test/l3fwd_lpm_v4_u1.cfg --rule_ipv6=test/l3fwd_lpm_v6_u1.cfg \ --no-numa At init stage user will most likely see the error message like that: ETHDEV: lcore 51 called rx_pkt_burst for not ready port 0 0: ./dpdk-l3fwd (rte_dump_stack+0x1f) [15de723] ... 9: ./dpdk-l3fwd (eal_thread_loop+0x5a2) [15c1324] ... And then all depends how luck/unlucky you are. If there are some actual packet in HW RX queue, then the app will most likely crash, otherwise it might survive. As error message suggests, the problem is that services are started before main thread finished with NIC setup and initialization. The suggested fix moves services startup after NIC setup phase. Bugzilla ID: 1390 Fixes: 8bd537e9c6cf ("examples/l3fwd: add service core setup based on caps") Cc: stable@dpdk.org Signed-off-by: Konstantin Ananyev Signed-off-by: Konstantin Ananyev Acked-by: Pavan Nikhilesh --- examples/l3fwd/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 3bf28aec0c..d4fb5d1971 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -1577,7 +1577,6 @@ main(int argc, char **argv) l3fwd_lkp.main_loop = evt_rsrc->ops.fib_event_loop; else l3fwd_lkp.main_loop = evt_rsrc->ops.lpm_event_loop; - l3fwd_event_service_setup(); } else #endif l3fwd_poll_resource_setup(); @@ -1609,6 +1608,11 @@ main(int argc, char **argv) } } +#ifdef RTE_LIB_EVENTDEV + if (evt_rsrc->enabled) + l3fwd_event_service_setup(); +#endif + printf("\n"); for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {