* [PATCH] bus/dpaa: defer bus initialization to probe
@ 2026-08-27 7:28 Prashant Gupta
2026-08-27 8:54 ` David Marchand
0 siblings, 1 reply; 3+ messages in thread
From: Prashant Gupta @ 2026-08-27 7:28 UTC (permalink / raw)
To: stephen, david.marchand, hemant.agrawal, dev
In the DPAA bus initialization: it builds the
device list, loads the QMAN/BMAN drivers, registers the platform mbuf
pool ops and populates the PA to VA translation table. All of it needs
the DPDK heap or a memzone for multi process scenarios.
get_iommu_class() for this bus only checks two sysfs paths, so the
initialization is not needed in scan to report the IOVA mode. Move it
back to probe.
Fixes: cdefd2e980bd ("drivers/bus: initialize NXP bus specifics in scan")
Signed-off-by: Prashant Gupta <prashant.gupta_3@nxp.com>
---
drivers/bus/dpaa/dpaa_bus.c | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 62dcc79534..85f6957466 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -740,10 +740,8 @@ static int rte_dpaa_setup_intr(struct rte_intr_handle *intr_handle)
static int
rte_dpaa_bus_scan(void)
{
- struct rte_dpaa_device *dev;
FILE *svr_file = NULL;
uint32_t svr_ver;
- static int process_once;
char *penv;
int ret;
@@ -806,9 +804,29 @@ rte_dpaa_bus_scan(void)
dpaa_bus.max_push_rxq_num = DPAA_MAX_PUSH_MODE_QUEUE;
}
+ return 0;
+}
+
+/* Bus initialization needs the DPDK heap and a memzone, which EAL only sets
+ * up after the bus scan, so it is done here.
+ */
+static int
+rte_dpaa_bus_probe(struct rte_bus *bus)
+{
+ static int process_once;
+ struct rte_dpaa_device *dev;
+ int ret;
+
+ if (!dpaa_bus.detected)
+ return 0;
+
/* Device list creation is only done once */
if (!process_once) {
- rte_dpaa_bus_dev_build();
+ ret = rte_dpaa_bus_dev_build();
+ if (ret) {
+ DPAA_BUS_ERR("Unable to build device list. (%d)", ret);
+ return ret;
+ }
/* One time load of Qman/Bman drivers */
ret = qman_global_init();
if (ret) {
@@ -822,8 +840,8 @@ rte_dpaa_bus_scan(void)
ret);
return ret;
}
+ process_once = 1;
}
- process_once = 1;
/* If no device present on DPAA bus nothing needs to be done */
if (TAILQ_EMPTY(&rte_dpaa_bus.device_list))
@@ -846,7 +864,8 @@ rte_dpaa_bus_scan(void)
dpaax_iova_table_populate();
dpaa_bus_global_init = 1;
- return 0;
+
+ return rte_bus_generic_probe(bus);
}
/*
@@ -928,7 +947,7 @@ RTE_FINI_PRIO(dpaa_cleanup, 102)
static struct rte_bus rte_dpaa_bus = {
.scan = rte_dpaa_bus_scan,
- .probe = rte_bus_generic_probe,
+ .probe = rte_dpaa_bus_probe,
.parse = rte_dpaa_bus_parse,
.dev_compare = dpaa_bus_dev_compare,
.find_device = rte_bus_generic_find_device,
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] bus/dpaa: defer bus initialization to probe
2026-08-27 7:28 [PATCH] bus/dpaa: defer bus initialization to probe Prashant Gupta
@ 2026-08-27 8:54 ` David Marchand
2026-08-27 16:02 ` Hemant Agrawal
0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2026-08-27 8:54 UTC (permalink / raw)
To: Prashant Gupta; +Cc: stephen, hemant.agrawal, dev
Hello,
On Thu, 27 Aug 2026 at 09:37, Prashant Gupta <prashant.gupta_3@nxp.com> wrote:
>
> In the DPAA bus initialization: it builds the
> device list, loads the QMAN/BMAN drivers, registers the platform mbuf
> pool ops and populates the PA to VA translation table. All of it needs
> the DPDK heap or a memzone for multi process scenarios.
>
> get_iommu_class() for this bus only checks two sysfs paths, so the
> initialization is not needed in scan to report the IOVA mode. Move it
> back to probe.
>
> Fixes: cdefd2e980bd ("drivers/bus: initialize NXP bus specifics in scan")
>
> Signed-off-by: Prashant Gupta <prashant.gupta_3@nxp.com>
While the change looks correct, I don't understand what is being fixed.
Could you elaborate on the issue?
--
David Marchand
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] bus/dpaa: defer bus initialization to probe
2026-08-27 8:54 ` David Marchand
@ 2026-08-27 16:02 ` Hemant Agrawal
0 siblings, 0 replies; 3+ messages in thread
From: Hemant Agrawal @ 2026-08-27 16:02 UTC (permalink / raw)
To: David Marchand, Prashant Gupta; +Cc: stephen, hemant.agrawal, dev
On 27-08-2026 14:24, David Marchand wrote:
> Hello,
>
> On Thu, 27 Aug 2026 at 09:37, Prashant Gupta <prashant.gupta_3@nxp.com> wrote:
>> In the DPAA bus initialization: it builds the
>> device list, loads the QMAN/BMAN drivers, registers the platform mbuf
>> pool ops and populates the PA to VA translation table. All of it needs
>> the DPDK heap or a memzone for multi process scenarios.
>>
>> get_iommu_class() for this bus only checks two sysfs paths, so the
>> initialization is not needed in scan to report the IOVA mode. Move it
>> back to probe.
>>
>> Fixes: cdefd2e980bd ("drivers/bus: initialize NXP bus specifics in scan")
>>
>> Signed-off-by: Prashant Gupta <prashant.gupta_3@nxp.com>
> While the change looks correct, I don't understand what is being fixed.
> Could you elaborate on the issue?
>
In my brief discussion about this issue, I was told that some of the
these QMAN/BMAN related initialization should be done using
shared/Hugepage memory for multi-process sharing;
Hugepages are not available during scan, they become available later.
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-27 16:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 7:28 [PATCH] bus/dpaa: defer bus initialization to probe Prashant Gupta
2026-08-27 8:54 ` David Marchand
2026-08-27 16:02 ` Hemant Agrawal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox