[dpdk-dev] [PATCH v3 11/32] raw/cnxk_bphy: support for reading queue count
From: Tomasz Duszynski <hidden>
Date: 2021-06-21 15:06:27
Subsystem:
the rest · Maintainer:
Linus Torvalds
Add support for reading number of available queues i.e number of available logical macs (LMACs). Signed-off-by: Tomasz Duszynski <redacted> Signed-off-by: Jakub Palider <redacted> Reviewed-by: Jerin Jacob <redacted> --- doc/guides/rawdevs/cnxk_bphy.rst | 4 ++++ drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 9 +++++++++ 2 files changed, 13 insertions(+)
diff --git a/doc/guides/rawdevs/cnxk_bphy.rst b/doc/guides/rawdevs/cnxk_bphy.rst
index 96ab68435..d6803e527 100644
--- a/doc/guides/rawdevs/cnxk_bphy.rst
+++ b/doc/guides/rawdevs/cnxk_bphy.rst@@ -21,3 +21,7 @@ kernel driver. When querying the status of the devices, they will appear under the category of "Misc (rawdev) devices", i.e. the command ``dpdk-devbind.py --status-dev misc`` can be used to see the state of those devices alone. + +Before performing actual data transfer one needs to first retrieve number of +available queues with ``rte_rawdev_queue_count()`` and capacity of each +using ``rte_rawdev_queue_conf_get()``.
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
index 016f9f02c..da4372642 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c@@ -46,8 +46,17 @@ cnxk_bphy_cgx_queue_def_conf(struct rte_rawdev *dev, uint16_t queue_id, return 0; } +static uint16_t +cnxk_bphy_cgx_queue_count(struct rte_rawdev *dev) +{ + struct cnxk_bphy_cgx *cgx = dev->dev_private; + + return cgx->num_queues; +} + static const struct rte_rawdev_ops cnxk_bphy_cgx_rawdev_ops = { .queue_def_conf = cnxk_bphy_cgx_queue_def_conf, + .queue_count = cnxk_bphy_cgx_queue_count, }; static void
--
2.25.1