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 815B2A034F; Mon, 11 Oct 2021 17:52:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0F854114A; Mon, 11 Oct 2021 17:51:40 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 9E9F4410DA for ; Mon, 11 Oct 2021 17:51:37 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19BEHaHh030538 for ; Mon, 11 Oct 2021 08:51:37 -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=ox+PhAFWGfOuKw5Hk5ooBKl/E/BwA60hl93paAHvaoY=; b=fLcPCUL2/+qk6qLrv3LuFLXpPUcAF/GppeizYttCDYBfcevflBJcvc+CFNClajoliGfs 0xNh+o8nFsjL02DKBS0IHBTdBCGKF0FenJ3lGoZLOSeGE1CZkNqIFo4d44hCXKs5tVMq Z7+pNTDk1WtqBy/NWN751DxGm2ova4ZwnjIFnuUOYboUiwTiladxV054CQsGFj6rlTHE 5b4XAZfvigVwoZfewG6uF2Es13zRnbr0NCELVGXp19u8Y2RPXZwMfQnwKsojESAn4L3r lp4QjpVvWiSultndHMOEMjTFxlHMzKa4+Waazfsp2GaCinodBNCuz7hhd1KgsmPYH7ma BQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 3bmpv4rc30-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 11 Oct 2021 08:51:36 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 11 Oct 2021 08:51:35 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 11 Oct 2021 08:51:34 -0700 Received: from localhost.localdomain (unknown [10.28.34.25]) by maili.marvell.com (Postfix) with ESMTP id 5575F3F705B; Mon, 11 Oct 2021 08:51:33 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: Date: Mon, 11 Oct 2021 21:20:42 +0530 Message-ID: <20211011155057.302142-15-skori@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211011155057.302142-1-skori@marvell.com> References: <20210930090844.1059326-1-skori@marvell.com> <20211011155057.302142-1-skori@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 7UIHX0ckxAdCqFUSw_xaCnRWYDI0lj2c X-Proofpoint-GUID: 7UIHX0ckxAdCqFUSw_xaCnRWYDI0lj2c 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-11_05,2021-10-11_01,2020-04-07_01 Subject: [dpdk-dev] [PATCH v4 14/28] common/cnxk: support meter in action list 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 Meter action is added in supported action list. Signed-off-by: Sunil Kumar Kori --- 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/common/cnxk/roc_npc.c | 7 +++++++ drivers/common/cnxk/roc_npc.h | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c index b724ff9401..5a78d9652c 100644 --- a/drivers/common/cnxk/roc_npc.c +++ b/drivers/common/cnxk/roc_npc.c @@ -348,6 +348,7 @@ npc_parse_actions(struct roc_npc *roc_npc, const struct roc_npc_attr *attr, { struct npc *npc = roc_npc_to_npc_priv(roc_npc); const struct roc_npc_action_mark *act_mark; + const struct roc_npc_action_meter *act_mtr; const struct roc_npc_action_queue *act_q; const struct roc_npc_action_vf *vf_act; bool vlan_insert_action = false; @@ -451,6 +452,12 @@ npc_parse_actions(struct roc_npc *roc_npc, const struct roc_npc_attr *attr, case ROC_NPC_ACTION_TYPE_VLAN_PCP_INSERT: req_act |= ROC_NPC_ACTION_TYPE_VLAN_PCP_INSERT; break; + case ROC_NPC_ACTION_TYPE_METER: + act_mtr = (const struct roc_npc_action_meter *) + actions->conf; + flow->mtr_id = act_mtr->mtr_id; + req_act |= ROC_NPC_ACTION_TYPE_METER; + break; default: errcode = NPC_ERR_ACTION_NOTSUP; goto err_exit; diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h index 65d4bd6edc..10d1ac82a4 100644 --- a/drivers/common/cnxk/roc_npc.h +++ b/drivers/common/cnxk/roc_npc.h @@ -58,7 +58,7 @@ struct roc_npc_flow_item_raw { const uint8_t *pattern; /**< Byte string to look for. */ }; -#define ROC_NPC_MAX_ACTION_COUNT 12 +#define ROC_NPC_MAX_ACTION_COUNT 19 enum roc_npc_action_type { ROC_NPC_ACTION_TYPE_END = (1 << 0), @@ -77,6 +77,7 @@ enum roc_npc_action_type { ROC_NPC_ACTION_TYPE_VLAN_INSERT = (1 << 13), ROC_NPC_ACTION_TYPE_VLAN_ETHTYPE_INSERT = (1 << 14), ROC_NPC_ACTION_TYPE_VLAN_PCP_INSERT = (1 << 15), + ROC_NPC_ACTION_TYPE_METER = (1 << 17), }; struct roc_npc_action { @@ -110,6 +111,10 @@ struct roc_npc_action_of_set_vlan_pcp { uint8_t vlan_pcp; /**< VLAN priority. */ }; +struct roc_npc_action_meter { + uint32_t mtr_id; /**< Meter id to be applied. > */ +}; + struct roc_npc_attr { uint32_t priority; /**< Rule priority level within group. */ uint32_t ingress : 1; /**< Rule applies to ingress traffic. */ @@ -128,6 +133,7 @@ struct roc_npc_flow { uint32_t mcam_id; int32_t ctr_id; uint32_t priority; + uint32_t mtr_id; #define ROC_NPC_MAX_MCAM_WIDTH_DWORDS 7 /* Contiguous match string */ uint64_t mcam_data[ROC_NPC_MAX_MCAM_WIDTH_DWORDS]; -- 2.25.1