/* call the AQ command to create the ACL table with these values */
status = ice_aq_alloc_acl_tbl(hw, &tbl_alloc, NULL);
-
if (status) {
if (LE16_TO_CPU(tbl_alloc.buf.resp_buf.alloc_id) <
ICE_AQC_ALLOC_ID_LESS_THAN_4K)
(tbl->last_entry / ICE_ACL_ENTRY_ALLOC_UNIT);
/* Indicate available entries in the table */
- for (i = first_e; i <= last_e; i++)
- ice_set_bit(i, tbl->avail);
+ ice_bitmap_set(tbl->avail, first_e, last_e - first_e + 1);
INIT_LIST_HEAD(&tbl->scens);
out:
ICE_NONDMA_TO_NONDMA);
}
+/**
+ * ice_bitmap_set - set a number of bits in bitmap from a starting position
+ * @dst: bitmap destination
+ * @pos: first bit position to set
+ * @num_bits: number of bits to set
+ *
+ * This function sets bits in a bitmap from pos to (pos + num_bits) - 1.
+ * Note that this function assumes it is operating on a bitmap declared using
+ * ice_declare_bitmap.
+ */
+static inline void
+ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits)
+{
+ u16 i;
+
+ for (i = pos; i < num_bits; i++)
+ ice_set_bit(i, dst);
+}
+
/**
* ice_cmp_bitmaps - compares two bitmaps.
* @bmp1: the bitmap to compare
struct ice_seg *ice_seg;
struct ice_fv *fv;
- ice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM);
-
if (req_profs == ICE_PROF_ALL) {
- u16 i;
-
- for (i = 0; i < ICE_MAX_NUM_PROFILES; i++)
- ice_set_bit(i, bm);
+ ice_bitmap_set(bm, 0, ICE_MAX_NUM_PROFILES);
return;
}
+ ice_memset(&state, 0, sizeof(state), ICE_NONDMA_MEM);
ice_zero_bitmap(bm, ICE_MAX_NUM_PROFILES);
-
ice_seg = hw->seg;
do {
enum ice_prof_type prof_type;
ice_zero_bitmap(used_idx, ICE_MAX_FV_WORDS);
ice_zero_bitmap(free_idx, ICE_MAX_FV_WORDS);
- for (count = 0; count < ICE_MAX_FV_WORDS; count++)
- ice_set_bit(count, possible_idx);
+ ice_bitmap_set(possible_idx, 0, ICE_MAX_FV_WORDS);
/* For each profile we are going to associate the recipe with, add the
* recipes that are associated with that profile. This will give us