linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Cheng Xu <chengyou@linux.alibaba.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	dledford@redhat.com, linux-rdma@vger.kernel.org,
	KaiShen@linux.alibaba.com, tonylu@linux.alibaba.com
Subject: Re: [PATCH rdma-next v2 09/11] RDMA/erdma: Add the erdma module
Date: Tue, 18 Jan 2022 10:28:35 +0200	[thread overview]
Message-ID: <YeZ6M4z8amVc7ETT@unreal> (raw)
In-Reply-To: <54485395-089d-acdd-7296-d82c8e950599@linux.alibaba.com>

On Tue, Jan 18, 2022 at 11:29:34AM +0800, Cheng Xu wrote:
> 
> 
> On 1/17/22 11:22 PM, Jason Gunthorpe wrote:
> > On Mon, Jan 17, 2022 at 04:48:26PM +0800, Cheng Xu wrote:
> > > Add the main erdma module and debugfs files. The main module provides
> > > interface to infiniband subsytem, and the debugfs module provides a way
> > > to allow user can get the core status of the device and set the preferred
> > > congestion control algorithm.

<...>

> > 
> > > +static __init int erdma_init_module(void)
> > > +{
> > > +	int ret;
> > > +
> > > +	ret = erdma_cm_init();
> > > +	if (ret)
> > > +		return ret;
> > > +
> > > +	ret = pci_register_driver(&erdma_pci_driver);
> > > +	if (ret) {
> > > +		pr_err("Couldn't register erdma driver.\n");
> > > +		goto uninit_cm;
> > > +	}
> > > +
> > > +	ret = register_netdevice_notifier(&erdma_netdev_nb);
> > > +	if (ret)
> > > +		goto unregister_driver;
> > 
> > And notifiers should not be registered without devices.
> 
> I'm confused about this. irdma/bnxt_re/siw/rxe register net notifiers in
> their module_init, and get their ibdev structures by function
> 'ib_device_get_by_netdev'. Other drivers (mlx4/mlx5/hns) register notifiers
> with devices.

Let's put siw and RXE aside, they are special. Regarding irdma - it is a
bug and its register notifier logic should be in driver init code. It
will ensure that notifications are received only when the ib device is
ready.

And for the bnxt_re case, I didn't look too closely on why it is written
how it is written.

Thanks

  reply	other threads:[~2022-01-18  8:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17  8:48 [PATCH rdma-next v2 00/11] Elastic RDMA Adapter (ERDMA) driver Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 01/11] RDMA: Add ERDMA to rdma_driver_id definition Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 02/11] RDMA/erdma: Add the hardware related definitions Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 03/11] RDMA/erdma: Add main include file Cheng Xu
2022-01-17 14:58   ` Jason Gunthorpe
2022-01-18  2:57     ` Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 04/11] RDMA/erdma: Add cmdq implementation Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 05/11] RDMA/erdma: Add event queue implementation Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 06/11] RDMA/erdma: Add verbs header file Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 07/11] RDMA/erdma: Add verbs implementation Cheng Xu
2022-01-17 15:15   ` Jason Gunthorpe
2022-01-18  3:00     ` Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 08/11] RDMA/erdma: Add connection management (CM) support Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 09/11] RDMA/erdma: Add the erdma module Cheng Xu
2022-01-17 15:22   ` Jason Gunthorpe
2022-01-18  3:29     ` Cheng Xu
2022-01-18  8:28       ` Leon Romanovsky [this message]
2022-01-18 11:47         ` Cheng Xu
2022-01-18 12:37         ` Jason Gunthorpe
2022-01-18 13:03     ` Cheng Xu
2022-01-18 14:13       ` Jason Gunthorpe
2022-01-19  1:57         ` Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 10/11] RDMA/erdma: Add the ABI definitions Cheng Xu
2022-01-17  8:48 ` [PATCH rdma-next v2 11/11] RDMA/erdma: Add driver to kernel build environment Cheng Xu
  -- strict thread matches above, loose matches on Subject: below --
2022-01-18 12:53 [PATCH rdma-next v2 09/11] RDMA/erdma: Add the erdma module Bernard Metzler
2022-01-19  4:18 ` Cheng Xu
2022-01-19 10:15 Bernard Metzler
2022-01-19 11:31 ` Leon Romanovsky
2022-01-20  2:51   ` Cheng Xu

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=YeZ6M4z8amVc7ETT@unreal \
    --to=leon@kernel.org \
    --cc=KaiShen@linux.alibaba.com \
    --cc=chengyou@linux.alibaba.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.kernel.org \
    --cc=tonylu@linux.alibaba.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;
as well as URLs for NNTP newsgroup(s).