[v3,14/27] common/cnxk: support meter in action list

Message ID 20210930090844.1059326-14-skori@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [v3,01/27] common/cnxk: update policer MBOX APIs and HW definitions |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Sunil Kumar Kori Sept. 30, 2021, 9:08 a.m. UTC
  From: Sunil Kumar Kori <skori@marvell.com>

Meter action is added in supported action list.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
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 | 3 +++
 drivers/common/cnxk/roc_npc.h | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
  

Patch

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. */