HFI1: adjust sdma_select_user_engine()

Conflicts:
	kernel/user_sdma.c
This commit is contained in:
Balazs Gerofi
2017-08-03 13:46:09 +09:00
parent b875b5186f
commit ec66229063
2 changed files with 20 additions and 5 deletions

View File

@ -798,20 +798,28 @@ struct sdma_engine *sdma_select_engine_vl(
if (vl >= num_vls) {
#else
if (vl >= HFI1_MAX_VLS_SUPPORTED) {
#endif /* __HFI1_ORIG__ */
#endif /* __HFI1_ORIG__ */
rval = NULL;
goto done;
}
#ifdef __HFI1_ORIG__
rcu_read_lock();
m = rcu_dereference(dd->sdma_map);
#else
m = (volatile struct sdma_vl_map *)dd->sdma_map;
#endif
if (unlikely(!m)) {
#ifdef __HFI1_ORIG__
rcu_read_unlock();
#endif
return &dd->per_sdma[0];
}
e = m->map[vl & m->mask];
rval = e->sde[selector & e->mask];
#ifdef __HFI1_ORIG__
rcu_read_unlock();
#endif
done:
rval = !rval ? &dd->per_sdma[0] : rval;
@ -881,6 +889,7 @@ static struct rhashtable_params sdma_rht_params = {
struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd,
u32 selector, u8 vl)
{
#ifdef __HFI1_ORIG__
struct sdma_rht_node *rht_node;
struct sdma_engine *sde = NULL;
const struct cpumask *current_mask = tsk_cpus_allowed(current);
@ -909,6 +918,7 @@ struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd,
return sde;
out:
#endif
return sdma_select_engine_vl(dd, selector, vl);
}
@ -3463,4 +3473,4 @@ void _sdma_engine_progress_schedule(
sde->progress_mask);
}
#endif /* __HFI1_ORIG__ */
#endif /* __HFI1_ORIG__ */

View File

@ -758,8 +758,13 @@ int hfi1_user_sdma_process_request(void *private_data, struct iovec *iovec,
dlid = be16_to_cpu(req->hdr.lrh[1]);
selector = dlid_to_selector(dlid);
selector += uctxt->ctxt + fd->subctxt;
/* TODO: sdma_select_user_engine check the rcu stuff */
//req->sde = sdma_select_user_engine(dd, selector, vl);
/* TODO: check the rcu stuff */
/*
* XXX: didn't we conclude that we don't need to worry about RCU here?
* the mapping is created at driver initialization, the rest of the
* accesses are read-only
*/
req->sde = sdma_select_user_engine(dd, selector, vl);
if (!req->sde || !sdma_running(req->sde)) {
ret = -ECOMM;
@ -1722,4 +1727,4 @@ static int sdma_rb_invalidate(void *arg, struct mmu_rb_node *mnode)
return 0;
}
#endif /* __HFI1_ORIG__ */
#endif /* __HFI1_ORIG__ */