src/dpdk/drivers/net/mvpp2/mrvl_mtr.c
static int
mrvl_reserve_plcr(uint32_t *plcrs)
{
	uint32_t i, num;

	num = PP2_CLS_PLCR_NUM;
	if (num > sizeof(uint32_t) * 8) {
		num = sizeof(uint32_t) * 8;
		MRVL_LOG(WARNING, "Plcrs number was limited to 32.");
	}

	for (i = 0; i < num; i++) {
		uint32_t bit = BIT(i);

		if (!(*plcrs & bit)) {
			*plcrs |= bit;

			return i;
		}
	}

	return -1;
}
/**
 * Reserve a policer bit in a bitmap.
 *
 * @param plcrs Pointer to the policers bitmap.
 * @returns Reserved bit number on success, negative value otherwise.
 */
Reserve a policer bit in a bitmap.
@param plcrs Pointer to the policers bitmap.
@returns Reserved bit number on success, negative value otherwise.
Reserve a policer bit in a bitmap . @param plcrs Pointer to the policers bitmap . @returns Reserved bit number on success negative value otherwise .
static int
mrvl_reserve_plcr(uint32_t *plcrs)
{
	uint32_t i, num;
	num = PP2_CLS_PLCR_NUM;
	if (num > sizeof(uint32_t) * 8) {
		num = sizeof(uint32_t) * 8;
		MRVL_LOG(WARNING, "Plcrs number was limited to 32.");
	}
	for (i = 0; i < num; i++) {
		uint32_t bit = BIT(i);
		if (!(*plcrs & bit)) {
			*plcrs |= bit;
			return i;
		}
	}
	return -1;
}
static int mrvl_reserve_plcr ( uint32_t * plcrs ) { uint32_t i , num ; num = PP2_CLS_PLCR_NUM ; if ( num > sizeof ( uint32_t ) * 8 ) { num = sizeof ( uint32_t ) * 8 ; MRVL_LOG ( WARNING , " " ) ; } for ( i = 0 ; i < num ; i ++ ) { uint32_t bit = BIT ( i ) ; if ( ! ( * plcrs & bit ) ) { * plcrs |= bit ; return i ; } } return -1 ; }
Reserve a policer bit in a bitmap.
Reserve a policer bit in a bitmap .