From a7c236b894a848c7bb9afb773a7e3c13615abaa8 Mon Sep 17 00:00:00 2001 From: Sunil Kumar Kori Date: Tue, 12 Oct 2021 12:35:59 +0530 Subject: [PATCH] net/cnxk: support meter ops get To enable support for ingress meter, supported operations are exposed for CNXK platform. Signed-off-by: Sunil Kumar Kori Signed-off-by: Rakesh Kudurumalla Acked-by: Jerin Jacob --- drivers/net/cnxk/cnxk_ethdev.c | 1 + drivers/net/cnxk/cnxk_ethdev.h | 3 +++ drivers/net/cnxk/cnxk_ethdev_mtr.c | 18 ++++++++++++++++++ drivers/net/cnxk/meson.build | 1 + 4 files changed, 23 insertions(+) create mode 100644 drivers/net/cnxk/cnxk_ethdev_mtr.c diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c index c94fc505fe..d2ee39d7ec 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -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 diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h index 2304af6ffa..4143f5e4de 100644 --- a/drivers/net/cnxk/cnxk_ethdev.h +++ b/drivers/net/cnxk/cnxk_ethdev.h @@ -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 index 0000000000..fdb493a4b9 --- /dev/null +++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2021 Marvell. + */ + +#include "cnxk_ethdev.h" +#include + +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; +} diff --git a/drivers/net/cnxk/meson.build b/drivers/net/cnxk/meson.build index d86188fed7..5dac078b2c 100644 --- a/drivers/net/cnxk/meson.build +++ b/drivers/net/cnxk/meson.build @@ -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', -- 2.20.1