Skip to content

Commit 26e551c

Browse files
Kamalheibjgunthorpe
authored andcommitted
RDMA: Fix return code check in rdma_set_cq_moderation
The proper return code is "-EOPNOTSUPP" when the modify_cq() callback is not supported, all drivers should generate this and all users should check for it when detecting not supported functionality. Signed-off-by: Kamal Heib <[email protected]> Acked-by: Leon Romanovsky <[email protected]> (for mlx5) Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent dd708e7 commit 26e551c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/infiniband/hw/mlx5/cq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ int mlx5_ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period)
11841184
int err;
11851185

11861186
if (!MLX5_CAP_GEN(dev->mdev, cq_moderation))
1187-
return -ENOSYS;
1187+
return -EOPNOTSUPP;
11881188

11891189
if (cq_period > MLX5_MAX_CQ_PERIOD)
11901190
return -EINVAL;

drivers/infiniband/ulp/ipoib/ipoib_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static int ipoib_set_coalesce(struct net_device *dev,
102102
ret = rdma_set_cq_moderation(priv->recv_cq,
103103
coal->rx_max_coalesced_frames,
104104
coal->rx_coalesce_usecs);
105-
if (ret && ret != -ENOSYS) {
105+
if (ret && ret != -EOPNOTSUPP) {
106106
ipoib_warn(priv, "failed modifying CQ (%d)\n", ret);
107107
return ret;
108108
}

0 commit comments

Comments
 (0)