rte_dpaa_bus_parse() recognises fmX-macY, fmX-ohY, fmX-onicY and
dpaa_sec-N, but not the QDMA devices that dpaa_create_device_list()
creates as "dpaa_qdma-%d". A QDMA name therefore falls through to the
fm%u-mac%u sscanf(), which does not match, so the function returns
-EINVAL.

That makes the documented usage

  -a dpaa_bus:dpaa_qdma-1,dpaa_dma_err_check=1

fail in rte_devargs_parse() with "failed to parse device" and abort EAL
initialization, so no dma/dpaa devarg can be passed at all.

Parse dpaa_qdma-N as well, bounding the index by the number of QDMA
devices the bus creates.

Fixes: a63c6426fdfd ("dma/dpaa: add option for error checks")
Cc: [email protected]

Signed-off-by: Hemant Agrawal <[email protected]>
---
 drivers/bus/dpaa/dpaa_bus.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 368c8eeb98..5442f8f893 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -521,6 +521,11 @@ rte_dpaa_bus_parse(const char *name, void *out)
                                i < 1 || i > 4)
                        return -EINVAL;
                max_name_len = sizeof("dpaa_sec-.") - 1;
+       } else if (strncmp("dpaa_qdma", &name[delta], 9) == 0) {
+               if (sscanf(&name[delta], "dpaa_qdma-%u", &i) != 1 ||
+                               i < 1 || i > RTE_DPAA_QDMA_DEVICES)
+                       return -EINVAL;
+               max_name_len = sizeof("dpaa_qdma-.") - 1;
        } else if (strncmp("oh", &name[dev_delta], 2) == 0) {
                if (sscanf(&name[delta], "fm%u-oh%u", &i, &j) != 2 ||
                                i >= 2 || j >= 16)
-- 
2.25.1

Reply via email to