RDMA/mlx5: Fix AH static rate parsing
[ Upstream commit c534ffda781f44a1c6ac25ef6e0e444da38ca8af ]
Previously static rate wasn't translated according to our PRM but simply
used the 4 lower bytes.
Correctly translate static rate value passed in AH creation attribute
according to our PRM expected values.
In addition change 800GB mapping to zero, which is the PRM
specified value.
Fixes: e126ba97db ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Link: https://patch.msgid.link/18ef4cc5396caf80728341eb74738cd777596f60.1739187089.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
cb96ae783e
commit
40432672eb
@@ -67,7 +67,8 @@ static void create_ib_ah(struct mlx5_ib_dev *dev, struct mlx5_ib_ah *ah,
|
||||
ah->av.tclass = grh->traffic_class;
|
||||
}
|
||||
|
||||
ah->av.stat_rate_sl = (rdma_ah_get_static_rate(ah_attr) << 4);
|
||||
ah->av.stat_rate_sl =
|
||||
(mlx5r_ib_rate(dev, rdma_ah_get_static_rate(ah_attr)) << 4);
|
||||
|
||||
if (ah_attr->type == RDMA_AH_ATTR_TYPE_ROCE) {
|
||||
if (init_attr->xmit_slave)
|
||||
|
||||
@@ -3420,11 +3420,11 @@ static int ib_to_mlx5_rate_map(u8 rate)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ib_rate_to_mlx5(struct mlx5_ib_dev *dev, u8 rate)
|
||||
int mlx5r_ib_rate(struct mlx5_ib_dev *dev, u8 rate)
|
||||
{
|
||||
u32 stat_rate_support;
|
||||
|
||||
if (rate == IB_RATE_PORT_CURRENT)
|
||||
if (rate == IB_RATE_PORT_CURRENT || rate == IB_RATE_800_GBPS)
|
||||
return 0;
|
||||
|
||||
if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_800_GBPS)
|
||||
@@ -3569,7 +3569,7 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
|
||||
sizeof(grh->dgid.raw));
|
||||
}
|
||||
|
||||
err = ib_rate_to_mlx5(dev, rdma_ah_get_static_rate(ah));
|
||||
err = mlx5r_ib_rate(dev, rdma_ah_get_static_rate(ah));
|
||||
if (err < 0)
|
||||
return err;
|
||||
MLX5_SET(ads, path, stat_rate, err);
|
||||
|
||||
@@ -56,4 +56,5 @@ int mlx5_core_xrcd_dealloc(struct mlx5_ib_dev *dev, u32 xrcdn);
|
||||
int mlx5_ib_qp_set_counter(struct ib_qp *qp, struct rdma_counter *counter);
|
||||
int mlx5_ib_qp_event_init(void);
|
||||
void mlx5_ib_qp_event_cleanup(void);
|
||||
int mlx5r_ib_rate(struct mlx5_ib_dev *dev, u8 rate);
|
||||
#endif /* _MLX5_IB_QP_H */
|
||||
|
||||
Reference in New Issue
Block a user