net/cnxk: support mempool operations query
authorSunil Kumar Kori <skori@marvell.com>
Wed, 23 Jun 2021 04:46:42 +0000 (10:16 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 29 Jun 2021 23:15:27 +0000 (01:15 +0200)
CN9K and CN10K support platform specific mempool ops.
This patch implements API to validate whether given mempool
ops is supported or not.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
drivers/net/cnxk/cnxk_ethdev.c
drivers/net/cnxk/cnxk_ethdev.h
drivers/net/cnxk/cnxk_ethdev_ops.c

index 1ff3afa..77bbab6 100644 (file)
@@ -1195,6 +1195,7 @@ struct eth_dev_ops cnxk_eth_dev_ops = {
        .get_module_eeprom = cnxk_nix_get_module_eeprom,
        .rx_queue_intr_enable = cnxk_nix_rx_queue_intr_enable,
        .rx_queue_intr_disable = cnxk_nix_rx_queue_intr_disable,
+       .pool_ops_supported = cnxk_nix_pool_ops_supported,
 };
 
 static int
index a01b72a..e6dac95 100644 (file)
@@ -261,6 +261,7 @@ int cnxk_nix_rx_queue_intr_enable(struct rte_eth_dev *eth_dev,
                                  uint16_t rx_queue_id);
 int cnxk_nix_rx_queue_intr_disable(struct rte_eth_dev *eth_dev,
                                   uint16_t rx_queue_id);
+int cnxk_nix_pool_ops_supported(struct rte_eth_dev *eth_dev, const char *pool);
 
 int cnxk_nix_configure(struct rte_eth_dev *eth_dev);
 int cnxk_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,
index 45683dd..7f46551 100644 (file)
@@ -617,3 +617,14 @@ cnxk_nix_rx_queue_intr_disable(struct rte_eth_dev *eth_dev,
        roc_nix_rx_queue_intr_disable(&dev->nix, rx_queue_id);
        return 0;
 }
+
+int
+cnxk_nix_pool_ops_supported(struct rte_eth_dev *eth_dev, const char *pool)
+{
+       RTE_SET_USED(eth_dev);
+
+       if (!strcmp(pool, rte_mbuf_platform_mempool_ops()))
+               return 0;
+
+       return -ENOTSUP;
+}