Commit 53c2a706 authored by Allen Pais's avatar Allen Pais Committed by Jason Gunthorpe

RDMA/bnxt_re: Convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the struct tasklet_struct
pointer to all tasklet callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Link: https://lore.kernel.org/r/20200903060637.424458-2-allen.lkml@gmail.comSigned-off-by: default avatarRomain Perier <romain.perier@gmail.com>
Signed-off-by: default avatarAllen Pais <allen.lkml@gmail.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 4b916ed9
...@@ -295,9 +295,9 @@ static void __wait_for_all_nqes(struct bnxt_qplib_cq *cq, u16 cnq_events) ...@@ -295,9 +295,9 @@ static void __wait_for_all_nqes(struct bnxt_qplib_cq *cq, u16 cnq_events)
} }
} }
static void bnxt_qplib_service_nq(unsigned long data) static void bnxt_qplib_service_nq(struct tasklet_struct *t)
{ {
struct bnxt_qplib_nq *nq = (struct bnxt_qplib_nq *)data; struct bnxt_qplib_nq *nq = from_tasklet(nq, t, nq_tasklet);
struct bnxt_qplib_hwq *hwq = &nq->hwq; struct bnxt_qplib_hwq *hwq = &nq->hwq;
int num_srqne_processed = 0; int num_srqne_processed = 0;
int num_cqne_processed = 0; int num_cqne_processed = 0;
...@@ -448,8 +448,7 @@ int bnxt_qplib_nq_start_irq(struct bnxt_qplib_nq *nq, int nq_indx, ...@@ -448,8 +448,7 @@ int bnxt_qplib_nq_start_irq(struct bnxt_qplib_nq *nq, int nq_indx,
nq->msix_vec = msix_vector; nq->msix_vec = msix_vector;
if (need_init) if (need_init)
tasklet_init(&nq->nq_tasklet, bnxt_qplib_service_nq, tasklet_setup(&nq->nq_tasklet, bnxt_qplib_service_nq);
(unsigned long)nq);
else else
tasklet_enable(&nq->nq_tasklet); tasklet_enable(&nq->nq_tasklet);
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#include "qplib_sp.h" #include "qplib_sp.h"
#include "qplib_fp.h" #include "qplib_fp.h"
static void bnxt_qplib_service_creq(unsigned long data); static void bnxt_qplib_service_creq(struct tasklet_struct *t);
/* Hardware communication channel */ /* Hardware communication channel */
static int __wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie) static int __wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie)
...@@ -79,7 +79,7 @@ static int __block_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie) ...@@ -79,7 +79,7 @@ static int __block_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie)
goto done; goto done;
do { do {
mdelay(1); /* 1m sec */ mdelay(1); /* 1m sec */
bnxt_qplib_service_creq((unsigned long)rcfw); bnxt_qplib_service_creq(&rcfw->creq.creq_tasklet);
} while (test_bit(cbit, cmdq->cmdq_bitmap) && --count); } while (test_bit(cbit, cmdq->cmdq_bitmap) && --count);
done: done:
return count ? 0 : -ETIMEDOUT; return count ? 0 : -ETIMEDOUT;
...@@ -369,9 +369,9 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, ...@@ -369,9 +369,9 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,
} }
/* SP - CREQ Completion handlers */ /* SP - CREQ Completion handlers */
static void bnxt_qplib_service_creq(unsigned long data) static void bnxt_qplib_service_creq(struct tasklet_struct *t)
{ {
struct bnxt_qplib_rcfw *rcfw = (struct bnxt_qplib_rcfw *)data; struct bnxt_qplib_rcfw *rcfw = from_tasklet(rcfw, t, creq.creq_tasklet);
struct bnxt_qplib_creq_ctx *creq = &rcfw->creq; struct bnxt_qplib_creq_ctx *creq = &rcfw->creq;
u32 type, budget = CREQ_ENTRY_POLL_BUDGET; u32 type, budget = CREQ_ENTRY_POLL_BUDGET;
struct bnxt_qplib_hwq *hwq = &creq->hwq; struct bnxt_qplib_hwq *hwq = &creq->hwq;
...@@ -685,8 +685,7 @@ int bnxt_qplib_rcfw_start_irq(struct bnxt_qplib_rcfw *rcfw, int msix_vector, ...@@ -685,8 +685,7 @@ int bnxt_qplib_rcfw_start_irq(struct bnxt_qplib_rcfw *rcfw, int msix_vector,
creq->msix_vec = msix_vector; creq->msix_vec = msix_vector;
if (need_init) if (need_init)
tasklet_init(&creq->creq_tasklet, tasklet_setup(&creq->creq_tasklet, bnxt_qplib_service_creq);
bnxt_qplib_service_creq, (unsigned long)rcfw);
else else
tasklet_enable(&creq->creq_tasklet); tasklet_enable(&creq->creq_tasklet);
rc = request_irq(creq->msix_vec, bnxt_qplib_creq_irq, 0, rc = request_irq(creq->msix_vec, bnxt_qplib_creq_irq, 0,
......
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