Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2492322pxa; Mon, 17 Aug 2020 10:57:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXPWa0H/hkGg0vWjo2tzE7Z7G3JZuFRHbpzSg0SDmyqwdHq4IVw3N4EiBAnLN8D2WcVYqg X-Received: by 2002:a17:906:7f05:: with SMTP id d5mr15942826ejr.122.1597687045082; Mon, 17 Aug 2020 10:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597687045; cv=none; d=google.com; s=arc-20160816; b=UBRk/SLufmEoYOb0zJNaSFLynPqc0pw/UyoNeeXWPxf6pasMoVkQzeGOxwqO5A1a3o JosKEgdOJjpc+3xBZ9X0y9AcwV3G8jm2JnTP9nKTaorAxupOfgp+rDciIQIujxTGu3ae pgibu4JMUa/Cr7GpRsS3PczJShLEm85EVAu5gMqO+yRb8KsFp83dzCZo7L4dPC7lYdkr mtSztC70z8UxulHDXJbByGiyMvuUWS1dgfYbIFaTk6BdrSgOJ1ylddb9tt6DiGTg2xG0 dqMOSqO4sMNLMWx0xdKkJRPflVh+iJKtJXtP8jEcApGEm9N0+sL5KZhDMZReg08JW2Ep i/OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=9qJKHV+uR7EHxj6Xx8FbbDgPhogd8I9njcQU8EAXvkQ=; b=ljTdyfBZPTu3mwwZZBBRBDzMNFLF+YZ6JXCj+gZhpRU40HmpZZbeNqUp7JiwI7ZQUa fQYRx1ao5cCsag6wynqdNEY2teA5Wz9EsTN6QDSri49PqZ1vudEsyYJsOPWv5Uix6eYe eWdYrVxbgJS5BUOPQnCYWIMMZmrSC8HvQCux8Rz7YMcQNQL8d+QufsLxdgagAbk+XNIs A7RTkEiV7HmsrbCuNB9xPki91Ao/ADfL4/hzH8+dmcUiC1BmeNrs9epDeCoLv4MsYefi 69+k0f/79U/TOzoYlFg1EjUugX6gATPNTND6S23Gie8eflUcSP0gNtpZsszOFE2vYuXo myWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=eZR0WfgN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh4si1453568ejb.629.2020.08.17.10.57.02; Mon, 17 Aug 2020 10:57:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=eZR0WfgN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731610AbgHQRx1 (ORCPT + 99 others); Mon, 17 Aug 2020 13:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731600AbgHQRxX (ORCPT ); Mon, 17 Aug 2020 13:53:23 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C393AC061342 for ; Mon, 17 Aug 2020 10:53:20 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id x12so13106788qtp.1 for ; Mon, 17 Aug 2020 10:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9qJKHV+uR7EHxj6Xx8FbbDgPhogd8I9njcQU8EAXvkQ=; b=eZR0WfgN5VnjasTe4SSju/DBe5GM7/1zgG558EVIEYqjTyUtTzYQ9HQO8tZ/pjhXR4 y4MDdtYuAAwlwpXLG1N/fGPd2GrheSQvtp26XM7gOaX3NztXoqM6k9pRO/Gow4qk0aR3 BpPuw4JlOpLKZicE4gEzsIg0Fy9Nq/LwItDtcIVXVFACAQFUovgsDmYgv0FB4S0ztZLq 5P6Nqh5qURy6QR1nhiv3i9uQ9Kxe1h1H1e88am3REjCsiNneoTWSrw0uE1poR/cME3GJ gmIJRZI56BiHf81xGF37tpNxbhaN27HdFfunjzN/EjKZm2GbMXqD8c3Lop1cr5QD7nhR p5ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9qJKHV+uR7EHxj6Xx8FbbDgPhogd8I9njcQU8EAXvkQ=; b=WA3f0ipc4/lQoDArOgLfLjXbvUoxIp7XUlUx5ZMLrXznQYR/yfTJ1moyCAiCNefgEG /A4O16w5m6zy9i01dDYlyqDE2/pyfVTl/zSj7ZJ+G5cfHMSHTaRPXKKHZcPJSFSPLhzj +jXpE6G+8zU69nCAjfkUq5BycDYnWRipMNe9mkJxi2+d2CgXNlIqmBfNtbHkN9s3b38M 1zqCSrZMGUvr7+LalWvrz4x619xINQTwgkuIzjhMbXC+ZhYzHPyu1ufEw1xNCqDCG79i I07dLE9OqKGnRM2tAuqF495lXnhoJyos3qb7nR6N1qgy+87oprLFh5gNtlseeA8es6+e abjg== X-Gm-Message-State: AOAM531sRIoq0vWvBZyknhqnZl9uKBoAL2fJcw9jk4NPQN99R/CO7qbV zXCNJocy2tCUoTtaCKTnILjJXw== X-Received: by 2002:aed:3b7a:: with SMTP id q55mr14580291qte.78.1597686799970; Mon, 17 Aug 2020 10:53:19 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id 141sm17857695qke.41.2020.08.17.10.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 10:53:18 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1k7jJu-007tAD-4T; Mon, 17 Aug 2020 14:53:18 -0300 Date: Mon, 17 Aug 2020 14:53:18 -0300 From: Jason Gunthorpe To: Allen Pais 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 Subject: Re: [PATCH 1/5] infiniband: bnxt_re: convert tasklets to use new tasklet_setup() API Message-ID: <20200817175318.GW24045@ziepe.ca> References: <20200817082844.21700-1-allen.lkml@gmail.com> <20200817082844.21700-2-allen.lkml@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200817082844.21700-2-allen.lkml@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Signed-off-by: Allen Pais > 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