src/dpdk/drivers/net/bnxt/tf_core/tf_rm.c
static void
tf_rm_count_hcapi_reservations(enum tf_dir dir,
			       enum tf_device_module_type type,
			       struct tf_rm_element_cfg *cfg,
			       uint16_t *reservations,
			       uint16_t count,
			       uint16_t *valid_count)
{
	int i;
	uint16_t cnt = 0;

	for (i = 0; i < count; i++) {
		if ((cfg[i].cfg_type == TF_RM_ELEM_CFG_HCAPI ||
		     cfg[i].cfg_type == TF_RM_ELEM_CFG_HCAPI_BA) &&
		    reservations[i] > 0)
			cnt++;

		/* Only log msg if a type is attempted reserved and
		 * not supported. We ignore EM module as its using a
		 * split configuration array thus it would fail for
		 * this type of check.
		 */
		if (type != TF_DEVICE_MODULE_TYPE_EM &&
		    cfg[i].cfg_type == TF_RM_ELEM_CFG_NULL &&
		    reservations[i] > 0) {
			TFP_DRV_LOG(ERR,
				"%s, %s, %s allocation of %d not supported\n",
				tf_device_module_type_2_str(type),
				tf_dir_2_str(dir),
				tf_device_module_type_subtype_2_str(type, i),
				reservations[i]);
		}
	}

	*valid_count = cnt;
}
/**
 * Adjust an index according to the allocation information.
 *
 * All resources are controlled in a 0 based pool. Some resources, by
 * design, are not 0 based, i.e. Full Action Records (SRAM) thus they
 * need to be adjusted before they are handed out.
 *
 * [in] cfg
 *   Pointer to the DB configuration
 *
 * [in] reservations
 *   Pointer to the allocation values associated with the module
 *
 * [in] count
 *   Number of DB configuration elements
 *
 * [out] valid_count
 *   Number of HCAPI entries with a reservation value greater than 0
 *
 * Returns:
 *     0          - Success
 *   - EOPNOTSUPP - Operation not supported
 */
Adjust an index according to the allocation information.
All resources are controlled in a 0 based pool. Some resources, by
design, are not 0 based, i.e. Full Action Records (SRAM) thus they
need to be adjusted before they are handed out.

[in] cfg
Pointer to the DB configuration

[in] reservations
Pointer to the allocation values associated with the module

[in] count
Number of DB configuration elements

[out] valid_count
Number of HCAPI entries with a reservation value greater than 0

0          - Success
- EOPNOTSUPP - Operation not supported
Adjust an index according to the allocation information . All resources are controlled in a 0 based pool . Some resources by design are not 0 based i . e . Full Action Records ( SRAM ) thus they need to be adjusted before they are handed out . [ in ] cfg Pointer to the DB configuration [ in ] reservations Pointer to the allocation values associated with the module [ in ] count Number of DB configuration elements [ out ] valid_count Number of HCAPI entries with a reservation value greater than 0 0 - Success - EOPNOTSUPP - Operation not supported
static void
tf_rm_count_hcapi_reservations(enum tf_dir dir,
			       enum tf_device_module_type type,
			       struct tf_rm_element_cfg *cfg,
			       uint16_t *reservations,
			       uint16_t count,
			       uint16_t *valid_count)
{
	int i;
	uint16_t cnt = 0;
	for (i = 0; i < count; i++) {
		if ((cfg[i].cfg_type == TF_RM_ELEM_CFG_HCAPI ||
		     cfg[i].cfg_type == TF_RM_ELEM_CFG_HCAPI_BA) &&
		    reservations[i] > 0)
			cnt++;
		if (type != TF_DEVICE_MODULE_TYPE_EM &&
		    cfg[i].cfg_type == TF_RM_ELEM_CFG_NULL &&
		    reservations[i] > 0) {
			TFP_DRV_LOG(ERR,
				"%s, %s, %s allocation of %d not supported\n",
				tf_device_module_type_2_str(type),
				tf_dir_2_str(dir),
				tf_device_module_type_subtype_2_str(type, i),
				reservations[i]);
		}
	}
	*valid_count = cnt;
}
static void tf_rm_count_hcapi_reservations ( enum tf_dir dir , enum tf_device_module_type type , struct tf_rm_element_cfg * cfg , uint16_t * reservations , uint16_t count , uint16_t * valid_count ) { int i ; uint16_t cnt = 0 ; for ( i = 0 ; i < count ; i ++ ) { if ( ( cfg [ i ] . cfg_type == TF_RM_ELEM_CFG_HCAPI || cfg [ i ] . cfg_type == TF_RM_ELEM_CFG_HCAPI_BA ) && reservations [ i ] > 0 ) cnt ++ ; if ( type != TF_DEVICE_MODULE_TYPE_EM && cfg [ i ] . cfg_type == TF_RM_ELEM_CFG_NULL && reservations [ i ] > 0 ) { TFP_DRV_LOG ( ERR , " \n " , tf_device_module_type_2_str ( type ) , tf_dir_2_str ( dir ) , tf_device_module_type_subtype_2_str ( type , i ) , reservations [ i ] ) ; } } * valid_count = cnt ; }
Adjust an index according to the allocation information.
Adjust an index according to the allocation information .
/* Only log msg if a type is attempted reserved and
		 * not supported. We ignore EM module as its using a
		 * split configuration array thus it would fail for
		 * this type of check.
		 */