X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fcnxk%2Froc_npc_priv.h;h=78d6ee844d07f33652786e27f2623e81ea12872a;hb=5242d8dbbed7fa78c01e86777a4cbc96f5605372;hp=dcf26c0a2d299d42ee71f7fad3e6991a0d51bfca;hpb=c34ea71b878d7d741acfed7503347e92da0a34f6;p=dpdk.git diff --git a/drivers/common/cnxk/roc_npc_priv.h b/drivers/common/cnxk/roc_npc_priv.h index dcf26c0a2d..78d6ee844d 100644 --- a/drivers/common/cnxk/roc_npc_priv.h +++ b/drivers/common/cnxk/roc_npc_priv.h @@ -5,10 +5,11 @@ #ifndef _ROC_NPC_PRIV_H_ #define _ROC_NPC_PRIV_H_ -#define NPC_IH_LENGTH 8 -#define NPC_TPID_LENGTH 2 -#define NPC_HIGIG2_LENGTH 16 -#define NPC_COUNTER_NONE (-1) +#define NPC_IH_LENGTH 8 +#define NPC_TPID_LENGTH 2 +#define NPC_HIGIG2_LENGTH 16 +#define NPC_MAX_RAW_ITEM_LEN 16 +#define NPC_COUNTER_NONE (-1) #define NPC_RSS_GRPS 8 @@ -45,10 +46,12 @@ #define NPC_MCAM_KEY_X4_WORDS 7 /* Number of 64-bit words */ #define NPC_RVUPF_MAX_9XXX 0x10 /* HRM: RVU_PRIV_CONST */ +#define NPC_RVUPF_MAX_98XX 0x18 /* HRM: RVU_PRIV_CONST */ #define NPC_RVUPF_MAX_10XX 0x20 /* HRM: RVU_PRIV_CONST */ #define NPC_NIXLF_MAX 0x80 /* HRM: NIX_AF_CONST2 */ -#define NPC_MCAME_PER_PF 2 /* DRV: RSVD_MCAM_ENTRIES_PER_PF */ +#define NPC_MCAME_PER_PF 3 /* DRV: RSVD_MCAM_ENTRIES_PER_PF */ #define NPC_MCAME_PER_LF 1 /* DRV: RSVD_MCAM_ENTRIES_PER_NIXLF */ +#define NPC_NIXLF_MAX_98XX (2 * NPC_NIXLF_MAX) /*2 NIXLFs */ #define NPC_MCAME_RESVD_9XXX \ (NPC_NIXLF_MAX * NPC_MCAME_PER_LF + \ (NPC_RVUPF_MAX_9XXX - 1) * NPC_MCAME_PER_PF) @@ -57,6 +60,29 @@ (NPC_NIXLF_MAX * NPC_MCAME_PER_LF + \ (NPC_RVUPF_MAX_10XX - 1) * NPC_MCAME_PER_PF) +#define NPC_MCAME_RESVD_98XX \ + (NPC_NIXLF_MAX_98XX * NPC_MCAME_PER_LF + \ + (NPC_RVUPF_MAX_98XX - 1) * NPC_MCAME_PER_PF) + +#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; + uint8_t vlan_pcp; +}; + enum npc_err_status { NPC_ERR_PARAM = -1024, NPC_ERR_NO_MEM, @@ -160,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 { @@ -328,14 +358,13 @@ struct npc_get_datax_cfg { TAILQ_HEAD(npc_flow_list, roc_npc_flow); -struct npc_mcam_ents_info { - /* Current max & min values of mcam index */ - uint32_t max_id; - uint32_t min_id; - uint32_t free_ent; - uint32_t live_ent; +struct npc_prio_flow_entry { + struct roc_npc_flow *flow; + TAILQ_ENTRY(npc_prio_flow_entry) next; }; +TAILQ_HEAD(npc_prio_flow_list_head, npc_prio_flow_entry); + struct npc { struct mbox *mbox; /* Mbox */ uint32_t keyx_supp_nmask[NPC_MAX_INTF]; /* nibble mask */ @@ -345,31 +374,20 @@ 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 */ npc_fxcfg_t prx_fxcfg; /* Flag extract */ npc_ld_flags_t prx_lfcfg; /* KEX LD_Flags CFG */ - /* mcam entry info per priority level: both free & in-use */ - struct npc_mcam_ents_info *flow_entry_info; - /* Bitmap of free preallocated entries in ascending index & - * descending priority - */ - struct plt_bitmap **free_entries; - /* Bitmap of free preallocated entries in descending index & - * ascending priority - */ - struct plt_bitmap **free_entries_rev; - /* Bitmap of live entries in ascending index & descending priority */ - struct plt_bitmap **live_entries; - /* Bitmap of live entries in descending index & ascending priority */ - struct plt_bitmap **live_entries_rev; - /* Priority bucket wise tail queue of all npc_flow resources */ struct npc_flow_list *flow_list; + struct npc_prio_flow_list_head *prio_flow_list; struct plt_bitmap *rss_grp_entries; }; @@ -395,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); @@ -403,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); @@ -414,13 +435,22 @@ int npc_parse_lf(struct npc_parse_state *pst); int npc_parse_lg(struct npc_parse_state *pst); int npc_parse_lh(struct npc_parse_state *pst); int npc_mcam_fetch_kex_cfg(struct npc *npc); -int npc_check_preallocated_entry_cache(struct mbox *mbox, - struct roc_npc_flow *flow, - struct npc *npc); +int npc_get_free_mcam_entry(struct mbox *mbox, struct roc_npc_flow *flow, + struct npc *npc); +void npc_delete_prio_list_entry(struct npc *npc, struct roc_npc_flow *flow); int npc_flow_free_all_resources(struct npc *npc); const struct roc_npc_item_info * npc_parse_skip_void_and_any_items(const struct roc_npc_item_info *pattern); int npc_program_mcam(struct npc *npc, struct npc_parse_state *pst, bool mcam_alloc); uint64_t npc_get_kex_capability(struct npc *npc); +int npc_rss_free_grp_get(struct npc *npc, uint32_t *grp); +int npc_rss_action_configure(struct roc_npc *roc_npc, + const struct roc_npc_action_rss *rss, + uint8_t *alg_idx, uint32_t *rss_grp, + uint32_t mcam_id); +int npc_rss_action_program(struct roc_npc *roc_npc, + const struct roc_npc_action actions[], + struct roc_npc_flow *flow); +int npc_rss_group_free(struct npc *npc, struct roc_npc_flow *flow); #endif /* _ROC_NPC_PRIV_H_ */