Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26e551c5 authored by Kamal Heib's avatar Kamal Heib Committed by Jason Gunthorpe
Browse files

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: default avatarKamal Heib <kamalheib1@gmail.com>
Acked-by: Leon Romanovsky <leonro@mellanox.com> (for mlx5)
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent dd708e7b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1184,7 +1184,7 @@ int mlx5_ib_modify_cq(struct ib_cq *cq, u16 cq_count, u16 cq_period)
	int err;

	if (!MLX5_CAP_GEN(dev->mdev, cq_moderation))
		return -ENOSYS;
		return -EOPNOTSUPP;

	if (cq_period > MLX5_MAX_CQ_PERIOD)
		return -EINVAL;
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ static int ipoib_set_coalesce(struct net_device *dev,
	ret = rdma_set_cq_moderation(priv->recv_cq,
				     coal->rx_max_coalesced_frames,
				     coal->rx_coalesce_usecs);
	if (ret && ret != -ENOSYS) {
	if (ret && ret != -EOPNOTSUPP) {
		ipoib_warn(priv, "failed modifying CQ (%d)\n", ret);
		return ret;
	}