Message ID | 20220409083523.12097-1-liangwenpeng@huawei.com (mailing list archive) |
---|---|
State | Rejected |
Headers | show |
Series | [for-next] RDMA/hns: Fix the missing device capability flag on the virtual function | expand |
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
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 > . >
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; }
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(+)