From patchwork Mon Sep 27 08:22:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kumar Kori X-Patchwork-Id: 99731 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BF368A0547; Mon, 27 Sep 2021 10:24:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 811BE41151; Mon, 27 Sep 2021 10:23:06 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id B3957410DA for ; Mon, 27 Sep 2021 10:23:03 +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 18QLbnwn025340 for ; Mon, 27 Sep 2021 01:23:03 -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=75hqZe7r/tXdI4Ek7VHRU8vBCCavtNaOsHBtSIsTkY4=; b=GEyAZHSo7RuuRIuXje9aPm25802WupCTMEoqJODrI2c/vSIw0FVvAfI5pwPPa7DVCdmz SVASxveEcrc9ZMt4WqIEGK1Do3s92XCPSnQTOqvfxIzfGaZhXA7suZo+FoAQt+ab57me goMx5SQDfF2UFa+BLk7jyZKCAePSmdys0lICIeDyfWlomHELi5jEKWgp5Jc5d7t6vVu6 NyB/uFYJjTolWK7R9Z71lFc+QqnhMnXI3KdmnED1AbE3N4n+MXkOHAczKEMemMVbkDZe bIvzNI8+yO2c+RG9vE2MsX/yfo7ens5B4w8JLxVKUT88cegDPwbYYrARfEhsEPJmxPBk 7w== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 3bavvuhttc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 27 Sep 2021 01:23:03 -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; Mon, 27 Sep 2021 01:23:01 -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; Mon, 27 Sep 2021 01:23:01 -0700 Received: from localhost.localdomain (unknown [10.28.34.25]) by maili.marvell.com (Postfix) with ESMTP id 8DEF53F709E; Mon, 27 Sep 2021 01:22:59 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: Date: Mon, 27 Sep 2021 13:52:10 +0530 Message-ID: <20210927082223.757436-14-skori@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210927082223.757436-1-skori@marvell.com> References: <20210927082223.757436-1-skori@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 0S7L3U9WExGl8xsASmHygMCxbYRn6T6l X-Proofpoint-GUID: 0S7L3U9WExGl8xsASmHygMCxbYRn6T6l X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-27_02,2021-09-24_02,2020-04-07_01 Subject: [dpdk-dev] [PATCH v2 14/27] 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 --- v2: - Rebase support on latest DPDK - Handled multilevel chaining for linear hierarchy - Review comments incorporated drivers/common/cnxk/roc_npc.c | 3 +++ drivers/common/cnxk/roc_npc.h | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c index 52a54b3990..8f88e254b3 100644 --- a/drivers/common/cnxk/roc_npc.c +++ b/drivers/common/cnxk/roc_npc.c @@ -447,6 +447,9 @@ npc_parse_actions(struct npc *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: + 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 4d6f8f8cd9..86365df754 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 17 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 << 16), }; 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. */