Skip to content

Commit

Permalink
mlx5: DR, Support new sizes for pre-allocated fixed matcher tables
Browse files Browse the repository at this point in the history
Add larger size options(4096K, 8192K and 16384K) to dr_icm_chunk_size.
This sizes will only be used for pre-allocated fixed matcher tables when
the user will send a hint for the number of rules to be used.
These new sizes will not impact on regular rehash and keep current
limitations for max rehashed size.

Signed-off-by: Hamdan Igbaria <[email protected]>
Signed-off-by: Alex Vesker <[email protected]>
Signed-off-by: Yishai Hadas <[email protected]>
  • Loading branch information
hamdanigbaria authored and Yishai Hadas committed Jul 19, 2023
1 parent 4f1b01a commit 22edb2c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions providers/mlx5/dr_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ static int dr_domain_check_icm_memory_caps(struct mlx5dv_dr_domain *dmn)
max_req_chunks_log = max_req_bytes_log - DR_STE_LOG_SIZE;
dmn->info.max_log_sw_icm_sz =
min_t(uint32_t, DR_CHUNK_SIZE_1024K, max_req_chunks_log);
dmn->info.max_log_sw_icm_rehash_sz = dmn->info.max_log_sw_icm_sz;

if (dmn->info.caps.sw_format_ver >= MLX5_HW_CONNECTX_6DX) {
if (dmn->info.caps.log_modify_pattern_icm_size < DR_CHUNK_SIZE_4K +
Expand Down
3 changes: 2 additions & 1 deletion providers/mlx5/dr_rule.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,8 @@ static struct dr_ste_htbl *dr_rule_rehash(struct mlx5dv_dr_rule *rule,
enum dr_icm_chunk_size new_size;

new_size = dr_icm_next_higher_chunk(cur_htbl->chunk_size);
new_size = min_t(uint32_t, new_size, dmn->info.max_log_sw_icm_sz);
new_size = min_t(uint32_t, new_size,
dmn->info.max_log_sw_icm_rehash_sz);

if (new_size == cur_htbl->chunk_size)
return NULL; /* Skip rehash, we already at the max size */
Expand Down
6 changes: 5 additions & 1 deletion providers/mlx5/mlx5dv_dr.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ enum dr_icm_chunk_size {
DR_CHUNK_SIZE_512K,
DR_CHUNK_SIZE_1024K,
DR_CHUNK_SIZE_2048K,
DR_CHUNK_SIZE_4096K,
DR_CHUNK_SIZE_8192K,
DR_CHUNK_SIZE_16384K,
DR_CHUNK_SIZE_MAX,
};

Expand Down Expand Up @@ -1039,7 +1042,8 @@ struct dr_domain_info {
uint32_t max_log_sw_icm_sz;
uint32_t max_log_action_icm_sz;
uint32_t max_log_modify_hdr_pattern_icm_sz;
uint32_t max_send_size;
uint32_t max_log_sw_icm_rehash_sz;
uint32_t max_send_size;
struct dr_domain_rx_tx rx;
struct dr_domain_rx_tx tx;
struct ibv_device_attr_ex attr;
Expand Down

0 comments on commit 22edb2c

Please sign in to comment.