[ewg] Re: [PATCH ofed-1.2] ehca (kernel space): return proper error code if register_mr fails

Hoang-Nam Nguyen HNGUYEN at de.ibm.com
Thu May 17 01:02:48 PDT 2007


> What do H_CONSTRAINED and H_NOT_ENOUGH_RESOURCES mean? Should they also
> be mapped to ENOMEM?
See comment in former code below. Yes, they are mapped to ENOMEM by
this patch. Practically this patch does the same thing like the one
from Kyle.
> We've seen a few instances where some functions other than
> ehca_mrmw_map_hrc_alloc return EINVAL when they should probably return
> ENOMEM as well.
Yes, we'll do that for an overall improvement in next release. For
ofed-1.2 I'd correction those that prevent your application to run.
Please let me know asap if any. Thanks!
> Hoang-Nam Nguyen wrote:
> > Hello Tziporet!
> > Please accept below patch for ofed-1.2, because it fixes a mr resources
> > limitation problem reported by Troy and Kyle on this mailing list. Only
> > with this patch their application is able to release no longer used mrs
> > properly.
> > Thanks!
> > Regards
> > Nam
> >
> >
> >
> > This patch sets the return code of ehca_register_mr() to ENOMEM
> > if corresponding firmware call fails due to out of resources.
> > Some of error codes were mapped to EINVAL. They are now mapped
> > to default case, which already returns EINVAL anyway.
> >
> >
> > Signed-off-by: Hoang-Nam Nguyen <hnguyen at de.ibm.com>
> > ---
> >
> >
> >  ehca_mrmw.c |    7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> >
> >
> > diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c
> b/drivers/infiniband/hw/ehca/ehca_mrmw.c
> > index cfb362a..b3bbe3b 100644
> > --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c
> > +++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c
> > @@ -2045,13 +2045,10 @@ int ehca_mrmw_map_hrc_alloc(const u64 hi
> >     switch (hipz_rc) {
> >     case H_SUCCESS:                /* successful completion */
> >        return 0;
> > -   case H_ADAPTER_PARM:         /* invalid adapter handle */
> > -   case H_RT_PARM:              /* invalid resource type */
> >     case H_NOT_ENOUGH_RESOURCES: /* insufficient resources */
> > -   case H_MLENGTH_PARM:         /* invalid memory length */
> > -   case H_MEM_ACCESS_PARM:      /* invalid access controls */
> >     case H_CONSTRAINED:          /* resource constraint */
> > -      return -EINVAL;
> > +   case H_NO_MEM:
> > +      return -ENOMEM;
> >     case H_BUSY:                 /* long busy */
> >        return -EBUSY;
> >     default:
> >
> >
>
> _______________________________________________
> ewg mailing list
> ewg at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg




More information about the ewg mailing list