Skip to content

Commit 838b6fd

Browse files
kwan-intcdledford
authored andcommitted
IB/hfi1: TID RDMA RcvArray programming and TID allocation
TID entries are used by hfi1 hardware to receive data payload from incoming packets directly into a user buffer and thus avoid data copying by software. This patch implements the functions for TID allocation, freeing, and programming TID RcvArray entries in hardware for kernel clients. TID entries are managed via lists of TID groups similar to PSM. Furthermore, to track TID resource allocation for each request, software flows are also allocated and freed as needed. Since software flows consume large amount of memory for tracking TID allocation and freeing, it is generally desirable to allocate them dynamically in the send queue and only for TID RDMA requests, but pre-allocate them for receive queue because the send queue could have thousands of entries while the receive queue has only a limited number of entries. Signed-off-by: Mitko Haralanov <[email protected]> Signed-off-by: Ashutosh Dixit <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Kaike Wan <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 37356e7 commit 838b6fd

File tree

9 files changed

+1033
-18
lines changed

9 files changed

+1033
-18
lines changed

drivers/infiniband/hw/hfi1/hfi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ struct hfi1_ctxtdata {
303303
spinlock_t exp_lock;
304304
/* Queue for QP's waiting for HW TID flows */
305305
struct tid_queue flow_queue;
306+
/* Queue for QP's waiting for HW receive array entries */
307+
struct tid_queue rarr_queue;
306308
/* when waiting for rcv or pioavail */
307309
wait_queue_head_t wait;
308310
/* uuid from PSM */

drivers/infiniband/hw/hfi1/init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ int hfi1_create_ctxtdata(struct hfi1_pportdata *ppd, int numa,
372372
mutex_init(&rcd->exp_mutex);
373373
spin_lock_init(&rcd->exp_lock);
374374
INIT_LIST_HEAD(&rcd->flow_queue.queue_head);
375+
INIT_LIST_HEAD(&rcd->rarr_queue.queue_head);
375376

376377
hfi1_cdbg(PROC, "setting up context %u\n", rcd->ctxt);
377378

@@ -1596,7 +1597,7 @@ static void cleanup_device_data(struct hfi1_devdata *dd)
15961597
struct hfi1_ctxtdata *rcd = dd->rcd[ctxt];
15971598

15981599
if (rcd) {
1599-
hfi1_clear_tids(rcd);
1600+
hfi1_free_ctxt_rcv_groups(rcd);
16001601
hfi1_free_ctxt(rcd);
16011602
}
16021603
}

0 commit comments

Comments
 (0)