Skip to content

Commit

Permalink
mlx5: DR, Fix dest-root-table action for NIC TX
Browse files Browse the repository at this point in the history
[ Upstream commit aaf3eea ]

The devx query function does not set the ICM address correctly to tx_icm
for NIC TX table.
The correct logic is: for NIC_RX or NIC_TX, icm_address_0 should be
used, for FDB, icm_address_0 used for RX and icm_address_1 for TX.
As a result when forwarding traffic to a a NIC TX FW FT using
dest-root-table action an incorrect ICM address would be used.

Fixes: 8eac40c ("mlx5: DR, Add query support for FW owned FT")
Signed-off-by: Alex Vesker <[email protected]>
Reviewed-by: Erez Shitrit <[email protected]>
Signed-off-by: Yishai Hadas <[email protected]>
Signed-off-by: Nicolas Morey <[email protected]>
  • Loading branch information
alexvesker authored and nmorey committed Sep 4, 2023
1 parent ceb60e1 commit 8092a6d
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions providers/mlx5/dr_devx.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,27 @@ int dr_devx_query_flow_table(struct mlx5dv_devx_obj *obj, uint32_t type,
return ret;
}

*tx_icm_addr = DEVX_GET64(query_flow_table_out, out,
flow_table_context.sw_owner_icm_root_1);
*rx_icm_addr = DEVX_GET64(query_flow_table_out, out,
flow_table_context.sw_owner_icm_root_0);
switch (type) {
case FS_FT_NIC_TX:
*tx_icm_addr = DEVX_GET64(query_flow_table_out, out,
flow_table_context.sw_owner_icm_root_0);
*rx_icm_addr = 0;
break;
case FS_FT_NIC_RX:
*rx_icm_addr = DEVX_GET64(query_flow_table_out, out,
flow_table_context.sw_owner_icm_root_0);
*tx_icm_addr = 0;
break;
case FS_FT_FDB:
*rx_icm_addr = DEVX_GET64(query_flow_table_out, out,
flow_table_context.sw_owner_icm_root_0);
*tx_icm_addr = DEVX_GET64(query_flow_table_out, out,
flow_table_context.sw_owner_icm_root_1);
break;
default:
errno = EINVAL;
return errno;
}

return 0;
}
Expand Down

0 comments on commit 8092a6d

Please sign in to comment.