From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 25136A0C47; Tue, 12 Oct 2021 09:07:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD23141165; Tue, 12 Oct 2021 09:06:56 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id AF5A741156 for ; Tue, 12 Oct 2021 09:06:54 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19C4UR8I023876 for ; Tue, 12 Oct 2021 00:06:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=nKVq7YWJd5o/aSfazuhEck0j3QOgkxhFEui+PNnIze4=; b=FzX7XkHuaucSjWGSZ7O85EfM7NP/XHbmd4vnrcO3dBmbpehSDRGjFU4n19vs5p/VruOP vzTZhTnW0sCaS3VWr/rLl4nf7sfk9x5b4EJzICCoMAy4SLYxfu8ev8iAm+BCd4sCRUSh 8EkWwaNPy/6B7FKc3xTR/648fY8+TpdQZoVm9xRa5S8LK42dW2/X2UAxxsyqpSUXGqY6 33WftsOsK4hKcV8OdNULPc/rLDt7x1wvJKHoyObd9g8hi57lo9OIa3mqmDpJjrG9OAwK ixQ2RooiKB4uUggFksgBmjb1BUaJHUxYB+1oy6Xr+U1trypL30kibZaarkNZtbzG8LmP MQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3bn3d58jr0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 12 Oct 2021 00:06:53 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 12 Oct 2021 00:06:52 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Tue, 12 Oct 2021 00:06:52 -0700 Received: from localhost.localdomain (unknown [10.28.34.25]) by maili.marvell.com (Postfix) with ESMTP id 97BD23F7083; Tue, 12 Oct 2021 00:06:50 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Rakesh Kudurumalla Date: Tue, 12 Oct 2021 12:35:59 +0530 Message-ID: <20211012070612.352164-16-skori@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211012070612.352164-1-skori@marvell.com> References: <20211011155057.302142-2-skori@marvell.com> <20211012070612.352164-1-skori@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: GGGnxfkyMvACdcclsR82Rpsl4HcBC7WR X-Proofpoint-GUID: GGGnxfkyMvACdcclsR82Rpsl4HcBC7WR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-12_01,2021-10-11_01,2020-04-07_01 Subject: [dpdk-dev] [PATCH v5 15/28] net/cnxk: support meter ops get API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Sunil Kumar Kori To enable support for ingress meter, supported operations are exposed for CNXK platform. Signed-off-by: Sunil Kumar Kori Signed-off-by: Rakesh Kudurumalla --- v5: - Fix checkpatch errors - Fix patch apply errors 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 + +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