common/cnxk: swap ZUC-256 key
[dpdk.git] / drivers / common / cnxk / roc_npc_priv.h
index 712302b..78d6ee8 100644 (file)
 #define NPC_ACTION_MAX_VLAN_PARAMS    3
 #define NPC_ACTION_MAX_VLANS_STRIPPED 2
 
+#define NPC_LTYPE_OFFSET_START 7
+/* LB OFFSET : START + LA (2b flags + 1b ltype) + LB (2b flags) */
+#define NPC_LTYPE_LB_OFFSET (NPC_LTYPE_OFFSET_START + 5)
+#define NPC_LFLAG_LB_OFFSET (NPC_LTYPE_OFFSET_START + 3)
+/* LC OFFSET : START + LA (2b flags + 1b ltype) + LB (2b flags + 1b ltype) + LC
+ * (2b flags)
+ */
+#define NPC_LFLAG_LC_OFFSET (NPC_LTYPE_OFFSET_START + 6)
+#define NPC_LTYPE_LC_OFFSET (NPC_LTYPE_OFFSET_START + 8)
+
 struct npc_action_vtag_info {
        uint16_t vlan_id;
        uint16_t vlan_ethtype;
@@ -176,6 +186,10 @@ struct npc_parse_state {
        uint8_t *mcam_data; /* point to flow->mcam_data + key_len */
        uint8_t *mcam_mask; /* point to flow->mcam_mask + key_len */
        bool is_vf;
+       /* adjust ltype in MCAM to match at least one vlan */
+       bool set_vlan_ltype_mask;
+       bool set_ipv6ext_ltype_mask;
+       bool is_second_pass_rule;
 };
 
 enum npc_kpu_parser_flag {
@@ -360,11 +374,13 @@ struct npc {
        uint32_t keyw[NPC_MAX_INTF];            /* max key + data len bits */
        uint32_t mcam_entries;                  /* mcam entries supported */
        uint16_t channel;                       /* RX Channel number */
+       bool is_sdp_link;
+       uint16_t sdp_channel;
+       uint16_t sdp_channel_mask;
        uint32_t rss_grps;                      /* rss groups supported */
        uint16_t flow_prealloc_size;            /* Pre allocated mcam size */
        uint16_t flow_max_priority;             /* Max priority for flow */
-       uint16_t switch_header_type; /* Suppprted switch header type */
-       uint32_t mark_actions;       /* Number of mark actions */
+       uint16_t switch_header_type; /* Supported switch header type */
        uint32_t vtag_strip_actions; /* vtag insert/strip actions */
        uint16_t pf_func;            /* pf_func of device */
        npc_dxcfg_t prx_dxcfg;       /* intf, lid, lt, extract */
@@ -397,6 +413,7 @@ int npc_mcam_alloc_entries(struct npc *npc, int ref_mcam, int *alloc_entry,
 int npc_mcam_ena_dis_entry(struct npc *npc, struct roc_npc_flow *mcam,
                           bool enable);
 int npc_mcam_write_entry(struct npc *npc, struct roc_npc_flow *mcam);
+int npc_flow_enable_all_entries(struct npc *npc, bool enable);
 int npc_update_parse_state(struct npc_parse_state *pst,
                           struct npc_parse_item_info *info, int lid, int lt,
                           uint8_t flags);
@@ -405,6 +422,8 @@ void npc_get_hw_supp_mask(struct npc_parse_state *pst,
 int npc_parse_item_basic(const struct roc_npc_item_info *item,
                         struct npc_parse_item_info *info);
 int npc_parse_meta_items(struct npc_parse_state *pst);
+int npc_parse_mark_item(struct npc_parse_state *pst);
+int npc_parse_pre_l2(struct npc_parse_state *pst);
 int npc_parse_higig2_hdr(struct npc_parse_state *pst);
 int npc_parse_cpt_hdr(struct npc_parse_state *pst);
 int npc_parse_la(struct npc_parse_state *pst);