Commit 4be81991 authored by Ira Weiny's avatar Ira Weiny Committed by Greg Kroah-Hartman

staging/rdma/hfi1: Eliminate WARN_ON when VL is invalid

sdma_select_engine_vl only needs to protect itself from an invalid VL.
Something higher up the stack should be warning the user when they try
to use an SL which maps to an invalid VL.
Reviewed-by: default avatarDean Luick <dean.luick@intel.com>
Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: default avatarKaike Wan <kaike.wan@intel.com>
Signed-off-by: default avatarIra Weiny <iweiny@gmail.com>
Signed-off-by: default avatarJubin John <jubin.john@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9d2f53ef
...@@ -765,8 +765,14 @@ struct sdma_engine *sdma_select_engine_vl( ...@@ -765,8 +765,14 @@ struct sdma_engine *sdma_select_engine_vl(
struct sdma_map_elem *e; struct sdma_map_elem *e;
struct sdma_engine *rval; struct sdma_engine *rval;
if (WARN_ON(vl > 8)) /* NOTE This should only happen if SC->VL changed after the initial
return &dd->per_sdma[0]; * checks on the QP/AH
* Default will return engine 0 below
*/
if (vl >= num_vls) {
rval = NULL;
goto done;
}
rcu_read_lock(); rcu_read_lock();
m = rcu_dereference(dd->sdma_map); m = rcu_dereference(dd->sdma_map);
...@@ -778,6 +784,7 @@ struct sdma_engine *sdma_select_engine_vl( ...@@ -778,6 +784,7 @@ struct sdma_engine *sdma_select_engine_vl(
rval = e->sde[selector & e->mask]; rval = e->sde[selector & e->mask];
rcu_read_unlock(); rcu_read_unlock();
done:
rval = !rval ? &dd->per_sdma[0] : rval; rval = !rval ? &dd->per_sdma[0] : rval;
trace_hfi1_sdma_engine_select(dd, selector, vl, rval->this_idx); trace_hfi1_sdma_engine_select(dd, selector, vl, rval->this_idx);
return rval; return rval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment