RDMA/providers: Fix return value from create_srq callbacks
authorKamal Heib <kamalheib1@gmail.com>
Mon, 30 Jul 2018 18:56:43 +0000 (21:56 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 31 Jul 2018 02:29:45 +0000 (20:29 -0600)
The proper return code is "-EOPNOTSUPP" when the create_srq() callback
is not supported.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c
drivers/infiniband/hw/mthca/mthca_provider.c
drivers/infiniband/sw/rdmavt/srq.c

index 5d955b293c6df402a8e1a4fd6edfe17d527bae87..bbfb86eb2d24204565c78187faa6eb23984f24bf 100644 (file)
@@ -1397,7 +1397,7 @@ struct ib_srq *bnxt_re_create_srq(struct ib_pd *ib_pd,
        }
 
        if (srq_init_attr->srq_type != IB_SRQT_BASIC) {
-               rc = -ENOTSUPP;
+               rc = -EOPNOTSUPP;
                goto exit;
        }
 
index 20febafc1fdd6ccf8257d188b50fab1015e72bdd..0d3473b4596e166646273cfeabceaabaa54c52e1 100644 (file)
@@ -449,7 +449,7 @@ static struct ib_srq *mthca_create_srq(struct ib_pd *pd,
        int err;
 
        if (init_attr->srq_type != IB_SRQT_BASIC)
-               return ERR_PTR(-ENOSYS);
+               return ERR_PTR(-EOPNOTSUPP);
 
        srq = kmalloc(sizeof *srq, GFP_KERNEL);
        if (!srq)
index 3707952b4364120329b375cd6d5e03ad1eec6fc7..78e06fc456c5516f5c5162ee93c97f27ec94aa10 100644 (file)
@@ -82,7 +82,7 @@ struct ib_srq *rvt_create_srq(struct ib_pd *ibpd,
        struct ib_srq *ret;
 
        if (srq_init_attr->srq_type != IB_SRQT_BASIC)
-               return ERR_PTR(-ENOSYS);
+               return ERR_PTR(-EOPNOTSUPP);
 
        if (srq_init_attr->attr.max_sge == 0 ||
            srq_init_attr->attr.max_sge > dev->dparms.props.max_srq_sge ||