ethdev: add namespace
[dpdk.git] / drivers / common / cnxk / roc_npc.h
index bab25fd..e13d557 100644 (file)
@@ -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,8 @@ 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_PORT_ID = (1 << 16),
+       ROC_NPC_ACTION_TYPE_METER = (1 << 17),
 };
 
 struct roc_npc_action {
@@ -94,6 +96,12 @@ struct roc_npc_action_vf {
        uint32_t id;            /**< VF ID. */
 };
 
+struct roc_npc_action_port_id {
+       uint32_t original : 1;  /**< Use original DPDK port ID if possible. */
+       uint32_t reserved : 31; /**< Reserved, must be zero. */
+       uint32_t id;            /**< port ID. */
+};
+
 struct roc_npc_action_queue {
        uint16_t index; /**< Queue index to use. */
 };
@@ -110,6 +118,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 +140,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];
@@ -135,6 +148,7 @@ struct roc_npc_flow {
        uint64_t npc_action;
        uint64_t vtag_action;
        bool vtag_insert_enabled;
+       uint8_t vtag_insert_count;
 #define ROC_NPC_MAX_FLOW_PATTERNS 32
        struct roc_npc_flow_dump_data dump_data[ROC_NPC_MAX_FLOW_PATTERNS];
        uint16_t num_patterns;
@@ -153,7 +167,7 @@ enum roc_npc_rss_hash_function {
 struct roc_npc_action_rss {
        enum roc_npc_rss_hash_function func;
        uint32_t level;
-       uint64_t types;        /**< Specific RSS hash types (see ETH_RSS_*). */
+       uint64_t types;        /**< Specific RSS hash types (see RTE_ETH_RSS_*). */
        uint32_t key_len;      /**< Hash key length in bytes. */
        uint32_t queue_num;    /**< Number of entries in @p queue. */
        const uint8_t *key;    /**< Hash key. */
@@ -215,15 +229,12 @@ int __roc_api roc_npc_flow_parse(struct roc_npc *roc_npc,
                                 const struct roc_npc_action actions[],
                                 struct roc_npc_flow *flow);
 int __roc_api roc_npc_get_low_priority_mcam(struct roc_npc *roc_npc);
-
 int __roc_api roc_npc_mcam_free_counter(struct roc_npc *roc_npc,
                                        uint16_t ctr_id);
-
 int __roc_api roc_npc_mcam_read_counter(struct roc_npc *roc_npc,
                                        uint32_t ctr_id, uint64_t *count);
 int __roc_api roc_npc_mcam_clear_counter(struct roc_npc *roc_npc,
                                         uint32_t ctr_id);
-
 int __roc_api roc_npc_mcam_free_all_resources(struct roc_npc *roc_npc);
 void __roc_api roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc);
 void __roc_api roc_npc_flow_mcam_dump(FILE *file, struct roc_npc *roc_npc,
@@ -234,4 +245,8 @@ int __roc_api roc_npc_mark_actions_sub_return(struct roc_npc *roc_npc,
 int __roc_api roc_npc_vtag_actions_get(struct roc_npc *roc_npc);
 int __roc_api roc_npc_vtag_actions_sub_return(struct roc_npc *roc_npc,
                                              uint32_t count);
+int __roc_api roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc,
+                                                   struct roc_npc_flow *flow);
+int __roc_api roc_npc_validate_portid_action(struct roc_npc *roc_npc_src,
+                                            struct roc_npc *roc_npc_dst);
 #endif /* _ROC_NPC_H_ */