All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cheng Xu <chengyou@linux.alibaba.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: dledford@redhat.com, leon@kernel.org, linux-rdma@vger.kernel.org,
	KaiShen@linux.alibaba.com, tonylu@linux.alibaba.com,
	BMT@zurich.ibm.com
Subject: Re: [PATCH for-next v7 10/12] RDMA/erdma: Add the erdma module
Date: Mon, 16 May 2022 23:14:24 +0800	[thread overview]
Message-ID: <eb2f87be-7d9a-72c9-645e-0d789b604c2e@linux.alibaba.com> (raw)
In-Reply-To: <20220516140721.GW1343366@nvidia.com>



On 5/16/22 10:07 PM, Jason Gunthorpe wrote:
> On Mon, May 16, 2022 at 09:59:28PM +0800, Cheng Xu wrote:
>>
>>
>> On 5/16/22 8:40 PM, Cheng Xu wrote:
>>>
>>>
>>> On 5/16/22 7:49 PM, Jason Gunthorpe wrote:
>>>> On Mon, May 16, 2022 at 11:15:32AM +0800, Cheng Xu wrote:
>>>>>
>>>>>
>>>>> On 5/10/22 9:17 PM, Jason Gunthorpe wrote:
>>>>>> On Thu, Apr 21, 2022 at 03:17:45PM +0800, Cheng Xu wrote:
>>>>>>
>>>>>>> +static struct rdma_link_ops erdma_link_ops = {
>>>>>>> +    .type = "erdma",
>>>>>>> +    .newlink = erdma_newlink,
>>>>>>> +};
>>>>>>
>>>>>> Why is there still a newlink?
>>>>>>
>>>>>> Jason
>>>>>
>>>>>
>>>>> Yeah, I remember your suggestion that the ibdev should keep the same
>>>>> lifecycle with its PCI device, and so does it now.
>>>>>
>>>>> The initialization flow for erdma now:
>>>>>        probe:
>>>>>          - Hardware specified initialization
>>>>>          - IB device initialization
>>>>>          - Calling ib_register_device with ibdev->netdev == NULL
>>>>>
>>>>> After probe, The ib device has been registered, but we left it in
>>>>> invalid state.
>>>>> To fully complete the initialization, we should set the ibdev->netdev.
>>>>>
>>>>> And the newlink command in erdma only do one thing now: set the
>>>>> ibdev->netdev if the rule matches, and it is uncorrelated with the
>>>>> ib device lifecycle.
>>>>
>>>> This is not what newlink is for, it can't be used like this
>>>>
>>>> Jason
>>>
>>>
>>> [A typo in previous reply, so I re-edit it]
>>>
>> <...>
>>> Or, Is it ok that erdma registers a net notifier in our module to handle
>>> this?
>>>
>>
>> I think this twice, use a net notifier of module can not solve this, due
>> to the leak of all ib devices information in erdma module.
> 
> I don't understand what this means
At first I want to register a global net notifier in our module, and 
link the ib device and net device if matches in the callback. But in the
callback, we can not get the ib devices registered by erdma, because our
driver module does not maintain the ib device list. This is not the
right way.

>> The solution may be simple: register net notifier per device in probe,
>> and call ib_device_set_netdev if matches in the notifier callback.
> 
> That sounds wrong
> 

OK. So using rdma link command to handle the link relationship manually
is still a better choice?

Actually, erdma looks like a hardware implementation of siw/rxe (more
likes siw, because erdma uses iWarp, and have similar CM
implementation): the ethernet functionality is provided by existed net
device, no matter what kind of the net device (due to virtio-net is
de-facto in cloud virtualization, erdma is binded to virtio-net in
practice). Due to this similarity, siw/rxe use 'rdma link' to link the
ib device and net device (including create ib device), Does it sound
reasonable that erdma use it to link the net deivce?

Could you re-consider this way? Or could you give us some suggestion? I
think this is the main and important issue for our upstreaming. I would
be very grateful.

Thanks,
Cheng Xu





  reply	other threads:[~2022-05-16 15:14 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  7:17 [PATCH for-next v7 00/12] Elastic RDMA Adapter (ERDMA) driver Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 01/12] RDMA: Add ERDMA to rdma_driver_id definition Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 02/12] RDMA/core: Allow calling query_port when netdev isn't attached in iWarp Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 03/12] RDMA/erdma: Add the hardware related definitions Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 04/12] RDMA/erdma: Add main include file Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 05/12] RDMA/erdma: Add cmdq implementation Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 06/12] RDMA/erdma: Add event queue implementation Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 07/12] RDMA/erdma: Add verbs header file Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 08/12] RDMA/erdma: Add verbs implementation Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 09/12] RDMA/erdma: Add connection management (CM) support Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 10/12] RDMA/erdma: Add the erdma module Cheng Xu
2022-05-10 13:17   ` Jason Gunthorpe
2022-05-16  3:15     ` Cheng Xu
2022-05-16 11:49       ` Jason Gunthorpe
2022-05-16 12:37         ` Cheng Xu
2022-05-16 12:40         ` Cheng Xu
2022-05-16 13:59           ` Cheng Xu
2022-05-16 14:07             ` Jason Gunthorpe
2022-05-16 15:14               ` Cheng Xu [this message]
2022-05-16 17:31                 ` Jason Gunthorpe
2022-05-17  1:53                   ` Cheng Xu
2022-05-18  8:30     ` Cheng Xu
2022-05-18 14:46       ` Jason Gunthorpe
2022-05-18 16:24         ` Cheng Xu
2022-05-18 16:31           ` Jason Gunthorpe
2022-05-19 16:20             ` Bernard Metzler
2022-05-19 18:51               ` Tom Talpey
2022-05-20  7:03               ` Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 11/12] RDMA/erdma: Add the ABI definitions Cheng Xu
2022-04-21  7:17 ` [PATCH for-next v7 12/12] RDMA/erdma: Add driver to kernel build environment Cheng Xu
2022-05-10 13:18   ` Jason Gunthorpe
2022-05-16  3:40     ` Cheng Xu
2022-05-16  7:11       ` Cheng Xu
2022-05-16 10:07         ` Cheng Xu
2022-05-16 14:13       ` Jason Gunthorpe
2022-05-16 14:41         ` Cheng Xu
2022-05-10 12:50 ` [PATCH for-next v7 00/12] Elastic RDMA Adapter (ERDMA) driver Jason Gunthorpe
2022-05-16  2:30   ` Cheng Xu
2022-05-16 14:13     ` Jason Gunthorpe
2022-05-20 15:13 Re: [PATCH for-next v7 10/12] RDMA/erdma: Add the erdma module Bernard Metzler
2022-05-23  1:39 ` Cheng Xu
2022-05-23 13:25   ` Tom Talpey
2022-05-24  3:09     ` 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=eb2f87be-7d9a-72c9-645e-0d789b604c2e@linux.alibaba.com \
    --to=chengyou@linux.alibaba.com \
    --cc=BMT@zurich.ibm.com \
    --cc=KaiShen@linux.alibaba.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.