Skip to content

Commit

Permalink
rxe: Remove all fast* module parameters
Browse files Browse the repository at this point in the history
Remove all fast* module parameters which
used to bypass tasklets.

Signed-off-by: Kamal Heib <[email protected]>
  • Loading branch information
Kamal Heib committed Jan 27, 2015
1 parent d232d69 commit 14cc93f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 54 deletions.
22 changes: 1 addition & 21 deletions drivers/infiniband/hw/rxe/rxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,6 @@ MODULE_AUTHOR("Bob Pearson, Frank Zago, John Groves");
MODULE_DESCRIPTION("Soft RDMA transport");
MODULE_LICENSE("Dual BSD/GPL");

int rxe_fast_comp = 2;
module_param_named(fast_comp, rxe_fast_comp, int, 0644);
MODULE_PARM_DESC(fast_comp,
"fast path call to completer (0=no, 1=no int context, 2=any context)");

int rxe_fast_resp = 2;
module_param_named(fast_resp, rxe_fast_resp, int, 0644);
MODULE_PARM_DESC(fast_resp,
"enable fast path call to responder (0=no, 1=no int context, 2=any context)");

int rxe_fast_req = 2;
module_param_named(fast_req, rxe_fast_req, int, 0644);
MODULE_PARM_DESC(fast_req,
"enable fast path call to requester (0=no, 1=no int context, 2=any context)");

int rxe_fast_arb = 2;
module_param_named(fast_arb, rxe_fast_arb, int, 0644);
MODULE_PARM_DESC(fast_arb,
"enable fast path call to arbiter (0=no, 1=no int context, 2=any context)");

int rxe_nsec_per_packet = 200;
module_param_named(nsec_per_packet, rxe_nsec_per_packet, int, 0644);
MODULE_PARM_DESC(nsec_per_packet,
Expand Down Expand Up @@ -408,7 +388,7 @@ static int rxe_init(struct rxe_dev *rxe)
/* init arbiter */
spin_lock_init(&rxe->arbiter.list_lock);
INIT_LIST_HEAD(&rxe->arbiter.qp_list);
rxe_init_task(rxe, &rxe->arbiter.task, &rxe_fast_arb,
rxe_init_task(rxe, &rxe->arbiter.task,
rxe, rxe_arbiter, "arb");

return 0;
Expand Down
4 changes: 0 additions & 4 deletions drivers/infiniband/hw/rxe/rxe_param.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,6 @@ extern int rxe_max_skb_per_qp;
extern int rxe_max_req_comp_gap;
extern int rxe_max_pkt_per_ack;
extern int rxe_default_mtu;
extern int rxe_fast_comp;
extern int rxe_fast_resp;
extern int rxe_fast_req;
extern int rxe_fast_arb;
extern int rxe_bypass_arbiter;

#endif /* RXE_PARAM_H */
6 changes: 3 additions & 3 deletions drivers/infiniband/hw/rxe/rxe_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
spin_lock_init(&qp->sq.sq_lock);
skb_queue_head_init(&qp->req_pkts);

rxe_init_task(rxe, &qp->req.task, &rxe_fast_req, qp,
rxe_init_task(rxe, &qp->req.task, qp,
rxe_requester, "req");
rxe_init_task(rxe, &qp->comp.task, &rxe_fast_comp, qp,
rxe_init_task(rxe, &qp->comp.task, qp,
rxe_completer, "comp");

init_timer(&qp->rnr_nak_timer);
Expand Down Expand Up @@ -324,7 +324,7 @@ static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp,

skb_queue_head_init(&qp->resp_pkts);

rxe_init_task(rxe, &qp->resp.task, &rxe_fast_resp, qp,
rxe_init_task(rxe, &qp->resp.task, qp,
rxe_responder, "resp");

qp->resp.opcode = OPCODE_NONE;
Expand Down
20 changes: 2 additions & 18 deletions drivers/infiniband/hw/rxe/rxe_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,10 @@ void rxe_do_task(unsigned long data)
task->ret = ret;
}

int rxe_init_task(void *obj, struct rxe_task *task, int *fast,
int rxe_init_task(void *obj, struct rxe_task *task,
void *arg, int (*func)(void *), char *name)
{
task->obj = obj;
task->fast = fast;
task->arg = arg;
task->func = func;
snprintf(task->name, sizeof(task->name), "%s", name);
Expand All @@ -134,24 +133,9 @@ void rxe_cleanup_task(struct rxe_task *task)
tasklet_kill(&task->tasklet);
}

/*
* depending on value of fast allow bypassing
* tasklet call or not
* 0 => never
* 1 => only if not in interrupt level
* >1 => always
*/
static inline int rxe_fast_path_ok(int fast)
{
if (fast == 0 || (fast == 1 && (in_irq() || irqs_disabled())))
return 0;
else
return 1;
}

void rxe_run_task(struct rxe_task *task, int sched)
{
if (sched || !rxe_fast_path_ok(*task->fast))
if (sched)
tasklet_schedule(&task->tasklet);
else
rxe_do_task((unsigned long)task);
Expand Down
10 changes: 2 additions & 8 deletions drivers/infiniband/hw/rxe/rxe_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ enum {
*/
struct rxe_task {
void *obj;
int *fast;
struct tasklet_struct tasklet;
int state;
spinlock_t state_lock; /* spinlock for task state */
Expand All @@ -59,11 +58,10 @@ struct rxe_task {

/*
* init rxe_task structure
* fast => address of control flag, likely a module parameter
* arg => parameter to pass to fcn
* fcn => function to call until it returns != 0
*/
int rxe_init_task(void *obj, struct rxe_task *task, int *fast,
int rxe_init_task(void *obj, struct rxe_task *task,
void *arg, int (*func)(void *), char *name);

/*
Expand All @@ -79,18 +77,14 @@ int __rxe_do_task(struct rxe_task *task);

/*
* common function called by any of the main tasklets
* if someone is calling the function on its own
* thread (fast path) then they must increment busy
* If there is any chance that there is additional
* work to do someone must reschedule the task before
* leaving
*/
void rxe_do_task(unsigned long data);

/*
* run a task, use fast path if no one else
* is currently running it and fast path is ok
* else schedule it to run as a tasklet
* run a task, else schedule it to run as a tasklet
*/
void rxe_run_task(struct rxe_task *task, int sched);

Expand Down

0 comments on commit 14cc93f

Please sign in to comment.