public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Boshi Yu <boshiyu@linux.alibaba.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org,
	kaishen@linux.alibaba.com, chengyou@linux.alibaba.com
Subject: Re: [PATCH for-next 1/8] RDMA/erdma: Probe the erdma RoCEv2 device
Date: Thu, 5 Dec 2024 10:46:41 +0800	[thread overview]
Message-ID: <3559c2d4-41f7-4787-b4fe-46f0a4cd6ff9@linux.alibaba.com> (raw)
In-Reply-To: <20241204140307.GO1245331@unreal>



在 2024/12/4 22:03, Leon Romanovsky 写道:
> On Tue, Nov 26, 2024 at 02:59:07PM +0800, Boshi Yu wrote:
>> Currently, the erdma driver supports both the iWARP and RoCEv2 protocols.
>> The erdma driver reads the ERDMA_REGS_DEV_PROTO_REG register to identify
>> the protocol used by the erdma device. Since each protocol requires
>> different ib_device_ops, we introduce the erdma_device_ops_iwarp and
>> erdma_device_ops_rocev2 for iWARP and RoCEv2 protocols, respectively.
>>
>> Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com>
>> Reviewed-by: Cheng Xu <chengyou@linux.alibaba.com>
>> ---
>>   drivers/infiniband/hw/erdma/Kconfig       |  2 +-
>>   drivers/infiniband/hw/erdma/erdma.h       |  3 +-
>>   drivers/infiniband/hw/erdma/erdma_hw.h    |  7 ++++
>>   drivers/infiniband/hw/erdma/erdma_main.c  | 47 ++++++++++++++++++-----
>>   drivers/infiniband/hw/erdma/erdma_verbs.c | 16 +++++++-
>>   drivers/infiniband/hw/erdma/erdma_verbs.h | 12 ++++++
>>   6 files changed, 75 insertions(+), 12 deletions(-)
> 
> <...>
> 
>> +++ b/drivers/infiniband/hw/erdma/erdma_main.c
>> @@ -172,6 +172,12 @@ static int erdma_device_init(struct erdma_dev *dev, struct pci_dev *pdev)
>>   {
>>   	int ret;
>>   
>> +	dev->proto = erdma_reg_read32(dev, ERDMA_REGS_DEV_PROTO_REG);
>> +	if (!erdma_device_iwarp(dev) && !erdma_device_rocev2(dev)) {
> 
> Why do you need this check? Your old driver which supports only iwarp
> doesn't have this check, so why did you suddenly need it for roce?
> 

Hi, Leon,

We initially try to avoid reading an invalid value from the hardware.
Thank you for your question; I found that the check is unnecessary since
the value of ERDMA_REGS_DEV_PROTO_REG can only be 0 or 1. We will remove
this check in patch v2.

Thanks,

Boshi Yu

>> +		dev_err(&pdev->dev, "Unsupported protocol: %d\n", dev->proto);
>> +		return -ENODEV;
>> +	}
>> +
> 
> Thanks


  reply	other threads:[~2024-12-05  2:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-26  6:59 [PATCH for-next 0/8] RDMA/erdma: Support the RoCEv2 protocol Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 1/8] RDMA/erdma: Probe the erdma RoCEv2 device Boshi Yu
2024-11-26 15:36   ` Zhu Yanjun
2024-11-28  2:07     ` Cheng Xu
2024-11-28 13:07       ` Zhu Yanjun
2024-12-04 14:03   ` Leon Romanovsky
2024-12-05  2:46     ` Boshi Yu [this message]
2024-11-26  6:59 ` [PATCH for-next 2/8] RDMA/erdma: Add GID table management interfaces Boshi Yu
2024-11-26 15:51   ` Zhu Yanjun
2024-11-28  2:35     ` Boshi Yu
2024-11-29  8:54       ` Zhu Yanjun
2024-11-29 11:18         ` Boshi Yu
2024-11-29 18:40           ` Zhu Yanjun
2024-11-26  6:59 ` [PATCH for-next 3/8] RDMA/erdma: Add the erdma_query_pkey() interface Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 4/8] RDMA/erdma: Add address handle implementation Boshi Yu
2024-12-04 14:11   ` Leon Romanovsky
2024-12-05  2:54     ` Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 5/8] RDMA/erdma: Add erdma_modify_qp_rocev2() interface Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 6/8] RDMA/erdma: Reformat the code of the modify_qp interface Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 7/8] RDMA/erdma: Add the query_qp command to the cmdq Boshi Yu
2024-11-26  6:59 ` [PATCH for-next 8/8] RDMA/erdma: Support UD QPs and UD WRs Boshi Yu

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=3559c2d4-41f7-4787-b4fe-46f0a4cd6ff9@linux.alibaba.com \
    --to=boshiyu@linux.alibaba.com \
    --cc=chengyou@linux.alibaba.com \
    --cc=jgg@ziepe.ca \
    --cc=kaishen@linux.alibaba.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /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