X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_ulp%2Fbnxt_ulp.h;h=36405ae1e6cdd859e8dfcf54cd75b1f2b55945f2;hb=6c7cbc8077dd25abd6baf264cd598252ecd9fb3b;hp=4843da56226514eef5935a0deed4891e5217fd3d;hpb=9f702636d7ba895ea31a03751f33429fa900db3d;p=dpdk.git diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.h b/drivers/net/bnxt/tf_ulp/bnxt_ulp.h index 4843da5622..36405ae1e6 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.h +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.h @@ -14,22 +14,50 @@ #include "ulp_template_db_enum.h" +/* NAT defines to reuse existing inner L2 SMAC and DMAC */ +#define BNXT_ULP_NAT_INNER_L2_HEADER_SMAC 0x2000 +#define BNXT_ULP_NAT_OUTER_MOST_L2_HDR_SMAC 0x6000 +#define BNXT_ULP_NAT_OUTER_MOST_L2_VLAN_TAGS 0xc00 +#define BNXT_ULP_NAT_INNER_L2_HEADER_DMAC 0x100 +#define BNXT_ULP_NAT_OUTER_MOST_L2_HDR_DMAC 0x300 +#define BNXT_ULP_NAT_OUTER_MOST_FLAGS (BNXT_ULP_NAT_OUTER_MOST_L2_HDR_SMAC |\ + BNXT_ULP_NAT_OUTER_MOST_L2_VLAN_TAGS |\ + BNXT_ULP_NAT_OUTER_MOST_L2_HDR_DMAC) + +/* defines for the ulp_flags */ +#define BNXT_ULP_VF_REP_ENABLED 0x1 +#define ULP_VF_REP_IS_ENABLED(flag) ((flag) & BNXT_ULP_VF_REP_ENABLED) + +struct bnxt_ulp_df_rule_info { + uint32_t port_to_app_flow_id; + uint32_t app_to_port_flow_id; + uint8_t valid; +}; + +struct bnxt_ulp_vfr_rule_info { + uint32_t rep2vf_flow_id; + uint32_t vf2rep_flow_id; + uint16_t parent_port_id; + uint8_t valid; +}; + struct bnxt_ulp_data { uint32_t tbl_scope_id; struct bnxt_ulp_mark_tbl *mark_tbl; uint32_t dev_id; /* Hardware device id */ uint32_t ref_cnt; struct bnxt_ulp_flow_db *flow_db; + pthread_mutex_t flow_db_lock; void *mapper_data; struct bnxt_ulp_port_db *port_db; - uint32_t port_to_app_flow_id; - uint32_t app_to_port_flow_id; - uint32_t tx_cfa_action; + struct bnxt_ulp_fc_info *fc_info; + uint32_t ulp_flags; + struct bnxt_ulp_df_rule_info df_rule_info[RTE_MAX_ETHPORTS]; + struct bnxt_ulp_vfr_rule_info vfr_rule_info[RTE_MAX_ETHPORTS]; }; struct bnxt_ulp_context { struct bnxt_ulp_data *cfg_data; - /* TBD The tfp should be removed once tf_attach is implemented. */ struct tf *g_tfp; }; @@ -44,7 +72,6 @@ struct bnxt_ulp_session_state { pthread_mutex_t bnxt_ulp_mutex; struct bnxt_ulp_pci_info pci_info; struct bnxt_ulp_data *cfg_data; - /* TBD The tfp should be removed once tf_attach is implemented. */ struct tf *g_tfp; uint32_t session_opened; }; @@ -63,12 +90,9 @@ struct ulp_tlv_param { /* * Allow the deletion of context only for the bnxt device that * created the session - * TBD - The implementation of the function should change to - * using the reference count once tf_session_attach functionality - * is fixed. */ bool -ulp_ctx_deinit_allowed(void *bp); +ulp_ctx_deinit_allowed(struct bnxt_ulp_context *ulp_ctx); /* Function to set the device id of the hardware. */ int32_t @@ -154,4 +178,29 @@ int bnxt_ulp_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, struct rte_flow_error *error); +int32_t +bnxt_ulp_cntxt_ptr2_fc_info_set(struct bnxt_ulp_context *ulp_ctx, + struct bnxt_ulp_fc_info *ulp_fc_info); + +struct bnxt_ulp_fc_info * +bnxt_ulp_cntxt_ptr2_fc_info_get(struct bnxt_ulp_context *ulp_ctx); + +int32_t +bnxt_ulp_cntxt_ptr2_ulp_flags_get(struct bnxt_ulp_context *ulp_ctx, + uint32_t *flags); + +int32_t +bnxt_ulp_get_df_rule_info(uint8_t port_id, struct bnxt_ulp_context *ulp_ctx, + struct bnxt_ulp_df_rule_info *info); + +struct bnxt_ulp_vfr_rule_info* +bnxt_ulp_cntxt_ptr2_ulp_vfr_info_get(struct bnxt_ulp_context *ulp_ctx, + uint32_t port_id); + +int32_t +bnxt_ulp_cntxt_acquire_fdb_lock(struct bnxt_ulp_context *ulp_ctx); + +void +bnxt_ulp_cntxt_release_fdb_lock(struct bnxt_ulp_context *ulp_ctx); + #endif /* _BNXT_ULP_H_ */