From e99f19e8128254cb570037fbf900d6155e1024bb Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Thu, 21 Sep 2017 11:57:58 +0900 Subject: [PATCH] hfi1/user_exp_rcv/setup: set length in tidinfo This was dropped early on by mistake/excessive haste, it's actually pretty useful. --- kernel/user_exp_rcv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/user_exp_rcv.c b/kernel/user_exp_rcv.c index adb95678..9a265b97 100644 --- a/kernel/user_exp_rcv.c +++ b/kernel/user_exp_rcv.c @@ -123,7 +123,7 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd, struct hfi1_tid_info *tinf uintptr_t vaddr = tinfo->vaddr; u32 tid[20]; /* at most 20 requests with this algorithm */ u16 tididx = 0; - u16 order; + s16 order; u32 npages; struct process_vm *vm = cpu_local_var(current)->vm; size_t base_pgsize; @@ -160,7 +160,7 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd, struct hfi1_tid_info *tinf phys = pte_get_phys(ptep); - for (order = 0; order < 20; order++) + for (order = 19; order >= 0; order--) { struct tid_group *grp; @@ -364,7 +364,8 @@ static int program_rcvarray(struct hfi1_filedata *fd, uintptr_t phys, if (ret) return ret; - tidinfo = rcventry2tidinfo(rcventry - uctxt->expected_base); + tidinfo = rcventry2tidinfo(rcventry - uctxt->expected_base) | + EXP_TID_SET(LEN, 1 << order); *ptid = tidinfo; grp->used++; grp->map |= 1 << idx++;