net/cnxk: support meter ops get
authorSunil Kumar Kori <skori@marvell.com>
Tue, 12 Oct 2021 07:05:59 +0000 (12:35 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 19 Oct 2021 14:24:34 +0000 (16:24 +0200)
To enable support for ingress meter, supported operations
are exposed for CNXK platform.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/net/cnxk/cnxk_ethdev.c
drivers/net/cnxk/cnxk_ethdev.h
drivers/net/cnxk/cnxk_ethdev_mtr.c [new file with mode: 0644]
drivers/net/cnxk/meson.build

index c94fc50..d2ee39d 100644 (file)
@@ -1488,6 +1488,7 @@ struct eth_dev_ops cnxk_eth_dev_ops = {
        .set_mc_addr_list = cnxk_nix_mc_addr_list_configure,
        .set_queue_rate_limit = cnxk_nix_tm_set_queue_rate_limit,
        .tm_ops_get = cnxk_nix_tm_ops_get,
+       .mtr_ops_get = cnxk_nix_mtr_ops_get,
 };
 
 static int
index 2304af6..4143f5e 100644 (file)
@@ -433,6 +433,9 @@ int cnxk_nix_tm_ops_get(struct rte_eth_dev *eth_dev, void *ops);
 int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
                                     uint16_t queue_idx, uint16_t tx_rate);
 
+/* MTR */
+int cnxk_nix_mtr_ops_get(struct rte_eth_dev *dev, void *ops);
+
 /* RSS */
 uint32_t cnxk_rss_ethdev_to_nix(struct cnxk_eth_dev *dev, uint64_t ethdev_rss,
                                uint8_t rss_level);
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
new file mode 100644 (file)
index 0000000..fdb493a
--- /dev/null
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2021 Marvell.
+ */
+
+#include "cnxk_ethdev.h"
+#include <rte_mtr_driver.h>
+
+const struct rte_mtr_ops nix_mtr_ops = {
+};
+
+int
+cnxk_nix_mtr_ops_get(struct rte_eth_dev *dev, void *ops)
+{
+       RTE_SET_USED(dev);
+
+       *(const void **)ops = &nix_mtr_ops;
+       return 0;
+}
index d86188f..5dac078 100644 (file)
@@ -11,6 +11,7 @@ endif
 sources = files(
         'cnxk_ethdev.c',
         'cnxk_ethdev_devargs.c',
+        'cnxk_ethdev_mtr.c',
         'cnxk_ethdev_ops.c',
         'cnxk_ethdev_sec.c',
         'cnxk_link.c',