Message ID | 20180731060237.5045-2-kamalheib1@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | RDMA: Fix modify_cq return value | expand |
On Tue, Jul 31, 2018 at 09:02:36AM +0300, Kamal Heib wrote: > The proper return code is "-EOPNOTSUPP" when the modify_cq() callback > is not supported. > > Signed-off-by: Kamal Heib <kamalheib1@gmail.com> > --- > drivers/infiniband/hw/mlx5/cq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Thanks, Acked-by: Leon Romanovsky <leonro@mellanox.com>
On Tue, Jul 31, 2018 at 09:02:36AM +0300, Kamal Heib wrote: > The proper return code is "-EOPNOTSUPP" when the modify_cq() callback > is not supported. > > Signed-off-by: Kamal Heib <kamalheib1@gmail.com> > drivers/infiniband/hw/mlx5/cq.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c > index ad39d64b8108..088205d7f1a1 100644 > +++ b/drivers/infiniband/hw/mlx5/cq.c > @@ -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; I'm going to apply this anyhow, since it is clearly wrong as is.. But what I would prefer to see is for the modify_cq pointer be NULL if the driver's HW/FW will not support modify_cq. This will tie in better with the uapi introspection feature I'm contemplating. Thanks, Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c index ad39d64b8108..088205d7f1a1 100644 --- a/drivers/infiniband/hw/mlx5/cq.c +++ b/drivers/infiniband/hw/mlx5/cq.c @@ -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;
The proper return code is "-EOPNOTSUPP" when the modify_cq() callback is not supported. Signed-off-by: Kamal Heib <kamalheib1@gmail.com> --- drivers/infiniband/hw/mlx5/cq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)