Message ID | 20180730185644.14702-3-kamalheib1@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Jason Gunthorpe |
Headers | show |
Series | RDMA: Fix create_srq return value | expand |
On Mon, Jul 30, 2018 at 09:56:44PM +0300, Kamal Heib wrote: > Make sure to check for "-EOPNOTSUPP" instead of "-ENOSYS" which is the > return code from ib_create_srq() in case that it not supported. > > Signed-off-by: Kamal Heib <kamalheib1@gmail.com> > drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > index 8b44f33c7ae0..8ef50e46157c 100644 > +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > @@ -1560,7 +1560,7 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge) > > priv->cm.srq = ib_create_srq(priv->pd, &srq_init_attr); > if (IS_ERR(priv->cm.srq)) { > - if (PTR_ERR(priv->cm.srq) != -ENOSYS) > + if (PTR_ERR(priv->cm.srq) != -EOPNOTSUPP) > pr_warn("%s: failed to allocate SRQ, error %ld\n", > priv->ca->name, PTR_ERR(priv->cm.srq)); > priv->cm.srq = NULL; What about the hunk for ipoib_set_coalesce ? 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
On Mon, Jul 30, 2018 at 01:13:46PM -0600, Jason Gunthorpe wrote: > On Mon, Jul 30, 2018 at 09:56:44PM +0300, Kamal Heib wrote: > > Make sure to check for "-EOPNOTSUPP" instead of "-ENOSYS" which is the > > return code from ib_create_srq() in case that it not supported. > > > > Signed-off-by: Kamal Heib <kamalheib1@gmail.com> > > drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > index 8b44f33c7ae0..8ef50e46157c 100644 > > +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c > > @@ -1560,7 +1560,7 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge) > > > > priv->cm.srq = ib_create_srq(priv->pd, &srq_init_attr); > > if (IS_ERR(priv->cm.srq)) { > > - if (PTR_ERR(priv->cm.srq) != -ENOSYS) > > + if (PTR_ERR(priv->cm.srq) != -EOPNOTSUPP) > > pr_warn("%s: failed to allocate SRQ, error %ld\n", > > priv->ca->name, PTR_ERR(priv->cm.srq)); > > priv->cm.srq = NULL; > > What about the hunk for ipoib_set_coalesce ? > > Jason I plan to prepare another patch set that handle the return code of modify_cq(). Thanks, Kamal -- 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/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 8b44f33c7ae0..8ef50e46157c 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -1560,7 +1560,7 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge) priv->cm.srq = ib_create_srq(priv->pd, &srq_init_attr); if (IS_ERR(priv->cm.srq)) { - if (PTR_ERR(priv->cm.srq) != -ENOSYS) + if (PTR_ERR(priv->cm.srq) != -EOPNOTSUPP) pr_warn("%s: failed to allocate SRQ, error %ld\n", priv->ca->name, PTR_ERR(priv->cm.srq)); priv->cm.srq = NULL;
Make sure to check for "-EOPNOTSUPP" instead of "-ENOSYS" which is the return code from ib_create_srq() in case that it not supported. Signed-off-by: Kamal Heib <kamalheib1@gmail.com> --- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)