Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/mlx5: Fix query RoCE port

mlx5_is_roce_enabled returns the devlink RoCE init value, therefore it
should be used only when driver is loaded. Instead we just need to read
the roce_en field.

In addition, rename mlx5_is_roce_enabled to mlx5_is_roce_init_enabled.

Fixes: 7a58779edd75 ("IB/mlx5: Improve query port for representor port")
Link: https://lore.kernel.org/r/20210304124517.1100608-2-leon@kernel.org
Signed-off-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Maor Gottlieb and committed by
Jason Gunthorpe
7852546f 14d05b55

+4 -4
+3 -3
drivers/infiniband/hw/mlx5/main.c
··· 499 499 translate_eth_proto_oper(eth_prot_oper, &props->active_speed, 500 500 &props->active_width, ext); 501 501 502 - if (!dev->is_rep && mlx5_is_roce_enabled(mdev)) { 502 + if (!dev->is_rep && dev->mdev->roce.roce_en) { 503 503 u16 qkey_viol_cntr; 504 504 505 505 props->port_cap_flags |= IB_PORT_CM_SUP; ··· 4174 4174 4175 4175 /* Register only for native ports */ 4176 4176 err = mlx5_add_netdev_notifier(dev, port_num); 4177 - if (err || dev->is_rep || !mlx5_is_roce_enabled(mdev)) 4177 + if (err || dev->is_rep || !mlx5_is_roce_init_enabled(mdev)) 4178 4178 /* 4179 4179 * We don't enable ETH interface for 4180 4180 * 1. IB representors ··· 4711 4711 dev->mdev = mdev; 4712 4712 dev->num_ports = num_ports; 4713 4713 4714 - if (ll == IB_LINK_LAYER_ETHERNET && !mlx5_is_roce_enabled(mdev)) 4714 + if (ll == IB_LINK_LAYER_ETHERNET && !mlx5_is_roce_init_enabled(mdev)) 4715 4715 profile = &raw_eth_profile; 4716 4716 else 4717 4717 profile = &pf_profile;
+1 -1
include/linux/mlx5/driver.h
··· 1226 1226 MLX5_TRIGGERED_CMD_COMP = (u64)1 << 32, 1227 1227 }; 1228 1228 1229 - static inline bool mlx5_is_roce_enabled(struct mlx5_core_dev *dev) 1229 + static inline bool mlx5_is_roce_init_enabled(struct mlx5_core_dev *dev) 1230 1230 { 1231 1231 struct devlink *devlink = priv_to_devlink(dev); 1232 1232 union devlink_param_value val;