* [PATCH rdma-next] RDMA/rxe: Set default vendor ID
@ 2020-04-06 17:35 Leon Romanovsky
2020-04-14 19:00 ` Jason Gunthorpe
0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2020-04-06 17:35 UTC (permalink / raw)
To: Doug Ledford, Jason Gunthorpe
Cc: Zhu Yanjun, Amir Vadai, Haggai Eran, Kamal Heib, linux-rdma, Moni Shoua
From: Zhu Yanjun <yanjunz@mellanox.com>
The RXE driver doesn't set vendor_id and user space applications
see zeros. This causes to pyverbs tests to fail with the following
traceback, because the expectation is to have valid vendor_id.
Traceback (most recent call last):
File "tests/test_device.py", line 51, in test_query_device
self.verify_device_attr(attr)
File "tests/test_device.py", line 77, in verify_device_attr
assert attr.vendor_id != 0
In order to fix it, we will set vendor_id 0XFFFFFF, according
to the IBTA v1.4 A3.3.1 VENDOR INFORMATION section.
"""
A vendor that produces a generic controller (i.e., one that supports a
standard I/O protocol such as SRP), which does not have vendor specific
device drivers, may use the value of 0xFFFFFF in the VendorID field.
"""
Before:
"
hca_id: rxe0
transport: InfiniBand (0)
fw_ver: 0.0.0
node_guid: 5054:00ff:feaa:5363
sys_image_guid: 5054:00ff:feaa:5363
vendor_id: 0x0000
"
After:
"
hca_id: rxe0
transport: InfiniBand (0)
fw_ver: 0.0.0
node_guid: 5054:00ff:feaa:5363
sys_image_guid: 5054:00ff:feaa:5363
vendor_id: 0xffffff
"
Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Zhu Yanjun <yanjunz@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
drivers/infiniband/sw/rxe/rxe.c | 1 +
drivers/infiniband/sw/rxe/rxe_param.h | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c
index 4afdd2e20883..5642eefb4ba1 100644
--- a/drivers/infiniband/sw/rxe/rxe.c
+++ b/drivers/infiniband/sw/rxe/rxe.c
@@ -77,6 +77,7 @@ static void rxe_init_device_param(struct rxe_dev *rxe)
{
rxe->max_inline_data = RXE_MAX_INLINE_DATA;
+ rxe->attr.vendor_id = RXE_VENDOR_ID;
rxe->attr.max_mr_size = RXE_MAX_MR_SIZE;
rxe->attr.page_size_cap = RXE_PAGE_SIZE_CAP;
rxe->attr.max_qp = RXE_MAX_QP;
diff --git a/drivers/infiniband/sw/rxe/rxe_param.h b/drivers/infiniband/sw/rxe/rxe_param.h
index f59616b02477..99e9d8ba9767 100644
--- a/drivers/infiniband/sw/rxe/rxe_param.h
+++ b/drivers/infiniband/sw/rxe/rxe_param.h
@@ -127,6 +127,9 @@ enum rxe_device_param {
/* Delay before calling arbiter timer */
RXE_NSEC_ARB_TIMER_DELAY = 200,
+
+ /* IBTA v1.4 A3.3.1 VENDOR INFORMATION section */
+ RXE_VENDOR_ID = 0XFFFFFF,
};
/* default/initial rxe port parameters */
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH rdma-next] RDMA/rxe: Set default vendor ID
2020-04-06 17:35 [PATCH rdma-next] RDMA/rxe: Set default vendor ID Leon Romanovsky
@ 2020-04-14 19:00 ` Jason Gunthorpe
0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2020-04-14 19:00 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Doug Ledford, Zhu Yanjun, Amir Vadai, Haggai Eran, Kamal Heib,
linux-rdma, Moni Shoua
On Mon, Apr 06, 2020 at 08:35:01PM +0300, Leon Romanovsky wrote:
> From: Zhu Yanjun <yanjunz@mellanox.com>
>
> The RXE driver doesn't set vendor_id and user space applications
> see zeros. This causes to pyverbs tests to fail with the following
> traceback, because the expectation is to have valid vendor_id.
>
> Traceback (most recent call last):
> File "tests/test_device.py", line 51, in test_query_device
> self.verify_device_attr(attr)
> File "tests/test_device.py", line 77, in verify_device_attr
> assert attr.vendor_id != 0
>
> In order to fix it, we will set vendor_id 0XFFFFFF, according
> to the IBTA v1.4 A3.3.1 VENDOR INFORMATION section.
>
> """
> A vendor that produces a generic controller (i.e., one that supports a
> standard I/O protocol such as SRP), which does not have vendor specific
> device drivers, may use the value of 0xFFFFFF in the VendorID field.
> """
>
> Before:
> "
> hca_id: rxe0
> transport: InfiniBand (0)
> fw_ver: 0.0.0
> node_guid: 5054:00ff:feaa:5363
> sys_image_guid: 5054:00ff:feaa:5363
> vendor_id: 0x0000
> "
>
> After:
> "
> hca_id: rxe0
> transport: InfiniBand (0)
> fw_ver: 0.0.0
> node_guid: 5054:00ff:feaa:5363
> sys_image_guid: 5054:00ff:feaa:5363
> vendor_id: 0xffffff
> "
>
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Signed-off-by: Zhu Yanjun <yanjunz@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
> drivers/infiniband/sw/rxe/rxe.c | 1 +
> drivers/infiniband/sw/rxe/rxe_param.h | 3 +++
> 2 files changed, 4 insertions(+)
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-14 19:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 17:35 [PATCH rdma-next] RDMA/rxe: Set default vendor ID Leon Romanovsky
2020-04-14 19:00 ` Jason Gunthorpe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).