src/dpdk/drivers/net/ice/base/ice_acl_ctrl.c
static u16
ice_acl_scen_assign_entry_idx(struct ice_acl_scen *scen,
			      enum ice_acl_entry_prio prio)
{
	u16 first_idx, last_idx, i;
	s8 step;

	if (prio >= ICE_ACL_MAX_PRIO)
		return ICE_ACL_SCEN_ENTRY_INVAL;

	first_idx = scen->first_idx[prio];
	last_idx = scen->last_idx[prio];
	step = first_idx <= last_idx ? 1 : -1;

	for (i = first_idx; i != last_idx + step; i += step)
		if (!ice_test_and_set_bit(i, scen->entry_bitmap))
			return i;

	return ICE_ACL_SCEN_ENTRY_INVAL;
}
/**
 * ice_acl_scen_assign_entry_idx
 * @scen: pointer to the scenario struct
 * @prio: the priority of the flow entry being allocated
 *
 * To find the index of an available entry in scenario
 *
 * Returns ICE_ACL_SCEN_ENTRY_INVAL if fails
 * Returns index on success
 */
ice_acl_scen_assign_entry_idx
@scen: pointer to the scenario struct
@prio: the priority of the flow entry being allocated

To find the index of an available entry in scenario

Returns ICE_ACL_SCEN_ENTRY_INVAL if fails
Returns index on success
ice_acl_scen_assign_entry_idx @scen : pointer to the scenario struct @prio : the priority of the flow entry being allocated To find the index of an available entry in scenario Returns ICE_ACL_SCEN_ENTRY_INVAL if fails Returns index on success
static u16
ice_acl_scen_assign_entry_idx(struct ice_acl_scen *scen,
			      enum ice_acl_entry_prio prio)
{
	u16 first_idx, last_idx, i;
	s8 step;
	if (prio >= ICE_ACL_MAX_PRIO)
		return ICE_ACL_SCEN_ENTRY_INVAL;
	first_idx = scen->first_idx[prio];
	last_idx = scen->last_idx[prio];
	step = first_idx <= last_idx ? 1 : -1;
	for (i = first_idx; i != last_idx + step; i += step)
		if (!ice_test_and_set_bit(i, scen->entry_bitmap))
			return i;
	return ICE_ACL_SCEN_ENTRY_INVAL;
}
static u16 ice_acl_scen_assign_entry_idx ( struct ice_acl_scen * scen , enum ice_acl_entry_prio prio ) { u16 first_idx , last_idx , i ; s8 step ; if ( prio >= ICE_ACL_MAX_PRIO ) return ICE_ACL_SCEN_ENTRY_INVAL ; first_idx = scen -> first_idx [ prio ] ; last_idx = scen -> last_idx [ prio ] ; step = first_idx <= last_idx ? 1 : -1 ; for ( i = first_idx ; i != last_idx + step ; i += step ) if ( ! ice_test_and_set_bit ( i , scen -> entry_bitmap ) ) return i ; return ICE_ACL_SCEN_ENTRY_INVAL ; }
ice_acl_scen_assign_entry_idx
 @scen: pointer to the scenario struct
 @prio: the priority of the flow entry being allocated
ice_acl_scen_assign_entry_idx @scen : pointer to the scenario struct @prio : the priority of the flow entry being allocated