raw/cnxk_bphy: support reading CGX queue count
authorTomasz Duszynski <tduszynski@marvell.com>
Mon, 21 Jun 2021 15:04:28 +0000 (17:04 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 5 Jul 2021 21:07:24 +0000 (23:07 +0200)
Add support for reading number of available queues i.e number
of available logical macs (LMACs).

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
doc/guides/rawdevs/cnxk_bphy.rst
drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c

index 96ab684..d6803e5 100644 (file)
@@ -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()``.
index 016f9f0..da43726 100644 (file)
@@ -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