* [PATCH for-next 1/4] RDMA/OPA: Update OPA link speed list
2026-03-09 20:44 [PATCH for-next 0/4] Prepare for hfi2 submission Dennis Dalessandro
@ 2026-03-09 20:44 ` Dennis Dalessandro
2026-03-09 20:44 ` [PATCH for-next 3/4] RDMA/rdmavt: Correct multi-port QP iteration Dennis Dalessandro
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Dennis Dalessandro @ 2026-03-09 20:44 UTC (permalink / raw)
To: jgg, leon; +Cc: Dean Luick, linux-rdma
From: Dean Luick <dean.luick@cornelisnetworks.com>
Update the list of available link speeds. Fix comments.
Signed-off-by: Dean Luick <dean.luick@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
---
include/rdma/opa_port_info.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/rdma/opa_port_info.h b/include/rdma/opa_port_info.h
index 73bcac90a048..fb66d3a1dfa9 100644
--- a/include/rdma/opa_port_info.h
+++ b/include/rdma/opa_port_info.h
@@ -93,9 +93,11 @@
#define OPA_LINKINIT_QUARANTINED (9 << 4)
#define OPA_LINKINIT_INSUFIC_CAPABILITY (10 << 4)
-#define OPA_LINK_SPEED_NOP 0x0000 /* Reserved (1-5 Gbps) */
-#define OPA_LINK_SPEED_12_5G 0x0001 /* 12.5 Gbps */
-#define OPA_LINK_SPEED_25G 0x0002 /* 25.78125? Gbps (EDR) */
+#define OPA_LINK_SPEED_NOP 0x0000 /* no change */
+#define OPA_LINK_SPEED_12_5G 0x0001 /* 12.5 Gbps */
+#define OPA_LINK_SPEED_25G 0x0002 /* 25.78125 Gbps */
+#define OPA_LINK_SPEED_50G 0x0004 /* 53.125 Gbps */
+#define OPA_LINK_SPEED_100G 0x0008 /* 106.25 Gbps */
#define OPA_LINK_WIDTH_1X 0x0001
#define OPA_LINK_WIDTH_2X 0x0002
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH for-next 3/4] RDMA/rdmavt: Correct multi-port QP iteration
2026-03-09 20:44 [PATCH for-next 0/4] Prepare for hfi2 submission Dennis Dalessandro
2026-03-09 20:44 ` [PATCH for-next 1/4] RDMA/OPA: Update OPA link speed list Dennis Dalessandro
@ 2026-03-09 20:44 ` Dennis Dalessandro
2026-03-09 20:44 ` [PATCH for-next 4/4] RDMA/rdmavt: Add driver mmap callback Dennis Dalessandro
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Dennis Dalessandro @ 2026-03-09 20:44 UTC (permalink / raw)
To: jgg, leon; +Cc: Dean Luick, linux-rdma
From: Dean Luick <dean.luick@cornelisnetworks.com>
When finding special QPs, the iterator makes an incorrect port
index calculation. Fix the calculation.
Signed-off-by: Dean Luick <dean.luick@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
---
drivers/infiniband/sw/rdmavt/qp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index c1199ea5d41f..b519d9d0e429 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -2707,7 +2707,7 @@ int rvt_qp_iter_next(struct rvt_qp_iter *iter)
struct rvt_ibport *rvp;
int pidx;
- pidx = n % rdi->ibdev.phys_port_cnt;
+ pidx = n / 2; /* QP0 and QP1 */
rvp = rdi->ports[pidx];
qp = rcu_dereference(rvp->qp[n & 1]);
} else {
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH for-next 4/4] RDMA/rdmavt: Add driver mmap callback
2026-03-09 20:44 [PATCH for-next 0/4] Prepare for hfi2 submission Dennis Dalessandro
2026-03-09 20:44 ` [PATCH for-next 1/4] RDMA/OPA: Update OPA link speed list Dennis Dalessandro
2026-03-09 20:44 ` [PATCH for-next 3/4] RDMA/rdmavt: Correct multi-port QP iteration Dennis Dalessandro
@ 2026-03-09 20:44 ` Dennis Dalessandro
2026-03-10 11:08 ` [PATCH for-next 0/4] Prepare for hfi2 submission Leon Romanovsky
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Dennis Dalessandro @ 2026-03-09 20:44 UTC (permalink / raw)
To: jgg, leon; +Cc: Dean Luick, linux-rdma
From: Dean Luick <dean.luick@cornelisnetworks.com>
Add a reserved range and a driver callback to allow the driver to
have custom mmaps.
Generated mmap offsets are cookies and are not related to the size of
the mmap. Advance the mmap offset by the minimum, PAGE_SIZE, rather
than the size of the mmap.
Signed-off-by: Dean Luick <dean.luick@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
---
drivers/infiniband/sw/rdmavt/mmap.c | 22 +++++++++++++++++-----
include/rdma/rdma_vt.h | 3 +++
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/sw/rdmavt/mmap.c b/drivers/infiniband/sw/rdmavt/mmap.c
index 46e3b3e0643a..473f464f33fa 100644
--- a/drivers/infiniband/sw/rdmavt/mmap.c
+++ b/drivers/infiniband/sw/rdmavt/mmap.c
@@ -9,6 +9,11 @@
#include <rdma/uverbs_ioctl.h>
#include "mmap.h"
+/* number of reserved mmaps for the driver */
+#define MMAP_RESERVED 256
+/* start point for dynamic offsets */
+#define MMAP_OFFSET_START (MMAP_RESERVED * PAGE_SIZE)
+
/**
* rvt_mmap_init - init link list and lock for mem map
* @rdi: rvt dev struct
@@ -17,7 +22,7 @@ void rvt_mmap_init(struct rvt_dev_info *rdi)
{
INIT_LIST_HEAD(&rdi->pending_mmaps);
spin_lock_init(&rdi->pending_lock);
- rdi->mmap_offset = PAGE_SIZE;
+ rdi->mmap_offset = MMAP_OFFSET_START;
spin_lock_init(&rdi->mmap_offset_lock);
}
@@ -73,6 +78,13 @@ int rvt_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
struct rvt_mmap_info *ip, *pp;
int ret = -EINVAL;
+ /* call driver if in reserved range */
+ if (offset < MMAP_OFFSET_START) {
+ if (rdi->driver_f.mmap)
+ return rdi->driver_f.mmap(context, vma);
+ return -EINVAL;
+ }
+
/*
* Search the device's list of objects waiting for a mmap call.
* Normally, this list is very short since a call to create a
@@ -129,9 +141,9 @@ struct rvt_mmap_info *rvt_create_mmap_info(struct rvt_dev_info *rdi, u32 size,
spin_lock_irq(&rdi->mmap_offset_lock);
if (rdi->mmap_offset == 0)
- rdi->mmap_offset = ALIGN(PAGE_SIZE, SHMLBA);
+ rdi->mmap_offset = MMAP_OFFSET_START;
ip->offset = rdi->mmap_offset;
- rdi->mmap_offset += ALIGN(size, SHMLBA);
+ rdi->mmap_offset += PAGE_SIZE;
spin_unlock_irq(&rdi->mmap_offset_lock);
INIT_LIST_HEAD(&ip->pending_mmaps);
@@ -159,9 +171,9 @@ void rvt_update_mmap_info(struct rvt_dev_info *rdi, struct rvt_mmap_info *ip,
spin_lock_irq(&rdi->mmap_offset_lock);
if (rdi->mmap_offset == 0)
- rdi->mmap_offset = PAGE_SIZE;
+ rdi->mmap_offset = MMAP_OFFSET_START;
ip->offset = rdi->mmap_offset;
- rdi->mmap_offset += size;
+ rdi->mmap_offset += PAGE_SIZE;
spin_unlock_irq(&rdi->mmap_offset_lock);
ip->size = size;
diff --git a/include/rdma/rdma_vt.h b/include/rdma/rdma_vt.h
index 8671c6da16bb..7d8de561f71b 100644
--- a/include/rdma/rdma_vt.h
+++ b/include/rdma/rdma_vt.h
@@ -366,6 +366,9 @@ struct rvt_driver_provided {
/* deallocate a ucontext */
void (*dealloc_ucontext)(struct ib_ucontext *context);
+
+ /* driver mmap */
+ int (*mmap)(struct ib_ucontext *context, struct vm_area_struct *vma);
};
struct rvt_dev_info {
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH for-next 0/4] Prepare for hfi2 submission
2026-03-09 20:44 [PATCH for-next 0/4] Prepare for hfi2 submission Dennis Dalessandro
` (2 preceding siblings ...)
2026-03-09 20:44 ` [PATCH for-next 4/4] RDMA/rdmavt: Add driver mmap callback Dennis Dalessandro
@ 2026-03-10 11:08 ` Leon Romanovsky
2026-03-10 14:14 ` Dennis Dalessandro
2026-03-11 17:28 ` [PATCH for-next 2/4] RDMA/rdmavt: Add ucontext alloc/dealloc passthrough Dennis Dalessandro
2026-03-11 19:17 ` [PATCH for-next 0/4] Prepare for hfi2 submission Leon Romanovsky
5 siblings, 1 reply; 9+ messages in thread
From: Leon Romanovsky @ 2026-03-10 11:08 UTC (permalink / raw)
To: Dennis Dalessandro; +Cc: jgg, Dean Luick, linux-rdma
On Mon, Mar 09, 2026 at 04:44:39PM -0400, Dennis Dalessandro wrote:
> These 4 patches get rdmavt ready for hfi2 support. This is being split out
> from the previous patch submission [1].
>
> [1] https://lore.kernel.org/linux-rdma/175129726945.1859400.4492277779101226937.stgit@awdrv-04.cornelisnetworks.com/
>
> ---
>
> Dean Luick (4):
> RDMA/OPA: Update OPA link speed list
> RDMA/rdmavt: Add ucontext alloc/dealloc passthrough
> RDMA/rdmavt: Correct multi-port QP iteration
> RDMA/rdmavt: Add driver mmap callback
Something went wrong, second patch didn't arrive.
https://lore.kernel.org/all/177308892140.1279894.3475429390519673020.stgit@awdrv-04.cornelisnetworks.com/
>
>
> drivers/infiniband/sw/rdmavt/mmap.c | 22 +++++++++++++++++-----
> drivers/infiniband/sw/rdmavt/qp.c | 2 +-
> drivers/infiniband/sw/rdmavt/vt.c | 8 ++++++++
> include/rdma/opa_port_info.h | 8 +++++---
> include/rdma/rdma_vt.h | 10 ++++++++++
> 5 files changed, 41 insertions(+), 9 deletions(-)
>
> --
> -Denny
>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH for-next 0/4] Prepare for hfi2 submission
2026-03-10 11:08 ` [PATCH for-next 0/4] Prepare for hfi2 submission Leon Romanovsky
@ 2026-03-10 14:14 ` Dennis Dalessandro
2026-03-10 18:00 ` Leon Romanovsky
0 siblings, 1 reply; 9+ messages in thread
From: Dennis Dalessandro @ 2026-03-10 14:14 UTC (permalink / raw)
To: Leon Romanovsky; +Cc: jgg, Dean Luick, linux-rdma
On 3/10/26 7:08 AM, Leon Romanovsky wrote:
> On Mon, Mar 09, 2026 at 04:44:39PM -0400, Dennis Dalessandro wrote:
>> These 4 patches get rdmavt ready for hfi2 support. This is being split out
>> from the previous patch submission [1].
>>
>> [1] https://lore.kernel.org/linux-rdma/175129726945.1859400.4492277779101226937.stgit@awdrv-04.cornelisnetworks.com/
>>
>> ---
>>
>> Dean Luick (4):
>> RDMA/OPA: Update OPA link speed list
>> RDMA/rdmavt: Add ucontext alloc/dealloc passthrough
>> RDMA/rdmavt: Correct multi-port QP iteration
>> RDMA/rdmavt: Add driver mmap callback
>
> Something went wrong, second patch didn't arrive.
> https://lore.kernel.org/all/177308892140.1279894.3475429390519673020.stgit@awdrv-04.cornelisnetworks.com/
Sorry about that, I'm working the problem with our IT dept right now.
The mailserver decided to eat half of my patches.
-Denny
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH for-next 0/4] Prepare for hfi2 submission
2026-03-10 14:14 ` Dennis Dalessandro
@ 2026-03-10 18:00 ` Leon Romanovsky
0 siblings, 0 replies; 9+ messages in thread
From: Leon Romanovsky @ 2026-03-10 18:00 UTC (permalink / raw)
To: Dennis Dalessandro; +Cc: jgg, Dean Luick, linux-rdma
On Tue, Mar 10, 2026 at 10:14:55AM -0400, Dennis Dalessandro wrote:
> On 3/10/26 7:08 AM, Leon Romanovsky wrote:
> > On Mon, Mar 09, 2026 at 04:44:39PM -0400, Dennis Dalessandro wrote:
> > > These 4 patches get rdmavt ready for hfi2 support. This is being split out
> > > from the previous patch submission [1].
> > >
> > > [1] https://lore.kernel.org/linux-rdma/175129726945.1859400.4492277779101226937.stgit@awdrv-04.cornelisnetworks.com/
> > >
> > > ---
> > >
> > > Dean Luick (4):
> > > RDMA/OPA: Update OPA link speed list
> > > RDMA/rdmavt: Add ucontext alloc/dealloc passthrough
> > > RDMA/rdmavt: Correct multi-port QP iteration
> > > RDMA/rdmavt: Add driver mmap callback
> >
> > Something went wrong, second patch didn't arrive.
> > https://lore.kernel.org/all/177308892140.1279894.3475429390519673020.stgit@awdrv-04.cornelisnetworks.com/
>
> Sorry about that, I'm working the problem with our IT dept right now. The
> mailserver decided to eat half of my patches.
In the meantime, I can take these three patches if you prefer.
By the way, these patches currently have no in-kernel consumers, but
let's assume you plan to use them in your hfi2 driver."
Thanks
>
> -Denny
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH for-next 2/4] RDMA/rdmavt: Add ucontext alloc/dealloc passthrough
2026-03-09 20:44 [PATCH for-next 0/4] Prepare for hfi2 submission Dennis Dalessandro
` (3 preceding siblings ...)
2026-03-10 11:08 ` [PATCH for-next 0/4] Prepare for hfi2 submission Leon Romanovsky
@ 2026-03-11 17:28 ` Dennis Dalessandro
2026-03-11 19:17 ` [PATCH for-next 0/4] Prepare for hfi2 submission Leon Romanovsky
5 siblings, 0 replies; 9+ messages in thread
From: Dennis Dalessandro @ 2026-03-11 17:28 UTC (permalink / raw)
To: jgg, leon; +Cc: Dean Luick, linux-rdma
From: Dean Luick <dean.luick@cornelisnetworks.com>
Add a private data pointer to the ucontext structure and add
per-client pass-throughs.
Signed-off-by: Dean Luick <dean.luick@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
---
drivers/infiniband/sw/rdmavt/vt.c | 8 ++++++++
include/rdma/rdma_vt.h | 7 +++++++
2 files changed, 15 insertions(+)
diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index 0c28b412d81a..033d8932aff1 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -244,6 +244,10 @@ static int rvt_query_gid(struct ib_device *ibdev, u32 port_num,
*/
static int rvt_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata)
{
+ struct rvt_dev_info *rdi = ib_to_rvt(uctx->device);
+
+ if (rdi->driver_f.alloc_ucontext)
+ return rdi->driver_f.alloc_ucontext(uctx, udata);
return 0;
}
@@ -253,6 +257,10 @@ static int rvt_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata)
*/
static void rvt_dealloc_ucontext(struct ib_ucontext *context)
{
+ struct rvt_dev_info *rdi = ib_to_rvt(context->device);
+
+ if (rdi->driver_f.dealloc_ucontext)
+ rdi->driver_f.dealloc_ucontext(context);
return;
}
diff --git a/include/rdma/rdma_vt.h b/include/rdma/rdma_vt.h
index c429d6ddb129..8671c6da16bb 100644
--- a/include/rdma/rdma_vt.h
+++ b/include/rdma/rdma_vt.h
@@ -149,6 +149,7 @@ struct rvt_driver_params {
/* User context */
struct rvt_ucontext {
struct ib_ucontext ibucontext;
+ void *priv;
};
/* Protection domain */
@@ -359,6 +360,12 @@ struct rvt_driver_provided {
/* Get and return CPU to pin CQ processing thread */
int (*comp_vect_cpu_lookup)(struct rvt_dev_info *rdi, int comp_vect);
+
+ /* allocate a ucontext */
+ int (*alloc_ucontext)(struct ib_ucontext *uctx, struct ib_udata *udata);
+
+ /* deallocate a ucontext */
+ void (*dealloc_ucontext)(struct ib_ucontext *context);
};
struct rvt_dev_info {
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH for-next 0/4] Prepare for hfi2 submission
2026-03-09 20:44 [PATCH for-next 0/4] Prepare for hfi2 submission Dennis Dalessandro
` (4 preceding siblings ...)
2026-03-11 17:28 ` [PATCH for-next 2/4] RDMA/rdmavt: Add ucontext alloc/dealloc passthrough Dennis Dalessandro
@ 2026-03-11 19:17 ` Leon Romanovsky
5 siblings, 0 replies; 9+ messages in thread
From: Leon Romanovsky @ 2026-03-11 19:17 UTC (permalink / raw)
To: jgg, Dennis Dalessandro; +Cc: Dean Luick, linux-rdma
On Mon, 09 Mar 2026 16:44:39 -0400, Dennis Dalessandro wrote:
> These 4 patches get rdmavt ready for hfi2 support. This is being split out
> from the previous patch submission [1].
>
> [1] https://lore.kernel.org/linux-rdma/175129726945.1859400.4492277779101226937.stgit@awdrv-04.cornelisnetworks.com/
Applied, thanks!
[1/4] RDMA/OPA: Update OPA link speed list
https://git.kernel.org/rdma/rdma/c/ba8c700185d62b
[2/4] RDMA/rdmavt: Add ucontext alloc/dealloc passthrough
https://git.kernel.org/rdma/rdma/c/e2849b3929743c
[3/4] RDMA/rdmavt: Correct multi-port QP iteration
https://git.kernel.org/rdma/rdma/c/2ad64eeaefd293
[4/4] RDMA/rdmavt: Add driver mmap callback
https://git.kernel.org/rdma/rdma/c/1487bad4ea518a
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 9+ messages in thread