X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_core%2Ftf_tbl.h;h=2483718e5d33fd9ea6f53aaa304dad951b345209;hb=f1f6ebc0eaf68a825c6175f5e6a436f7d91660c3;hp=eb560ffa72bceb0d6ce828835d29ddfc1ee970e0;hpb=ced3cded44928094f9d9ec7ee06fede936d53f84;p=dpdk.git diff --git a/drivers/net/bnxt/tf_core/tf_tbl.h b/drivers/net/bnxt/tf_core/tf_tbl.h index eb560ffa72..2483718e5d 100644 --- a/drivers/net/bnxt/tf_core/tf_tbl.h +++ b/drivers/net/bnxt/tf_core/tf_tbl.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2019-2020 Broadcom + * Copyright(c) 2019-2021 Broadcom * All rights reserved. */ @@ -15,35 +15,6 @@ struct tf; * The Table module provides processing of Internal TF table types. */ -/** - * Table scope control block content - */ -struct tf_em_caps { - uint32_t flags; - uint32_t supported; - uint32_t max_entries_supported; - uint16_t key_entry_size; - uint16_t record_entry_size; - uint16_t efc_entry_size; -}; - -/** Invalid table scope id */ -#define TF_TBL_SCOPE_INVALID 0xffffffff - -/** - * Table Scope Control Block - * - * Holds private data for a table scope. Only one instance of a table - * scope with Internal EM is supported. - */ -struct tf_tbl_scope_cb { - uint32_t tbl_scope_id; - int index; - struct hcapi_cfa_em_ctx_mem_info em_ctx_info[TF_DIR_MAX]; - struct tf_em_caps em_caps[TF_DIR_MAX]; - struct stack ext_act_pool[TF_DIR_MAX]; - uint32_t *ext_act_pool_mem[TF_DIR_MAX]; -}; /** * Table configuration parameters @@ -57,14 +28,6 @@ struct tf_tbl_cfg_parms { * Table Type element configuration array */ struct tf_rm_element_cfg *cfg; - /** - * Shadow table type configuration array - */ - struct tf_shadow_tbl_cfg *shadow_cfg; - /** - * Boolean controlling the request shadow copy. - */ - bool shadow_copy; /** * Session resource allocations */ @@ -83,6 +46,10 @@ struct tf_tbl_alloc_parms { * [in] Type of the allocation */ enum tf_tbl_type type; + /** + * [in] Table scope identifier (ignored unless TF_TBL_TYPE_EXT) + */ + uint32_t tbl_scope_id; /** * [out] Idx of allocated entry or found entry (if search_enable) */ @@ -101,57 +68,12 @@ struct tf_tbl_free_parms { * [in] Type of the allocation type */ enum tf_tbl_type type; - /** - * [in] Index to free - */ - uint32_t idx; - /** - * [out] Reference count after free, only valid if session has been - * created with shadow_copy. - */ - uint16_t ref_cnt; -}; - -/** - * Table allocate search parameters - */ -struct tf_tbl_alloc_search_parms { - /** - * [in] Receive or transmit direction - */ - enum tf_dir dir; - /** - * [in] Type of the allocation - */ - enum tf_tbl_type type; /** * [in] Table scope identifier (ignored unless TF_TBL_TYPE_EXT) */ uint32_t tbl_scope_id; /** - * [in] Enable search for matching entry. If the table type is - * internal the shadow copy will be searched before - * alloc. Session must be configured with shadow copy enabled. - */ - uint8_t search_enable; - /** - * [in] Result data to search for (if search_enable) - */ - uint8_t *result; - /** - * [in] Result data size in bytes (if search_enable) - */ - uint16_t result_sz_in_bytes; - /** - * [out] If search_enable, set if matching entry found - */ - uint8_t hit; - /** - * [out] Current ref count after allocation (if search_enable) - */ - uint16_t ref_cnt; - /** - * [out] Idx of allocated entry or found entry (if search_enable) + * [in] Index to free */ uint32_t idx; }; @@ -168,6 +90,10 @@ struct tf_tbl_set_parms { * [in] Type of object to set */ enum tf_tbl_type type; + /** + * [in] Table scope identifier (ignored unless TF_TBL_TYPE_EXT) + */ + uint32_t tbl_scope_id; /** * [in] Entry data */ @@ -242,6 +168,16 @@ struct tf_tbl_get_bulk_parms { uint64_t physical_mem_addr; }; +/** + * Table RM database + * + * Table rm database + * + */ +struct tbl_rm_db { + struct rm_db *tbl_db[TF_DIR_MAX]; +}; + /** * @page tbl Table * @@ -253,8 +189,6 @@ struct tf_tbl_get_bulk_parms { * * @ref tf_tbl_free * - * @ref tf_tbl_alloc_search - * * @ref tf_tbl_set * * @ref tf_tbl_get @@ -311,10 +245,7 @@ int tf_tbl_alloc(struct tf *tfp, struct tf_tbl_alloc_parms *parms); /** - * Free's the requested table type and returns it to the DB. If shadow - * DB is enabled its searched first and if found the element refcount - * is decremented. If refcount goes to 0 then its returned to the - * table type DB. + * Frees the requested table type and returns it to the DB. * * [in] tfp * Pointer to TF handle, used for HCAPI communication @@ -329,25 +260,6 @@ int tf_tbl_alloc(struct tf *tfp, int tf_tbl_free(struct tf *tfp, struct tf_tbl_free_parms *parms); -/** - * Supported if Shadow DB is configured. Searches the Shadow DB for - * any matching element. If found the refcount in the shadow DB is - * updated accordingly. If not found a new element is allocated and - * installed into the shadow DB. - * - * [in] tfp - * Pointer to TF handle, used for HCAPI communication - * - * [in] parms - * Pointer to parameters - * - * Returns - * - (0) if successful. - * - (-EINVAL) on failure. - */ -int tf_tbl_alloc_search(struct tf *tfp, - struct tf_tbl_alloc_search_parms *parms); - /** * Configures the requested element by sending a firmware request which * then installs it into the device internal structures. @@ -399,4 +311,21 @@ int tf_tbl_get(struct tf *tfp, int tf_tbl_bulk_get(struct tf *tfp, struct tf_tbl_get_bulk_parms *parms); +/** + * Retrieves the allocated resource info + * + * [in] tfp + * Pointer to TF handle, used for HCAPI communication + * + * [in] parms + * Pointer to Table resource info parameters + * + * Returns + * - (0) if successful. + * - (-EINVAL) on failure. + */ +int +tf_tbl_get_resc_info(struct tf *tfp, + struct tf_tbl_resource_info *tbl); + #endif /* TF_TBL_TYPE_H */