HFI: port to SFI driver version 10.5.1.0.2

This commit is contained in:
Balazs Gerofi
2017-10-03 12:59:55 +09:00
parent a5aa68744f
commit 6959d5ead4
6 changed files with 90 additions and 1016 deletions

View File

@@ -673,9 +673,9 @@ ssize_t hfi1_aio_write(void *private_data, const struct iovec *iovec, unsigned l
TP("+");
/* Double check the sizes */
WARN_IF_SIZE_DIFFERENT(struct hfi1_filedata, 96);
WARN_IF_SIZE_DIFFERENT(struct hfi1_devdata, 7360);
WARN_IF_SIZE_DIFFERENT(struct iowait, 240);
WARN_IF_SIZE_DIFFERENT(struct hfi1_filedata, 104);
WARN_IF_SIZE_DIFFERENT(struct hfi1_devdata, 7232);
WARN_IF_SIZE_DIFFERENT(struct iowait, 248);
WARN_IF_SIZE_DIFFERENT(struct hfi1_user_sdma_pkt_q, 376);
WARN_IF_SIZE_DIFFERENT(struct sdma_engine, 1472);
WARN_IF_SIZE_DIFFERENT(struct sdma_state, 64);

File diff suppressed because it is too large Load Diff

View File

@@ -140,7 +140,9 @@ struct iowait {
struct sdma_engine *sde,
struct iowait_work *wait,
struct sdma_txreq *tx,
unsigned seq);
uint seq,
bool pkts_sent
);
void (*wakeup)(struct iowait *wait, int reason);
void (*sdma_drained)(struct iowait *wait);
seqlock_t *lock;
@@ -153,6 +155,7 @@ struct iowait {
u32 tx_count;
unsigned long flags;
struct iowait_work wait[IOWAIT_SES];
u8 starved_cnt;
};
#define SDMA_AVAIL_REASON 0
@@ -172,7 +175,8 @@ void iowait_init(
struct sdma_engine *sde,
struct iowait_work *wait,
struct sdma_txreq *tx,
unsigned seq),
uint seq,
bool pkts_sent),
void (*wakeup)(struct iowait *wait, int reason),
void (*sdma_drained)(struct iowait *wait));

View File

@@ -115,7 +115,7 @@ extern uint extended_psn;
struct hfi1_user_sdma_pkt_q {
struct list_head list;
unsigned ctxt;
unsigned subctxt;
u16 subctxt;
u16 n_max_reqs;
atomic_t n_reqs;
u16 reqidx;
@@ -147,4 +147,4 @@ int hfi1_user_sdma_process_request(struct file *, struct iovec *, unsigned long,
unsigned long *);
#endif /* __HFI1_ORIG__ */
#endif /* _HFI1_SDMA_H */
#endif /* _HFI1_SDMA_H */

View File

@@ -2411,7 +2411,8 @@ static inline u16 submit_tx(struct sdma_engine *sde, struct sdma_txreq *tx)
static int sdma_check_progress(
struct sdma_engine *sde,
struct iowait_work *wait,
struct sdma_txreq *tx)
struct sdma_txreq *tx,
bool pkts_sent)
{
int ret;
@@ -2425,7 +2426,7 @@ static int sdma_check_progress(
seq = raw_seqcount_begin(
(const seqcount_t *)&sde->head_lock.seqcount);
ret = wait->iow->sleep(sde, wait, tx, seq);
ret = wait->iow->sleep(sde, wait, tx, seq, pkts_sent);
if (ret == -EAGAIN)
sde->desc_avail = sdma_descq_freecnt(sde);
} else {
@@ -2441,6 +2442,7 @@ static int sdma_check_progress(
* @sde: sdma engine to use
* @wait: SE wait structure to use when full (may be NULL)
* @tx: sdma_txreq to submit
* @pkts_sent: has any packet been sent yet?
*
* The call submits the tx into the ring. If a iowait structure is non-NULL
* the packet will be queued to the list in wait.
@@ -2452,7 +2454,8 @@ static int sdma_check_progress(
*/
int sdma_send_txreq(struct sdma_engine *sde,
struct iowait_work *wait,
struct sdma_txreq *tx)
struct sdma_txreq *tx,
bool pkts_sent)
{
int ret = 0;
u16 tail;
@@ -2493,7 +2496,7 @@ unlock_noconn:
ret = -ECOMM;
goto unlock;
nodesc:
ret = sdma_check_progress(sde, wait, tx);
ret = sdma_check_progress(sde, wait, tx, pkts_sent);
if (ret == -EAGAIN) {
ret = 0;
goto retry;
@@ -2596,7 +2599,7 @@ unlock_noconn:
goto update_tail;
nodesc:
TP("+ nodesc:");
ret = sdma_check_progress(sde, wait, tx);
ret = sdma_check_progress(sde, wait, tx, submit_count > 0);
if (ret == -EAGAIN) {
ret = 0;
goto retry;

View File

@@ -568,8 +568,7 @@ int hfi1_map_device_addresses(struct hfi1_filedata *fd)
struct process *proc = cpu_local_var(current)->proc;
struct process_vm *vm = cpu_local_var(current)->vm;
struct hfi1_user_sdma_comp_q *cq = fd->cq;
struct hfi1_user_sdma_pkt_q *pq = fd->pq;
struct hfi1_devdata *dd = pq->dd;
struct hfi1_devdata *dd = fd->dd;
/*
* Map device addresses if not mapped or mapping changed.
@@ -591,8 +590,9 @@ int hfi1_map_device_addresses(struct hfi1_filedata *fd)
virt += PAGE_SIZE, phys += PAGE_SIZE) {
if (ihk_mc_pt_set_page(vm->address_space->page_table,
virt, phys, attr) < 0) {
kprintf("%s: WARNING: failed to map kregbase: 0x%lx -> 0x%lx\n",
kprintf("%s: ERROR: failed to map kregbase: 0x%lx -> 0x%lx\n",
__FUNCTION__, virt, phys);
return -1;
}
ptep = ihk_mc_pt_lookup_pte(vm->address_space->page_table,
@@ -633,8 +633,9 @@ int hfi1_map_device_addresses(struct hfi1_filedata *fd)
virt += PAGE_SIZE, phys += PAGE_SIZE) {
if (ihk_mc_pt_set_page(vm->address_space->page_table,
virt, phys, attr) < 0) {
kprintf("%s: WARNING: failed to map piobase: 0x%lx -> 0x%lx\n",
kprintf("%s: ERROR: failed to map piobase: 0x%lx -> 0x%lx\n",
__FUNCTION__, virt, phys);
return -1;
}
ptep = ihk_mc_pt_lookup_pte(vm->address_space->page_table,
@@ -676,8 +677,9 @@ int hfi1_map_device_addresses(struct hfi1_filedata *fd)
virt += PAGE_SIZE, phys += PAGE_SIZE) {
if (ihk_mc_pt_set_page(vm->address_space->page_table,
virt, phys, attr) < 0) {
kprintf("%s: WARNING: failed to map rcvarray_wc: 0x%lx -> 0x%lx\n",
kprintf("%s: ERROR: failed to map rcvarray_wc: 0x%lx -> 0x%lx\n",
__FUNCTION__, virt, phys);
return -1;
}
ptep = ihk_mc_pt_lookup_pte(vm->address_space->page_table,