* The RM DB will work on its initial allocated sizes so the
* capability of dynamically growing a particular resource is not
* possible. If this capability later becomes a requirement then the
- * MAX pool size of the Chip œneeds to be added to the tf_rm_elem_info
+ * MAX pool size of the chip needs to be added to the tf_rm_elem_info
* structure and several new APIs would need to be added to allow for
* growth of a single TF resource type.
*
- * The access functions does not check for NULL pointers as it's a
+ * The access functions do not check for NULL pointers as they are a
* support module, not called directly.
*/
* No configuration
*/
TF_RM_ELEM_CFG_NULL,
- /** HCAPI 'controlled', no RM storage thus the Device Module
+ /** HCAPI 'controlled', no RM storage so the module
* using the RM can chose to handle storage locally.
*/
TF_RM_ELEM_CFG_HCAPI,
- /** HCAPI 'controlled', uses a Bit Allocator Pool for internal
+ /** HCAPI 'controlled', uses a bit allocator pool for internal
* storage in the RM.
*/
TF_RM_ELEM_CFG_HCAPI_BA,
/**
- * Shared element thus it belongs to a shared FW Session and
- * is not controlled by the Host.
+ * HCAPI 'controlled', uses a bit allocator pool for internal
+ * storage in the RM but multiple TF types map to a single
+ * HCAPI type. Parent manages the table.
*/
- TF_RM_ELEM_CFG_SHARED,
+ TF_RM_ELEM_CFG_HCAPI_BA_PARENT,
+ /**
+ * HCAPI 'controlled', uses a bit allocator pool for internal
+ * storage in the RM but multiple TF types map to a single
+ * HCAPI type. Child accesses the parent db.
+ */
+ TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
+
+
TF_RM_TYPE_MAX
};
* conversion.
*/
uint16_t hcapi_type;
+
+ /**
+ * if cfg_type == TF_RM_ELEM_CFG_HCAPI_BA_CHILD
+ *
+ * Parent Truflow module subtype associated with this resource type.
+ */
+ uint16_t parent_subtype;
+
+ /**
+ * if cfg_type == TF_RM_ELEM_CFG_HCAPI_BA_CHILD
+ *
+ * Resource slices. How many slices will fit in the
+ * resource pool chunk size.
+ */
+ uint8_t slices;
+
+ /**
+ * Pool element divider count
+ * If 0 or 1, there is 1:1 correspondence between the RM
+ * BA pool resource element and the HCAPI RM firmware
+ * resource. If > 1, the RM BA pool element has a 1:n
+ * correspondence to the HCAPI RM firmware resource.
+ */
+ uint8_t divider;
};
/**
*/
struct tf_rm_create_db_parms {
/**
- * [in] Device module type. Used for logging purposes.
+ * [in] Module type. Used for logging purposes.
*/
- enum tf_device_module_type type;
+ enum tf_module_type module;
/**
* [in] Receive or transmit direction.
*/
/**
* Resource allocation count array. This array content
* originates from the tf_session_resources that is passed in
- * on session open.
- * Array size is num_elements.
+ * on session open. Array size is num_elements.
*/
uint16_t *alloc_cnt;
/**
*/
void *rm_db;
/**
- * [in] DB Index, indicates which DB entry to perform the
- * action on.
+ * [in] Module subtype indicates which DB entry to perform the
+ * action on. (e.g. TF_TCAM_TBL_TYPE_L2_CTXT subtype of module
+ * TF_MODULE_TYPE_TCAM)
*/
- uint16_t db_index;
+ uint16_t subtype;
/**
* [in] Pointer to the allocated index in normalized
* form. Normalized means the index has been adjusted,
*/
void *rm_db;
/**
- * [in] DB Index, indicates which DB entry to perform the
- * action on.
+ * [in] TF subtype indicates which DB entry to perform the
+ * action on. (e.g. TF_TCAM_TBL_TYPE_L2_CTXT subtype of module
+ * TF_MODULE_TYPE_TCAM)
*/
- uint16_t db_index;
+ uint16_t subtype;
/**
* [in] Index to free
*/
*/
void *rm_db;
/**
- * [in] DB Index, indicates which DB entry to perform the
- * action on.
+ * [in] TF subtype indicates which DB entry to perform the
+ * action on. (e.g. TF_TCAM_TBL_TYPE_L2_CTXT subtype of module
+ * TF_MODULE_TYPE_TCAM)
*/
- uint16_t db_index;
+ uint16_t subtype;
/**
* [in] Index to free
*/
*/
void *rm_db;
/**
- * [in] DB Index, indicates which DB entry to perform the
- * action on.
+ * [in] TF subtype indicates which DB entry to perform the
+ * action on. (e.g. TF_TCAM_TBL_TYPE_L2_CTXT subtype of module
+ * TF_MODULE_TYPE_TCAM)
*/
- uint16_t db_index;
+ uint16_t subtype;
/**
* [out] Pointer to the requested allocation information for
- * the specified db_index
+ * the specified subtype
*/
struct tf_rm_alloc_info *info;
};
*/
void *rm_db;
/**
- * [in] DB Index, indicates which DB entry to perform the
- * action on.
+ * [in] TF subtype indicates which DB entry to perform the
+ * action on. (e.g. TF_TCAM_TBL_TYPE_L2_CTXT subtype of module
+ * TF_MODULE_TYPE_TCAM)
*/
- uint16_t db_index;
+ uint16_t subtype;
/**
- * [out] Pointer to the hcapi type for the specified db_index
+ * [out] Pointer to the hcapi type for the specified subtype
*/
uint16_t *hcapi_type;
};
*/
void *rm_db;
/**
- * [in] DB Index, indicates which DB entry to perform the
- * action on.
+ * [in] TF subtype indicates which DB entry to perform the
+ * action on. (e.g. TF_TCAM_TBL_TYPE_L2_CTXT subtype of module
+ * TF_MODULE_TYPE_TCAM)
*/
- uint16_t db_index;
+ uint16_t subtype;
/**
- * [out] Pointer to the inuse count for the specified db_index
+ * [out] Pointer to the inuse count for the specified subtype
*/
uint16_t *count;
};
*/
void *rm_db;
/**
- * [in] DB Index, indicates which DB entry to perform the
- * action on.
+ * [in] TF subtype indicates which DB entry to perform the
+ * action on. (e.g. TF_TCAM_TBL_TYPE_L2_CTXT subtype of module
+ * TF_MODULE_TYPE_TCAM)
*/
- uint16_t db_index;
+ uint16_t subtype;
/**
* [in] Starting index
*/
int tf_rm_create_db(struct tf *tfp,
struct tf_rm_create_db_parms *parms);
+/**
+ * Creates and fills a Resource Manager (RM) DB with requested
+ * elements. The DB is indexed per the parms structure. It only retrieve
+ * allocated resource information for a exist session.
+ *
+ * [in] tfp
+ * Pointer to TF handle, used for HCAPI communication
+ *
+ * [in] parms
+ * Pointer to create parameters
+ *
+ * Returns
+ * - (0) if successful.
+ * - (-EINVAL) on failure.
+ */
+int tf_rm_create_db_no_reservation(struct tf *tfp,
+ struct tf_rm_create_db_parms *parms);
+
/**
* Closes the Resource Manager (RM) DB and frees all allocated
* resources per the associated database.
*/
int tf_rm_get_info(struct tf_rm_get_alloc_info_parms *parms);
+/**
+ * Retrieves all elements allocation information from the Resource
+ * Manager (RM) DB.
+ *
+ * [in] parms
+ * Pointer to get info parameters
+ *
+ * [in] size
+ * number of the elements for the specific module
+ *
+ * Returns
+ * - (0) if successful.
+ * - (-EINVAL) on failure.
+ */
+int tf_rm_get_all_info(struct tf_rm_get_alloc_info_parms *parms, int size);
+
/**
* Performs a lookup in the Resource Manager DB and retrieves the
* requested HCAPI RM type.