linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Allen Pais <allen.lkml@gmail.com>
Cc: selvin.xavier@broadcom.com, devesh.sharma@broadcom.com,
	somnath.kotur@broadcom.com, sriharsha.basavapatna@broadcom.com,
	nareshkumar.pbs@broadcom.com, keescook@chromium.org,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	Romain Perier <romain.perier@gmail.com>
Subject: Re: [PATCH 1/5] infiniband: bnxt_re: convert tasklets to use new tasklet_setup() API
Date: Mon, 17 Aug 2020 14:53:18 -0300	[thread overview]
Message-ID: <20200817175318.GW24045@ziepe.ca> (raw)
In-Reply-To: <20200817082844.21700-2-allen.lkml@gmail.com>

On Mon, Aug 17, 2020 at 01:58:40PM +0530, Allen Pais wrote:
> 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.
> 
> Signed-off-by: Romain Perier <romain.perier@gmail.com>
> Signed-off-by: Allen Pais <allen.lkml@gmail.com>
>  drivers/infiniband/hw/bnxt_re/qplib_fp.c   |  7 +++----
>  drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 13 ++++++-------
>  2 files changed, 9 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
> index 117b42349a28..62b01582aa1c 100644
> +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
> @@ -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;
>  	int num_srqne_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,
>  
>  	nq->msix_vec = msix_vector;
>  	if (need_init)
> -		tasklet_init(&nq->nq_tasklet, bnxt_qplib_service_nq,
> -			     (unsigned long)nq);
> +		tasklet_setup(&nq->nq_tasklet, bnxt_qplib_service_nq);
>  	else
>  		tasklet_enable(&nq->nq_tasklet);
>  
> diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
> index 4e211162acee..7261be29fb09 100644
> +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
> @@ -50,7 +50,7 @@
>  #include "qplib_sp.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 */
>  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)
>  		goto done;
>  	do {
>  		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);
>  done:
>  	return count ? 0 : -ETIMEDOUT;
> @@ -369,10 +369,10 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,
>  }
>  
>  /* 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_creq_ctx *creq = &rcfw->creq;
> +	struct bnxt_qplib_creq_ctx *creq = from_tasklet(creq, t, creq_tasklet);

This is just:

  struct bnxt_qplib_rcfw *rcfw = from_tasklet(rcfw, t, crew.creq_tasklet);

No need for the extra container_of

Jason

  reply	other threads:[~2020-08-17 17:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-17  8:28 [PATCH 0/5] infiniband: convert tasklets to use new tasklet_setup() Allen Pais
2020-08-17  8:28 ` [PATCH 1/5] infiniband: bnxt_re: convert tasklets to use new tasklet_setup() API Allen Pais
2020-08-17 17:53   ` Jason Gunthorpe [this message]
2020-08-18  9:19     ` Allen
2020-08-17  8:28 ` [PATCH 2/5] infiniband: hfi1: " Allen Pais
2020-08-17  8:28 ` [PATCH 3/5] infiniband: i40iw: " Allen Pais
2020-08-17  8:28 ` [PATCH 4/5] infiniband: qib: " Allen Pais
2020-08-17  8:28 ` [PATCH 5/5] infiniband: rxe: " Allen Pais

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200817175318.GW24045@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=allen.lkml@gmail.com \
    --cc=devesh.sharma@broadcom.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=nareshkumar.pbs@broadcom.com \
    --cc=romain.perier@gmail.com \
    --cc=selvin.xavier@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=sriharsha.basavapatna@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).