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 66E0F46058; Fri, 10 Jan 2025 18:54:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 358D14279E; Fri, 10 Jan 2025 18:54:14 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 7AD4D4279D for ; Fri, 10 Jan 2025 18:54:12 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-21649a7bcdcso38523835ad.1 for ; Fri, 10 Jan 2025 09:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1736531651; x=1737136451; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=nG6l21UL1Fc+MchNbtbHJIhA1s8VyMJD8NktZx7+28I=; b=Q9i+CYLwXWRlVUER6hTI6sq8Yokrg9vgPIdcpDPpBY0R5phOgirDVG0L9QPQDETyHn MUbjjaOi/4LPS3xJym9Ad5cC4CXwD+jIO9fQ1eCB+yyNfqP+BS2/4tO7vTeHHKQzyXVB 27xkfc8E0LLjHOn57k+N+9szHIKVXhv9XGtYpfwDotkvWi0YlETUBVBSOgJcWN/O6ChP Ajjf3+34xv6qgO1PMYqn9UdOA2F/Hwn9XyV8BWAWNSPnjCgwFOF2CD/7g4zkjMIZsnow GtaYcYH6HaY1/rdSJPadCFCY4B76nHi2UTsU1S5Xrkwv7qpJ5M4/4dxOFLn9iU8Xl+8M N3RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736531651; x=1737136451; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nG6l21UL1Fc+MchNbtbHJIhA1s8VyMJD8NktZx7+28I=; b=WLm1jqBSdg/7d4H4w+kyeuZXfL26UrOQn03gIwYy5c7iqbifG/KJfLtR2M3Bj8nkqj dIaKr041fcmB98WfRpAXlDmGVpA392ewqIJwwKXXV1ic1jk1Y0lrzkUDOQrfp7qiRcKT w/E+IawM/PCJyDFMMHG36N+vjC5KsIESU3h2kPFKh3GtEgqPSVTKKeNSR8woUcqJzqCS 0JNWeW0NYfuERg1sNlA+CFMcl1idtAR589tVIDMT8/vd0fSKlskXDTZ57o1u5o+0q/2T JkPbQrWkFPezCNqI3DzonqV66EMbICl19x33rUs1TvfspjJ2+GA6gXmUE+khecJjwdof jmCw== X-Gm-Message-State: AOJu0YwGuWVIZLn/bVsFyut4W6qQLJ3+CZEQ3sk1TFydtLbgcNRUjsOX kaAgBaCre9JjGeCUN+7Te9/6F1QhgucmVdRe2v9Y9ewAsv1qxMEqeVQQen/KpnI= X-Gm-Gg: ASbGncvwomQJNg68x9vpp1tDvyLPTAA15yU3V97mzDTi8JvZPKKOhV+97FxIrMBvIcl rZyR/U/N5LyiCynG78NhLU0hng+Bdb0A6MaTJgu0dvwEy33cv4sY+Fa4DWo3wDXIX3Yjzdttu0h xGS7MFk9VaMEbPF4zlMUGtlsOy5EXJIo0p4KTD5iLxNohUxxeCcIALfVs2lf8i6Yspno58gZ1fS o95mRpoplOIhYorW3EDSCpkLxtO42T661Pb4fYFMYPbCfj7Ln+MbXdCZf9rO4EUell+l/A0Ay2j XmE/gJeb7yIUz6k9qrmt8znH+s2GIRc0Ng== X-Google-Smtp-Source: AGHT+IGJ2M24fUJ5D+tbSBGfP/kQLgNSZwyWrWvAZUDvnd8jlAT3cUlrA+IBlHkknBuQEPm8eFMgww== X-Received: by 2002:a17:903:1248:b0:216:282d:c67b with SMTP id d9443c01a7336-21a83fc042dmr168628045ad.35.1736531651472; Fri, 10 Jan 2025 09:54:11 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f22d5fcsm16169965ad.176.2025.01.10.09.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 09:54:11 -0800 (PST) Date: Fri, 10 Jan 2025 09:54:09 -0800 From: Stephen Hemminger To: "lihuisong (C)" Cc: , , , , Somnath Kotur , Ajit Khaparde , Dariusz Sosnowski , Suanming Mou , Matan Azrad , Ori Kam , Viacheslav Ovsiienko , , Subject: Re: [PATCH RESEND v7 2/5] ethdev: fix skip valid port in probing callback Message-ID: <20250110095409.1e381023@hermes.local> In-Reply-To: <9177e30c-bb30-5a1e-cdbd-18050c689376@huawei.com> References: <20220825024425.10534-1-lihuisong@huawei.com> <20240929055241.29268-1-lihuisong@huawei.com> <20240929055241.29268-3-lihuisong@huawei.com> <7319082e-10ff-000e-abdf-e6d0d3a6549e@huawei.com> <9177e30c-bb30-5a1e-cdbd-18050c689376@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Fri, 10 Jan 2025 11:21:26 +0800 "lihuisong (C)" wrote: > Hi Stephen, >=20 > Can you take a look at my below reply and reconsider this patch? >=20 > /Huisong >=20 > =E5=9C=A8 2024/12/10 9:50, lihuisong (C) =E5=86=99=E9=81=93: > > Hi Ferruh, Stephen and Thomas, > > > > Can you take a look at this patch? After all, it is an issue in ethdev= =20 > > layer. > > This also is the fruit we disscussed with Thomas and Ferruh before. > > Please go back to this thread. If we don't need this patch, please let= =20 > > me know. I will drop it from my upstreaming list. > > > > /Huisong > > > > > > =E5=9C=A8 2024/9/29 13:52, Huisong Li =E5=86=99=E9=81=93: =20 > >> The event callback in application may use the macro=20 > >> RTE_ETH_FOREACH_DEV to > >> iterate over all enabled ports to do something(like, verifying the=20 > >> port id > >> validity) when receive a probing event. If the ethdev state of a port = is > >> not RTE_ETH_DEV_UNUSED, this port will be considered as a valid port. > >> > >> However, this state is set to RTE_ETH_DEV_ATTACHED after pushing probi= ng > >> event. It means that probing callback will skip this port. But this > >> assignment can not move to front of probing notification. See > >> commit be8cd210379a ("ethdev: fix port probing notification") > >> > >> So this patch has to add a new state, RTE_ETH_DEV_ALLOCATED. Set the=20 > >> ethdev > >> state to RTE_ETH_DEV_ALLOCATED before pushing probing event and set=20 > >> it to > >> RTE_ETH_DEV_ATTACHED after definitely probed. And this port is valid=20 > >> if its > >> device state is 'ALLOCATED' or 'ATTACHED'. > >> > >> In addition, the new state has to be placed behind 'REMOVED' to avoid= =20 > >> ABI > >> break. Fortunately, this ethdev state is internal and applications=20 > >> can not > >> access it directly. So this patch encapsulates an API,=20 > >> rte_eth_dev_is_used, > >> for ethdev or PMD to call and eliminate concerns about using this state > >> enum value comparison. > >> > >> Fixes: be8cd210379a ("ethdev: fix port probing notification") > >> Cc: stable@dpdk.org > >> > >> Signed-off-by: Huisong Li > >> Acked-by: Chengwen Feng > >> --- > >> =C2=A0 drivers/net/bnxt/bnxt_ethdev.c |=C2=A0 3 ++- > >> =C2=A0 drivers/net/mlx5/mlx5.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 |=C2=A0 2 +- > >> =C2=A0 lib/ethdev/ethdev_driver.c=C2=A0=C2=A0=C2=A0=C2=A0 | 13 +++++++= +++--- > >> =C2=A0 lib/ethdev/ethdev_driver.h=C2=A0=C2=A0=C2=A0=C2=A0 | 12 +++++++= +++++ > >> =C2=A0 lib/ethdev/ethdev_pci.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 |=C2=A0 2 +- > >> =C2=A0 lib/ethdev/rte_class_eth.c=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 2 +- > >> =C2=A0 lib/ethdev/rte_ethdev.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 |=C2=A0 4 ++-- > >> =C2=A0 lib/ethdev/rte_ethdev.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 |=C2=A0 4 +++- > >> =C2=A0 lib/ethdev/version.map=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 |=C2=A0 1 + > >> =C2=A0 9 files changed, 33 insertions(+), 10 deletions(-) > >> > >> diff --git a/drivers/net/bnxt/bnxt_ethdev.c=20 > >> b/drivers/net/bnxt/bnxt_ethdev.c > >> index c6ad764813..7401dcd8b5 100644 > >> --- a/drivers/net/bnxt/bnxt_ethdev.c > >> +++ b/drivers/net/bnxt/bnxt_ethdev.c > >> @@ -6612,7 +6612,8 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev) > >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PMD_DRV_LOG(DEBUG, "Calling Devi= ce uninit\n"); > >> =C2=A0 -=C2=A0=C2=A0=C2=A0 if (eth_dev->state !=3D RTE_ETH_DEV_UNUSED) > >> + > >> +=C2=A0=C2=A0=C2=A0 if (rte_eth_dev_is_used(eth_dev->state)) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bnxt_dev_close_= op(eth_dev); > >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; > >> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c > >> index 8d266b0e64..0df49e1f69 100644 > >> --- a/drivers/net/mlx5/mlx5.c > >> +++ b/drivers/net/mlx5/mlx5.c > >> @@ -3371,7 +3371,7 @@ mlx5_eth_find_next(uint16_t port_id, struct=20 > >> rte_device *odev) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 while (port_id < RTE_MAX_ETHPORTS) { > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct rte_eth_= dev *dev =3D &rte_eth_devices[port_id]; > >> =C2=A0 -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (dev->state !=3D= RTE_ETH_DEV_UNUSED && > >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (rte_eth_dev_is_used(de= v->state) && > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 dev->device && > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 (dev->device =3D=3D odev || > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (dev->device->driver && > >> diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c > >> index c335a25a82..a87dbb00ff 100644 > >> --- a/lib/ethdev/ethdev_driver.c > >> +++ b/lib/ethdev/ethdev_driver.c > >> @@ -55,8 +55,8 @@ eth_dev_find_free_port(void) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < RTE_MAX_ETHPORTS; i++= ) { > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Using shared= name field to find a free port. */ > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (eth_dev_sha= red_data->data[i].name[0] =3D=3D '\0') { > >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RT= E_ASSERT(rte_eth_devices[i].state =3D=3D > >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RTE_ETH_DEV_UNUSED); > >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RT= E_ASSERT(!rte_eth_dev_is_used( > >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rte_eth_devices[i].state)); > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 return i; > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > >> @@ -221,11 +221,18 @@ rte_eth_dev_probing_finish(struct rte_eth_dev=20 > >> *dev) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (rte_eal_process_type() =3D=3D RTE_P= ROC_SECONDARY) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 eth_dev_fp_ops_= setup(rte_eth_fp_ops + dev->data->port_id,=20 > >> dev); > >> =C2=A0 +=C2=A0=C2=A0=C2=A0 dev->state =3D RTE_ETH_DEV_ALLOCATED; > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rte_eth_dev_callback_process(dev, RTE_E= TH_EVENT_NEW, NULL); > >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dev->state =3D RTE_ETH_DEV_ATTAC= HED; > >> =C2=A0 } > >> =C2=A0 +bool rte_eth_dev_is_used(uint16_t dev_state) > >> +{ > >> +=C2=A0=C2=A0=C2=A0 return dev_state =3D=3D RTE_ETH_DEV_ALLOCATED || > >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 dev_state =3D=3D RTE_ETH_D= EV_ATTACHED; > >> +} > >> + > >> =C2=A0 int > >> =C2=A0 rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) > >> =C2=A0 { > >> @@ -243,7 +250,7 @@ rte_eth_dev_release_port(struct rte_eth_dev=20 > >> *eth_dev) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (ret !=3D 0) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret; > >> =C2=A0 -=C2=A0=C2=A0=C2=A0 if (eth_dev->state !=3D RTE_ETH_DEV_UNUSED) > >> +=C2=A0=C2=A0=C2=A0 if (rte_eth_dev_is_used(eth_dev->state)) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rte_eth_dev_cal= lback_process(eth_dev, > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RTE_ETH_EVENT_DESTROY, NULL); > >> =C2=A0 diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_dri= ver.h > >> index abed4784aa..aa35b65848 100644 > >> --- a/lib/ethdev/ethdev_driver.h > >> +++ b/lib/ethdev/ethdev_driver.h > >> @@ -1704,6 +1704,18 @@ int rte_eth_dev_callback_process(struct=20 > >> rte_eth_dev *dev, > >> =C2=A0 __rte_internal > >> =C2=A0 void rte_eth_dev_probing_finish(struct rte_eth_dev *dev); > >> =C2=A0 +/** > >> + * Check if a Ethernet device state is used or not > >> + * > >> + * @param dev_state > >> + *=C2=A0=C2=A0 The state of the Ethernet device > >> + * @return > >> + *=C2=A0=C2=A0 - true if the state of the Ethernet device is allocate= d or=20 > >> attached > >> + *=C2=A0=C2=A0 - false if this state is neither allocated nor attached > >> + */ > >> +__rte_internal > >> +bool rte_eth_dev_is_used(uint16_t dev_state); > >> + > >> =C2=A0 /** > >> =C2=A0=C2=A0 * Create memzone for HW rings. > >> =C2=A0=C2=A0 * malloc can't be used as the physical address is needed. > >> diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h > >> index ec4f731270..05dec6716b 100644 > >> --- a/lib/ethdev/ethdev_pci.h > >> +++ b/lib/ethdev/ethdev_pci.h > >> @@ -179,7 +179,7 @@ rte_eth_dev_pci_generic_remove(struct=20 > >> rte_pci_device *pci_dev, > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * eth device has been released. > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (rte_eal_process_type() =3D=3D RTE_P= ROC_SECONDARY && > >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 eth_dev->state =3D=3D RTE_= ETH_DEV_UNUSED) > >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !rte_eth_dev_is_used(eth_d= ev->state)) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; > >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (dev_uninit) { > >> diff --git a/lib/ethdev/rte_class_eth.c b/lib/ethdev/rte_class_eth.c > >> index b52f1dd9f2..81e70670d9 100644 > >> --- a/lib/ethdev/rte_class_eth.c > >> +++ b/lib/ethdev/rte_class_eth.c > >> @@ -118,7 +118,7 @@ eth_dev_match(const struct rte_eth_dev *edev, > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 const struct rte_kvargs *kvlist =3D arg= ->kvlist; > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int pair; > >> =C2=A0 -=C2=A0=C2=A0=C2=A0 if (edev->state =3D=3D RTE_ETH_DEV_UNUSED) > >> +=C2=A0=C2=A0=C2=A0 if (!rte_eth_dev_is_used(edev->state)) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -1; > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (arg->device !=3D NULL && arg->devic= e !=3D edev->device) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -1; > >> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > >> index a1f7efa913..4dc66abb7b 100644 > >> --- a/lib/ethdev/rte_ethdev.c > >> +++ b/lib/ethdev/rte_ethdev.c > >> @@ -349,7 +349,7 @@ uint16_t > >> =C2=A0 rte_eth_find_next(uint16_t port_id) > >> =C2=A0 { > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 while (port_id < RTE_MAX_ETHPORTS && > >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rt= e_eth_devices[port_id].state =3D=3D RTE_ETH_DEV_UNUSED) > >> + !rte_eth_dev_is_used(rte_eth_devices[port_id].state)) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 port_id++; > >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (port_id >=3D RTE_MAX_ETHPORT= S) > >> @@ -408,7 +408,7 @@ rte_eth_dev_is_valid_port(uint16_t port_id) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int is_valid; > >> =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (port_id >=3D RTE_MAX_ETHPORT= S || > >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (rte_eth_devices[port_id].= state =3D=3D RTE_ETH_DEV_UNUSED)) > >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !rte_eth_dev_is_used(rte_e= th_devices[port_id].state)) > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 is_valid =3D 0; > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 is_valid =3D 1; > >> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > >> index a9f92006da..9cc37e8cde 100644 > >> --- a/lib/ethdev/rte_ethdev.h > >> +++ b/lib/ethdev/rte_ethdev.h > >> @@ -2083,10 +2083,12 @@ typedef uint16_t=20 > >> (*rte_tx_callback_fn)(uint16_t port_id, uint16_t queue, > >> =C2=A0 enum rte_eth_dev_state { > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /** Device is unused before being probe= d. */ > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RTE_ETH_DEV_UNUSED =3D 0, > >> -=C2=A0=C2=A0=C2=A0 /** Device is attached when allocated in probing. = */ > >> +=C2=A0=C2=A0=C2=A0 /** Device is attached when definitely probed. */ > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RTE_ETH_DEV_ATTACHED, > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /** Device is in removed state when plu= g-out is detected. */ > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 RTE_ETH_DEV_REMOVED, > >> +=C2=A0=C2=A0=C2=A0 /** Device is allocated and is set before reportin= g new event. */ > >> +=C2=A0=C2=A0=C2=A0 RTE_ETH_DEV_ALLOCATED, > >> =C2=A0 }; > >> =C2=A0 =C2=A0 struct rte_eth_dev_sriov { > >> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > >> index f63dc32aa2..6ecf1ab89d 100644 > >> --- a/lib/ethdev/version.map > >> +++ b/lib/ethdev/version.map > >> @@ -349,6 +349,7 @@ INTERNAL { > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rte_eth_dev_get_by_name; > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rte_eth_dev_is_rx_hairpin_queue; > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rte_eth_dev_is_tx_hairpin_queue; > >> +=C2=A0=C2=A0=C2=A0 rte_eth_dev_is_used; > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rte_eth_dev_probing_finish; > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rte_eth_dev_release_port; > >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rte_eth_dev_internal_reset; =20 > > . =20 Please resubmit for 25.03 release. But it looks like an API/ABI change since rte_eth_dev_state is visible to applications. A more detailed bug report would also help