Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Kamal Heib <kamalheib1@gmail.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: linux-rdma@vger.kernel.org, Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Zhu Yanjun <yanjunz@nvidia.com>
Subject: Re: [PATCH v3 for-rc] RDMA/rxe: Fix panic when calling kmem_cache_create()
Date: Tue, 25 Aug 2020 12:27:13 +0300	[thread overview]
Message-ID: <20200825092713.GA194958@kheib-workstation> (raw)
In-Reply-To: <ee809280-48d2-a5cc-c1a1-521ba58636b1@acm.org>

On Mon, Aug 24, 2020 at 09:41:14AM -0700, Bart Van Assche wrote:
> On 8/24/20 8:52 AM, Kamal Heib wrote:
> > +bool rxe_is_loaded;
> 
> The name of this variable seems wrong to me. My understanding is that rxe_module_init() is
> called whether or not rxe has been built as a module. Consider renaming this variable into
> e.g. "rxe_initialized".
>
OK, I'll change it.

> > diff --git a/drivers/infiniband/sw/rxe/rxe_sysfs.c b/drivers/infiniband/sw/rxe/rxe_sysfs.c
> > index ccda5f5a3bc0..12c7ca0764d5 100644
> > --- a/drivers/infiniband/sw/rxe/rxe_sysfs.c
> > +++ b/drivers/infiniband/sw/rxe/rxe_sysfs.c
> > @@ -61,6 +61,11 @@ static int rxe_param_set_add(const char *val, const struct kernel_param *kp)
> >   	struct net_device *ndev;
> >   	struct rxe_dev *exists;
> > +	if (!rxe_is_loaded) {
> > +		pr_err("Please make sure to load the rdma_rxe module first\n");
> > +		return -EINVAL;
> > +	}
> > +
> >   	len = sanitize_arg(val, intf, sizeof(intf));
> >   	if (!len) {
> >   		pr_err("add: invalid interface name\n");
> 
> The above message is misleading. Consider changing it into e.g. the following:
> 
>     Please wait until initialization of the rdma_rxe module has finished.
> 
> Additionally, how about returning -EAGAIN instead of -EINVAL?
>
Yes, this makes more sense, I'll change it.

Thanks,
Kamal

> Thanks,
> 
> Bart.
> 
> 

      parent reply	other threads:[~2020-08-25  9:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 15:52 [PATCH v3 for-rc] RDMA/rxe: Fix panic when calling kmem_cache_create() Kamal Heib
2020-08-24 16:41 ` Bart Van Assche
2020-08-24 16:51   ` Jason Gunthorpe
2020-08-25  9:36     ` Kamal Heib
2020-08-25 13:25       ` Jason Gunthorpe
2020-08-25 15:18         ` Kamal Heib
2020-08-25  9:27   ` Kamal Heib [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200825092713.GA194958@kheib-workstation \
    --to=kamalheib1@gmail.com \
    --cc=bvanassche@acm.org \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    --cc=yanjunz@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox