Lines Matching refs:ste

124 u64 mlx5dr_ste_get_icm_addr(struct mlx5dr_ste *ste)
126 u64 base_icm_addr = mlx5dr_icm_pool_get_chunk_icm_addr(ste->htbl->chunk);
127 u32 index = ste - ste->htbl->chunk->ste_arr;
132 u64 mlx5dr_ste_get_mr_addr(struct mlx5dr_ste *ste)
134 u32 index = ste - ste->htbl->chunk->ste_arr;
136 return mlx5dr_icm_pool_get_chunk_mr_addr(ste->htbl->chunk) + DR_STE_SIZE * index;
139 u8 *mlx5dr_ste_get_hw_ste(struct mlx5dr_ste *ste)
141 u64 index = ste - ste->htbl->chunk->ste_arr;
143 return ste->htbl->chunk->hw_ste_arr + DR_STE_SIZE_REDUCED * index;
146 struct list_head *mlx5dr_ste_get_miss_list(struct mlx5dr_ste *ste)
148 u32 index = ste - ste->htbl->chunk->ste_arr;
150 return &ste->htbl->chunk->miss_list[index];
196 /* Free ste which is the head and the only one in miss_list */
199 struct mlx5dr_ste *ste,
210 /* Use temp ste because dr_ste_always_miss_addr
211 * touches bit_mask area which doesn't exist at ste->hw_ste.
214 memcpy(tmp_data_ste, mlx5dr_ste_get_hw_ste(ste), DR_STE_SIZE_REDUCED);
216 memcpy(mlx5dr_ste_get_hw_ste(ste), tmp_data_ste, DR_STE_SIZE_REDUCED);
218 list_del_init(&ste->miss_list_node);
221 mlx5dr_send_fill_and_append_ste_send_info(ste, DR_STE_SIZE,
230 /* Free ste which is the head but NOT the only one in miss_list:
235 struct mlx5dr_ste *ste,
251 /* Move data from next into ste */
252 dr_ste_replace(ste, next_ste);
255 mlx5dr_rule_set_last_member(next_ste->rule_rx_tx, ste, false);
258 memcpy(hw_ste, mlx5dr_ste_get_hw_ste(ste), DR_STE_SIZE_REDUCED);
259 sb_idx = ste->ste_chain_location - 1;
268 mlx5dr_send_fill_and_append_ste_send_info(ste, DR_STE_SIZE,
278 /* Free ste that is located in the middle of the miss list:
282 struct mlx5dr_ste *ste,
290 prev_ste = list_prev_entry(ste, miss_list_node);
294 miss_addr = ste_ctx->get_miss_addr(mlx5dr_ste_get_hw_ste(ste));
302 list_del_init(&ste->miss_list_node);
308 void mlx5dr_ste_free(struct mlx5dr_ste *ste,
321 first_ste = list_first_entry(mlx5dr_ste_get_miss_list(ste),
326 * 1. ste is head:
327 * a. head ste is the only ste in the miss list
328 * b. head ste is not the only ste in the miss-list
329 * 2. ste is not head
331 if (first_ste == ste) { /* Ste is the head */
334 last_ste = list_last_entry(mlx5dr_ste_get_miss_list(ste),
339 next_ste = list_next_entry(ste, miss_list_node);
343 dr_ste_remove_head_ste(ste_ctx, ste,
350 dr_ste_replace_head_ste(nic_matcher, ste,
356 dr_ste_remove_middle_ste(ste_ctx, ste,
365 mlx5dr_send_postsend_ste(dmn, cur_ste_info->ste,
371 mlx5dr_htbl_put(ste->htbl);
400 /* Init one ste as a pattern for ste data array */
413 /* Use temp ste because dr_ste_always_miss_addr/hit_htbl
414 * touches bit_mask area which doesn't exist at ste->hw_ste.
447 struct mlx5dr_ste *ste,
457 if (!mlx5dr_ste_is_last_in_rule(nic_matcher, ste->ste_chain_location)) {
485 ste->next_htbl = next_htbl;
486 next_htbl->pointing_ste = ste;
523 struct mlx5dr_ste *ste = &chunk->ste_arr[i];
525 ste->htbl = htbl;
526 ste->refcount = 0;
527 INIT_LIST_HEAD(&ste->miss_list_node);
779 * not relevant for the last ste in the chain.