Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH for-next] RDMA/hns: Fix the missing device capability flag on the virtual function
@ 2022-04-09  8:35 Wenpeng Liang
  2022-04-09 22:34 ` Jason Gunthorpe
  0 siblings, 1 reply; 3+ messages in thread
From: Wenpeng Liang @ 2022-04-09  8:35 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, linuxarm, liangwenpeng

If the device is a virtual function, the corresponding device capability
flag should be set when querying the device.

Fixes: 0b567cde9d7a ("RDMA/hns: Enable RoCE on virtual functions")
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
index f73ba619f375..8dd1809947fb 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -207,6 +207,9 @@ static int hns_roce_query_device(struct ib_device *ib_dev,
 	if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_XRC)
 		props->device_cap_flags |= IB_DEVICE_XRC;
 
+	if (hr_dev->is_vf)
+		props->device_cap_flags |= IB_DEVICE_VIRTUAL_FUNCTION;
+
 	return 0;
 }
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH for-next] RDMA/hns: Fix the missing device capability flag on the virtual function
  2022-04-09  8:35 [PATCH for-next] RDMA/hns: Fix the missing device capability flag on the virtual function Wenpeng Liang
@ 2022-04-09 22:34 ` Jason Gunthorpe
  2022-04-11  9:35   ` Wenpeng Liang
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2022-04-09 22:34 UTC (permalink / raw)
  To: Wenpeng Liang; +Cc: leon, linux-rdma, linuxarm

On Sat, Apr 09, 2022 at 04:35:23PM +0800, Wenpeng Liang wrote:
> If the device is a virtual function, the corresponding device capability
> flag should be set when querying the device.
> 
> Fixes: 0b567cde9d7a ("RDMA/hns: Enable RoCE on virtual functions")
> Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_main.c | 3 +++
>  1 file changed, 3 insertions(+)

No, this is only set if the device implements the _vf_ ops and uses
ipoib

roce devices never run ipoib

Jason

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH for-next] RDMA/hns: Fix the missing device capability flag on the virtual function
  2022-04-09 22:34 ` Jason Gunthorpe
@ 2022-04-11  9:35   ` Wenpeng Liang
  0 siblings, 0 replies; 3+ messages in thread
From: Wenpeng Liang @ 2022-04-11  9:35 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: leon, linux-rdma, linuxarm

On 2022/4/10 6:34, Jason Gunthorpe wrote:
> On Sat, Apr 09, 2022 at 04:35:23PM +0800, Wenpeng Liang wrote:
>> If the device is a virtual function, the corresponding device capability
>> flag should be set when querying the device.
>>
>> Fixes: 0b567cde9d7a ("RDMA/hns: Enable RoCE on virtual functions")
>> Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
>> ---
>>  drivers/infiniband/hw/hns/hns_roce_main.c | 3 +++
>>  1 file changed, 3 insertions(+)
> 
> No, this is only set if the device implements the _vf_ ops and uses
> ipoib
> 
> roce devices never run ipoib
> 

I would unset this flag. Please ignore this patch.

Thanks,
Wenpeng

> Jason
> .
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-11  9:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-09  8:35 [PATCH for-next] RDMA/hns: Fix the missing device capability flag on the virtual function Wenpeng Liang
2022-04-09 22:34 ` Jason Gunthorpe
2022-04-11  9:35   ` Wenpeng Liang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox