{
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;
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;
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),
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 {
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. */
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];