hfi1/user_exp_rcv: rework main loop

New loop now takes into account pages not physically contiguous.
Also some minor improvements, e.g. make the spin_lock used more locally,
reuse a group we had if we had one, etc.
This commit is contained in:
Dominique Martinet
2017-09-21 16:24:45 +09:00
committed by Balazs Gerofi
parent 0f8f88ca46
commit f5ced648ef
3 changed files with 178 additions and 176 deletions

View File

@@ -54,6 +54,15 @@
#include <hfi1/chip_registers.h>
#include <hfi1/chip.h>
//#define DEBUG_PRINT_CHIP
#ifdef DEBUG_PRINT_CHIP
#define dkprintf(...) kprintf(__VA_ARGS__)
#else
#define dkprintf(...) do { if(0) kprintf(__VA_ARGS__); } while (0)
#endif
/*
* index is the index into the receive array
*/
@@ -85,6 +94,8 @@ void hfi1_put_tid(struct hfi1_devdata *dd, u32 index,
| (u64)order << RCV_ARRAY_RT_BUF_SIZE_SHIFT
| ((pa >> RT_ADDR_SHIFT) & RCV_ARRAY_RT_ADDR_MASK)
<< RCV_ARRAY_RT_ADDR_SHIFT;
dkprintf("type %d, index 0x%x, pa 0x%lx, bsize 0x%lx, reg 0x%llx\n",
type, index, pa, (unsigned long)order, reg);
writeq(reg, base + (index * 8));
if (type == PT_EAGER)