From: Sunil Kumar Kori <sk...@marvell.com> To enable support for ingress meter, supported operations are exposed for CNXK platform.
Signed-off-by: Sunil Kumar Kori <sk...@marvell.com> Signed-off-by: Rakesh Kudurumalla <rkuduruma...@marvell.com> --- v4: - Rebase support on dpdk-next-net-mrvl branch - Handled meter action during flow destroy - Handled meter cleanup during port shutdown v3: - Rebase support on latest DPDK - Handled multilevel chaining for tree hierarchy - Fix naming convention v2: - Rebase support on latest DPDK - Handled multilevel chaining for linear hierarchy - Review comments incorporated 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 ec00e620eb..f694abd71d 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -1498,6 +1498,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 ff21b977b7..7a585b9dcf 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 <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; +} 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.25.1