All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cheng Xu <chengyou@linux.alibaba.com>
To: Bernard Metzler <BMT@zurich.ibm.com>,
	Jason Gunthorpe <jgg@nvidia.com>, Tom Talpey <tom@talpey.com>
Cc: "dledford@redhat.com" <dledford@redhat.com>,
	"leon@kernel.org" <leon@kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"KaiShen@linux.alibaba.com" <KaiShen@linux.alibaba.com>,
	"tonylu@linux.alibaba.com" <tonylu@linux.alibaba.com>
Subject: Re: [PATCH for-next v7 10/12] RDMA/erdma: Add the erdma module
Date: Fri, 20 May 2022 15:03:39 +0800	[thread overview]
Message-ID: <6ed58a41-1b75-2dd6-fb3a-8da1dce1400e@linux.alibaba.com> (raw)
In-Reply-To: <BYAPR15MB2631B46350315B486CA9ED3599D09@BYAPR15MB2631.namprd15.prod.outlook.com>



On 5/20/22 12:20 AM, Bernard Metzler wrote:
> 
> 

<...>

>>> As far as I know, iWarp device only has one GID entry which generated
>>> from MAC address.
>>>
>>> For iWarp, The CM part in core code resolves address, finds
>>> route with the help of kernel's net subsystem, and then obtains the
>> correct
>>> ibdev by GID matching. The GID matching in iWarp is indeed MAC address
>>> matching.
>>>
>>> In another words, for iWarp devices, the core code doesn't handle IP
>>> addressing related stuff directly, it is finished by calling net APIs.
>>> The netdev set by ib_device_set_netdev does not used in iWarp's CM
>>> process.
>>>
>>> The binded netdev in iWarp devices, mainly have two purposes:
>>>    1). generated GID0, using the netdev's mac address.
>>>    2). get the port state and attributes.
>>>
>>> For 1), erdma device binded to net device also by mac address, which can
>>> be obtained from our PCIe bar registers.
>>> For 2), erdma can also get the information, and may be more accurately.
>>> For example, erdma can have different MTU with virtio-net in our cloud.
>>>
>>> For RoCEv2, I know that it has many GIDs, some of them are generated
>>> from IP addresses, and handing IP addressing in core code.
>>
>> Bernard, Tom what do you think?
>>
>> Jason
> 
> I think iWarp (and now RoCEv2 with its UDP dependency) drivers
> produce GIDs mostly to satisfy the current RDMA CM infrastructure,
> which depends on this type of unique identifier, inherited from IB.
> Imo, more natural would be to implement IP based RDMA protocols
> connection management by relying on IP addresses.
> 
> Sorry for asking again - why erdma does not need to link with netdev?
> Can erdma exist without using a netdev?

Actually erdma also need a net device binded to, and so does it.

These days I’m trying to find out acceptable ways to get the reference
of the binded netdev, e,g, the 'struct net_device' pointer. Unlike other
RDMA drivers can get the reference of their binded netdevs' reference 
easily (most RDMA devices are based on the extended aux devices), it is
a little more complex for erdma, because erdma and its binded net device
are two separated PCIe devices.

Then I find that the netdev reference hold in ibdev is rarely used
in core code for iWarp deivces, GID0 is the key attribute (As you and 
Tom mentioned, it appears with the historical need for compatibility,
but I think this is another story).

So, there are two choices for erdma: enum net devices and find the
matched one, or never calling ib_device_set_netdev. The second one has 
less code.

The second way can't work in ROCE. But it works for iWarp (I've tested),
since the netdev reference is rarely used for iWarp in core code, as I
said in last reply.

In short, the question discussed here is that: is it acceptable that
doesn't hold the netdev reference in core code for a iWarp driver
(indeed it has a netdev binded to) ? Or is it necessary that calling
ib_device_set_netdev to set the binded netdev for iWarp driver?

You and Tom both are specialists in iWarp, your opinions are important.

Thanks very much
Cheng Xu


> 
> Thanks,
> Bernard.

  parent reply	other threads:[~2022-05-20  7:04 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
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 [this message]
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=6ed58a41-1b75-2dd6-fb3a-8da1dce1400e@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=tom@talpey.com \
    --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.