X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_core%2Ftf_em_common.h;h=7f215adef2752c823cd4807cad1549ee902080a5;hb=83680d371592fcf1b66cbbfecb0fb8b3aa4ccc8d;hp=f71a487675f5f2e65be62c4abaf0eab0d627e454;hpb=a222e22be7cd04025dd7f8da8fba1c8c06c0c650;p=dpdk.git diff --git a/drivers/net/bnxt/tf_core/tf_em_common.h b/drivers/net/bnxt/tf_core/tf_em_common.h index f71a487675..7f215adef2 100644 --- a/drivers/net/bnxt/tf_core/tf_em_common.h +++ b/drivers/net/bnxt/tf_core/tf_em_common.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2019-2020 Broadcom + * Copyright(c) 2019-2021 Broadcom * All rights reserved. */ @@ -8,6 +8,7 @@ #include "tf_core.h" #include "tf_session.h" +#include "ll.h" /** * Function to search for table scope control block structure @@ -23,30 +24,51 @@ struct tf_tbl_scope_cb *tbl_scope_cb_find(uint32_t tbl_scope_id); /** - * Table Scope Allocate - * - * Allocate a table scope - * - * [in/out] pointer to tbl_scope_id - * - * Returns: - * 0 - success - * -EINVAL - error + * Table scope control block content */ -int tf_tbl_scope_alloc(uint32_t *tbl_scope_id); +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; +}; /** - * Table Scope Free - * - * Free a table scope + * EEM data * - * [in] tbl_scope_id to free + * Link list of ext em data allocated and managed by EEM module + * for a TruFlow session. + */ +struct em_ext_db { + struct ll tbl_scope_ll; + struct rm_db *eem_db[TF_DIR_MAX]; +}; + +/** + * Table Scope Control Block * - * Returns: - * 0 - success - * -EINVAL - error + * Holds private data for a table scope. */ -int tf_tbl_scope_free(uint32_t tbl_scope_id); +struct tf_tbl_scope_cb { + /** + * Linked list of tbl_scope + */ + struct ll_entry ll_entry; /* For inserting in link list, must be + * first field of struct. + */ + + uint32_t tbl_scope_id; + + /** The pf or parent pf of the vf used for table scope creation + */ + uint16_t pf; + 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]; +}; /** * Create and initialize a stack to use for action entries @@ -156,4 +178,23 @@ int tf_em_validate_num_entries(struct tf_tbl_scope_cb *tbl_scope_cb, int tf_em_size_table(struct hcapi_cfa_em_table *tbl, uint32_t page_size); + +/** + * Look up table scope control block using tbl_scope_id from + * tf_session + * + * [in] tbl_scope_cb + * Pointer to Truflow Handle + * + * [in] tbl_scope_id + * table scope id + * + * Returns: + * - Pointer to the tf_tbl_scope_cb, if found. + * - (NULL) on failure, not found. + */ +struct tf_tbl_scope_cb * +tf_em_ext_common_tbl_scope_find(struct tf *tfp, + uint32_t tbl_scope_id); + #endif /* _TF_EM_COMMON_H_ */