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 A37D643C12 for ; Fri, 1 Mar 2024 18:12:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C7004025C; Fri, 1 Mar 2024 18:12:35 +0100 (CET) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 02166400D5; Fri, 1 Mar 2024 18:12:33 +0100 (CET) Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TmZLM5rR4z6K8pm; Sat, 2 Mar 2024 01:08:43 +0800 (CST) Received: from frapeml500006.china.huawei.com (unknown [7.182.85.219]) by mail.maildlp.com (Postfix) with ESMTPS id 24B1A1408F9; Sat, 2 Mar 2024 01:12:33 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml500006.china.huawei.com (7.182.85.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 1 Mar 2024 18:12:32 +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; Fri, 1 Mar 2024 18:12:32 +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+UmJ2HKp7V5iarEjCB6AgAAWL5A= Date: Fri, 1 Mar 2024 17:12:32 +0000 Message-ID: <8d7c91e9d91446a8b57d9d690e4a7ec3@huawei.com> References: <20240301163931.107036-1-konstantin.v.ananyev@yandex.ru> 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 port > > > > Prioritize security for external emails: Confirm sender and content saf= ety > > 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 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 > > --- > > 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 >=20 > 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 > > + 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