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 4A1BE43B8A for ; Mon, 4 Mar 2024 11:13:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4233840267; Mon, 4 Mar 2024 11:13:04 +0100 (CET) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 1EB5040262; Mon, 4 Mar 2024 11:13:02 +0100 (CET) Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TpDsg0GHbz6JBDm; Mon, 4 Mar 2024 18:08:07 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id 76B5A140B55; Mon, 4 Mar 2024 18:13:00 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 4 Mar 2024 11:13:00 +0100 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.035; Mon, 4 Mar 2024 11:13:00 +0100 From: Konstantin Ananyev To: Pavan Nikhilesh Bhagavatula , Konstantin Ananyev , "dev@dpdk.org" CC: Jerin Jacob , "stable@dpdk.org" Subject: RE: [EXTERNAL] [PATCH] examples/l3fwd: fix Rx over not ready port Thread-Topic: [EXTERNAL] [PATCH] examples/l3fwd: fix Rx over not ready port Thread-Index: AQHaa/d1MrBki8pW+UmJ2HKp7V5iarEjCB6AgAAWL5D///GsAIAEUCsQ Date: Mon, 4 Mar 2024 10:13:00 +0000 Message-ID: References: <20240301163931.107036-1-konstantin.v.ananyev@yandex.ru> <8d7c91e9d91446a8b57d9d690e4a7ec3@huawei.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.206.138.42] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > > > > From: Konstantin Ananyev > > > > Sent: Friday, March 1, 2024 10:10 PM > > > > To: dev@dpdk.org > > > > Cc: Jerin Jacob ; Pavan Nikhilesh Bhagavatula > > > > ; Konstantin Ananyev > > > > ; stable@dpdk.org > > > > Subject: [EXTERNAL] [PATCH] examples/l3fwd: fix Rx over not ready p= ort > > > > > > > > Prioritize security for external emails: Confirm sender and content= safety > > > > before clicking links or opening attachments > > > > > > > > -------------------------------------------------------------------= --- > > > > 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=3D49,51 -n 6 -a ca:00.0 -s 0x8000000000000 \ > > > > --vdev event_sw0 -- \ > > > > -L -P -p 1 --mode eventdev --eventq-sched=3Dordered \ > > > > --rule_ipv4=3Dtest/l3fwd_lpm_v4_u1.cfg -- > > rule_ipv6=3Dtest/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 m= ost > > > > 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 >=20 > Acked-by: Pavan Nikhilesh >=20 > > > > --- > > > > 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 =3D evt_rsrc->ops.fib_event_loop; > > > > else > > > > l3fwd_lkp.main_loop =3D 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 > > > > > > Is the ifdef required? > > > > Well, right now l3fwd_event_service_setup() is defined only when > > RTE_LIB_EVENTDEV is defined, see examples/l3fwd/main.c. > > So, I suppose, yes. > > >=20 > My bad I was looking at wrong DPDK version (22.11). NP, thank you for taking a look. As a FYI, I filled 2 more bugs on a similar subject (l3fwd event mode): https://bugs.dpdk.org/show_bug.cgi?id=3D1393 https://bugs.dpdk.org/show_bug.cgi?id=3D1391 If you have bandwidth to have a look and provide some feedback, would be great.=20 >=20 > > > > > > > + if (evt_rsrc->enabled) > > > > + l3fwd_event_service_setup(); > > > > +#endif > > > > + > > > > printf("\n"); > > > > > > > > for (lcore_id =3D 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { > > > > -- > > > > 2.35.3