From patchwork Wed Sep 9 08:44:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 261287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80CEDC43461 for ; Wed, 9 Sep 2020 08:45:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30428207DE for ; Wed, 9 Sep 2020 08:45:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e87TfbEk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729048AbgIIIpc (ORCPT ); Wed, 9 Sep 2020 04:45:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726708AbgIIIp0 (ORCPT ); Wed, 9 Sep 2020 04:45:26 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D505C061573 for ; Wed, 9 Sep 2020 01:45:26 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id x123so1545006pfc.7 for ; Wed, 09 Sep 2020 01:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H6jpxBumaCDaO159OdBzGuWOvuYBCCMGOhfIY3efDD4=; b=e87TfbEkOHmeaLvVEBSQ7eb9fxhktr6xDmp+PEBR6mc0ihepS4rhjT/YYh++bHhZvX mEnECIs+bxba1OrKreGLWtwjiRam9H2W/RnHgLbd4e/vdVcC7DbSyNrIpZe3cY0YRkSw qpjm4iZft/DI/7+ZMk4o4uzPjzugngXfJgPFXiyjsnp/jA/qvUH7LX55EuS138EhgwCI UdeGcIIUAe7NJnTmDO28MBHReL2EqUjq3EdmXORzeecKbbw5pVgSm4WOOGhTHLwmGqS8 1SeJQ6OUhjdZX/OsLVyv6J6zGA7CIm7JrWyDdDukGR39CzCDEkaVbhtl9GU1SshSDEiU a5QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H6jpxBumaCDaO159OdBzGuWOvuYBCCMGOhfIY3efDD4=; b=M9xG51XCrm5Yw0IHxmx98XhEAkLGvGI1duLgIPdeUWHuJx/ea6LRWHRCc80MFD3HMI Xf9NKEetOKaP06NiftE+84cCxlmrpfMgSjEY5p6g0eOGBK4Js5ZfHkuFSK4K/c1yAepS K2TSTf2XJqYaoa9Ho6tZ5N1vRFyN8aM/znTPR8NVNPnTm73Kf+pL7dT1N6pSUVWa2oWI jRPEV1rtSA0+/THoe3abbVkPh5bwlYSk1oggyAvL9NRd6q1ZsnwqVndUZ1zbNnxotWu1 5l2VfANswfY30Er2mntnP2c6AlGc3lSCdFpqrtO3KThV3FiFAxf1Sg/ImysZQhPEOCRy 9NRg== X-Gm-Message-State: AOAM5335YBIRplaUQ6Jyx5rS5bs2sbrNNIwLnLBLGFvajoj0I8A3FN0g Lz4COXzpW9tiPXFdmREReL0= X-Google-Smtp-Source: ABdhPJxywGQDK4mrr4Ox0qvLTc3cHcRpc08xN3fFnx6hXG/45uNjqgqEt93Syhe6yiAgrkirt+OTUg== X-Received: by 2002:a17:902:7d92:: with SMTP id a18mr1558034plm.68.1599641125661; Wed, 09 Sep 2020 01:45:25 -0700 (PDT) Received: from localhost.localdomain ([49.207.214.52]) by smtp.gmail.com with ESMTPSA id u21sm1468355pjn.27.2020.09.09.01.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 01:45:25 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v2 01/20] ethernet: alteon: convert tasklets to use new tasklet_setup() API Date: Wed, 9 Sep 2020 14:14:51 +0530 Message-Id: <20200909084510.648706-2-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com> References: <20200909084510.648706-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/net/ethernet/alteon/acenic.c | 9 +++++---- drivers/net/ethernet/alteon/acenic.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c index 8470c836fa18..056afc8bb519 100644 --- a/drivers/net/ethernet/alteon/acenic.c +++ b/drivers/net/ethernet/alteon/acenic.c @@ -1562,10 +1562,11 @@ static void ace_watchdog(struct net_device *data, unsigned int txqueue) } -static void ace_tasklet(unsigned long arg) +static void ace_tasklet(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *) arg; - struct ace_private *ap = netdev_priv(dev); + struct ace_private *ap = from_tasklet(ap, t, ace_tasklet); + struct net_device *dev = (struct net_device *)((char *)ap - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); int cur_size; cur_size = atomic_read(&ap->cur_rx_bufs); @@ -2269,7 +2270,7 @@ static int ace_open(struct net_device *dev) /* * Setup the bottom half rx ring refill handler */ - tasklet_init(&ap->ace_tasklet, ace_tasklet, (unsigned long)dev); + tasklet_setup(&ap->ace_tasklet, ace_tasklet); return 0; } diff --git a/drivers/net/ethernet/alteon/acenic.h b/drivers/net/ethernet/alteon/acenic.h index c670067b1541..4b02c705859c 100644 --- a/drivers/net/ethernet/alteon/acenic.h +++ b/drivers/net/ethernet/alteon/acenic.h @@ -776,7 +776,7 @@ static int ace_open(struct net_device *dev); static netdev_tx_t ace_start_xmit(struct sk_buff *skb, struct net_device *dev); static int ace_close(struct net_device *dev); -static void ace_tasklet(unsigned long dev); +static void ace_tasklet(struct tasklet_struct *t); static void ace_dump_trace(struct ace_private *ap); static void ace_set_multicast_list(struct net_device *dev); static int ace_change_mtu(struct net_device *dev, int new_mtu); From patchwork Wed Sep 9 08:44:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 261286 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3413C43461 for ; Wed, 9 Sep 2020 08:45:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 817FB215A4 for ; Wed, 9 Sep 2020 08:45:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kJfIkIxj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729449AbgIIIpk (ORCPT ); Wed, 9 Sep 2020 04:45:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728936AbgIIIpe (ORCPT ); Wed, 9 Sep 2020 04:45:34 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48F8AC061573 for ; Wed, 9 Sep 2020 01:45:33 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id j34so1570332pgi.7 for ; Wed, 09 Sep 2020 01:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rw8MiQTQyeul6XkGacM3BCi7JDAaTFdx0LbZCloJ4X0=; b=kJfIkIxjuB7xUwUYLXD57sRQ9l1l2aNGapSU6HgZGdBnm6QZqKj9GVKPhuscfBjNug jKk7H2cpWJa72Ydj4SJU8JyGWA+m+yNO4OOOydKqsJb1R2rXz2AUvcQaq9KzUkGwOEEn prIrX4tXFLij0HWZv1i/2J7YpkEK0PmSgE5vwoxo1WQFd9z2wdI3MyNoctQ1D1vH37pt W/BaRrffQ0W+RWm9/zHoR9sqS7utXGS1MrM8WjQ7Uj6rpdzg2sqLjPxpEugyZaKs3IGc CbDGp89hSvz4GTWHEZp9W/RODIpsLKhF7bpm5xu32btnWNXgS6WTCk+1ezbI8lEVfiMm GBPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rw8MiQTQyeul6XkGacM3BCi7JDAaTFdx0LbZCloJ4X0=; b=Stvz1j6HDtYz3+MnY5QhHULfPx6NIcq/RKPgI8Tb2NK7ukl956pBuplxl/tULxCAWW +/VXyQLttQS/1J3TyMXWqNb/jFuBTKGfMw8evijPw2dVQP7fKfcpsTlAUTfffD/c7a6E H6JYfm0HGCVkXcg5dZB6g3VTpv0TyNlOekOhDxF0y9uxygJ7ivH8GH6B8eZYDd8+cInw 1Uz94rf+De6mtT/kuwt/o5zBhXKpPARF/JXTva6xrwypZOwDmfFBjTU7SKFRjVhgvz8N 7jEDmDw8u0I/dhZrELyDxW6MAav66FTlq5OQpNNSJn+9q8CFjYFSyl4sUV25vf+HSxQv XEeg== X-Gm-Message-State: AOAM532gcncPNs5bYh6QZx/MPx4I7uJ8AEnKNvtTr9NxOEE7a55Cpbe9 sFBJCjmQkbK36Ha/HX/Yho0= X-Google-Smtp-Source: ABdhPJw3ymAn+UwM2jsAickgp16PgvKqqLqMzdZinx5AP3Qau9q0xW7rsfsbGqbJ1x8zEWjrm8McHw== X-Received: by 2002:a63:490f:: with SMTP id w15mr2185787pga.323.1599641132857; Wed, 09 Sep 2020 01:45:32 -0700 (PDT) Received: from localhost.localdomain ([49.207.214.52]) by smtp.gmail.com with ESMTPSA id u21sm1468355pjn.27.2020.09.09.01.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 01:45:32 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v2 03/20] broadcom: cnic: convert tasklets to use new tasklet_setup() API Date: Wed, 9 Sep 2020 14:14:53 +0530 Message-Id: <20200909084510.648706-4-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com> References: <20200909084510.648706-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/net/ethernet/broadcom/cnic.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 84536292b031..f7f10cfb3476 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c @@ -3009,10 +3009,10 @@ static int cnic_service_bnx2(void *data, void *status_blk) return cnic_service_bnx2_queues(dev); } -static void cnic_service_bnx2_msix(unsigned long data) +static void cnic_service_bnx2_msix(struct tasklet_struct *t) { - struct cnic_dev *dev = (struct cnic_dev *) data; - struct cnic_local *cp = dev->cnic_priv; + struct cnic_local *cp = from_tasklet(cp, t, cnic_irq_task); + struct cnic_dev *dev = cp->dev; cp->last_status_idx = cnic_service_bnx2_queues(dev); @@ -3134,10 +3134,10 @@ static u32 cnic_service_bnx2x_kcq(struct cnic_dev *dev, struct kcq_info *info) return last_status; } -static void cnic_service_bnx2x_bh(unsigned long data) +static void cnic_service_bnx2x_bh(struct tasklet_struct *t) { - struct cnic_dev *dev = (struct cnic_dev *) data; - struct cnic_local *cp = dev->cnic_priv; + struct cnic_local *cp = from_tasklet(cp, t, cnic_irq_task); + struct cnic_dev *dev = cp->dev; struct bnx2x *bp = netdev_priv(dev->netdev); u32 status_idx, new_status_idx; @@ -4458,8 +4458,7 @@ static int cnic_init_bnx2_irq(struct cnic_dev *dev) CNIC_WR(dev, base + BNX2_HC_CMD_TICKS_OFF, (64 << 16) | 220); cp->last_status_idx = cp->status_blk.bnx2->status_idx; - tasklet_init(&cp->cnic_irq_task, cnic_service_bnx2_msix, - (unsigned long) dev); + tasklet_setup(&cp->cnic_irq_task, cnic_service_bnx2_msix); err = cnic_request_irq(dev); if (err) return err; @@ -4868,8 +4867,7 @@ static int cnic_init_bnx2x_irq(struct cnic_dev *dev) struct cnic_eth_dev *ethdev = cp->ethdev; int err = 0; - tasklet_init(&cp->cnic_irq_task, cnic_service_bnx2x_bh, - (unsigned long) dev); + tasklet_setup(&cp->cnic_irq_task, cnic_service_bnx2x_bh); if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) err = cnic_request_irq(dev); From patchwork Wed Sep 9 08:44:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 261285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01CA2C43461 for ; Wed, 9 Sep 2020 08:46:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B836120758 for ; Wed, 9 Sep 2020 08:45:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tGIg/cIq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729785AbgIIIp7 (ORCPT ); Wed, 9 Sep 2020 04:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728936AbgIIIpp (ORCPT ); Wed, 9 Sep 2020 04:45:45 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB2B1C061755 for ; Wed, 9 Sep 2020 01:45:44 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id z19so1543894pfn.8 for ; Wed, 09 Sep 2020 01:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1YHBKbKXVonra1FrmypkxMUNqk0ty60Q+d3VYi9UEnM=; b=tGIg/cIqpu3HSMhRr1nP4af7ith9BHAX3tcQBgXguf0mnX2CLpB27PTXLcLXVGMWl6 /UE14Suilwt/8SkUS4UWlTVKaOdNIlR7pL/YVQdDlKI1JaUGsbRzG8/nkyN3ZA9aTJQz 6+1WBfo/mhzm8v6/cvewEVbKJ8ystDofIWCHMrfxvwCJjPoMbAfoFqR32qRyRgN/id0i weBBWwUjkIEfFsS1SEDnnir9SzTd9gHMuL8zcojq3v0g5o3Tsxipl/m41weEuvD4kINt f7MVUlTjftisre0LPC0GtvLzg+j9AFwt6ntfmKT5fIWRRwTWbDP/YdsprIUdnABJgS8Y 604Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1YHBKbKXVonra1FrmypkxMUNqk0ty60Q+d3VYi9UEnM=; b=kEuqkJSyeEez5Xh7xAdgBl0RAFICajbdjQTJzPb4tCU/dgDMPNc4JVxj3u/q8faBV/ OA1Rli4Yr2KppW+jSF1Hpndoi6JECISVwaB5nyIpS8Wh8F5Z30JpDknpGUP81SJtjwn6 At9hMCzEm7Q8loCQGF1WXrujOXkLF9bgmM9JdB8IiI3NLOA31PIPljfF/3keyrx0Akwx sI4DccetIDPqg1LqTboYODr2Zvat3VwKndvh4/B+WcbacWlY2mr6dhsqeh45co2zhdWf WRuHmSnHSshxhlOz2cSLCjLZrHq0LFLG4mWx+No0/AFdS5YBg+r/SDZkB3fA1qSD0/+a eLRQ== X-Gm-Message-State: AOAM530dWoqQaO9xob487kOZG1UOLP8J2dIENjgXRgzskFLlgj85jeVA 5gPD9+Q/fEfjb73p6mR6dZg= X-Google-Smtp-Source: ABdhPJwcZT6Cj/HKRsrBZz986uJMJRUGsui7paZcVL9dtOkUQttPbc8YVTOrkiDQB+zM2IC1w0TK1g== X-Received: by 2002:a17:902:59d8:b029:d0:89f1:9e2d with SMTP id d24-20020a17090259d8b02900d089f19e2dmr3193368plj.9.1599641144501; Wed, 09 Sep 2020 01:45:44 -0700 (PDT) Received: from localhost.localdomain ([49.207.214.52]) by smtp.gmail.com with ESMTPSA id u21sm1468355pjn.27.2020.09.09.01.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 01:45:44 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v2 06/20] ethernet: chelsio: convert tasklets to use new tasklet_setup() API Date: Wed, 9 Sep 2020 14:14:56 +0530 Message-Id: <20200909084510.648706-7-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com> References: <20200909084510.648706-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/net/ethernet/chelsio/cxgb/sge.c | 12 ++++++++---- drivers/net/ethernet/chelsio/cxgb3/sge.c | 18 ++++++++---------- drivers/net/ethernet/chelsio/cxgb4/sge.c | 16 ++++++++-------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb/sge.c b/drivers/net/ethernet/chelsio/cxgb/sge.c index 47b5c8e2104b..5f999187038c 100644 --- a/drivers/net/ethernet/chelsio/cxgb/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c @@ -239,8 +239,10 @@ struct sched { unsigned int num; /* num skbs in per port queues */ struct sched_port p[MAX_NPORTS]; struct tasklet_struct sched_tsk;/* tasklet used to run scheduler */ + struct sge *sge; }; -static void restart_sched(unsigned long); + +static void restart_sched(struct tasklet_struct *t); /* @@ -378,7 +380,8 @@ static int tx_sched_init(struct sge *sge) return -ENOMEM; pr_debug("tx_sched_init\n"); - tasklet_init(&s->sched_tsk, restart_sched, (unsigned long) sge); + tasklet_setup(&s->sched_tsk, restart_sched); + s->sge = sge; sge->tx_sched = s; for (i = 0; i < MAX_NPORTS; i++) { @@ -1301,9 +1304,10 @@ static inline void reclaim_completed_tx(struct sge *sge, struct cmdQ *q) * Called from tasklet. Checks the scheduler for any * pending skbs that can be sent. */ -static void restart_sched(unsigned long arg) +static void restart_sched(struct tasklet_struct *t) { - struct sge *sge = (struct sge *) arg; + struct sched *s = from_tasklet(s, t, sched_tsk); + struct sge *sge = s->sge; struct adapter *adapter = sge->adapter; struct cmdQ *q = &sge->cmdQ[0]; struct sk_buff *skb; diff --git a/drivers/net/ethernet/chelsio/cxgb3/sge.c b/drivers/net/ethernet/chelsio/cxgb3/sge.c index 6dabbf1502c7..4dadb04276d5 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c @@ -1516,14 +1516,14 @@ static int ctrl_xmit(struct adapter *adap, struct sge_txq *q, /** * restart_ctrlq - restart a suspended control queue - * @qs: the queue set cotaining the control queue + * @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx control queue. */ -static void restart_ctrlq(unsigned long data) +static void restart_ctrlq(struct tasklet_struct *t) { struct sk_buff *skb; - struct sge_qset *qs = (struct sge_qset *)data; + struct sge_qset *qs = from_tasklet(qs, t, txq[TXQ_CTRL].qresume_tsk); struct sge_txq *q = &qs->txq[TXQ_CTRL]; spin_lock(&q->lock); @@ -1733,14 +1733,14 @@ again: reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK); /** * restart_offloadq - restart a suspended offload queue - * @qs: the queue set cotaining the offload queue + * @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx offload queue. */ -static void restart_offloadq(unsigned long data) +static void restart_offloadq(struct tasklet_struct *t) { struct sk_buff *skb; - struct sge_qset *qs = (struct sge_qset *)data; + struct sge_qset *qs = from_tasklet(qs, t, txq[TXQ_OFLD].qresume_tsk); struct sge_txq *q = &qs->txq[TXQ_OFLD]; const struct port_info *pi = netdev_priv(qs->netdev); struct adapter *adap = pi->adapter; @@ -3084,10 +3084,8 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, skb_queue_head_init(&q->txq[i].sendq); } - tasklet_init(&q->txq[TXQ_OFLD].qresume_tsk, restart_offloadq, - (unsigned long)q); - tasklet_init(&q->txq[TXQ_CTRL].qresume_tsk, restart_ctrlq, - (unsigned long)q); + tasklet_setup(&q->txq[TXQ_OFLD].qresume_tsk, restart_offloadq); + tasklet_setup(&q->txq[TXQ_CTRL].qresume_tsk, restart_ctrlq); q->fl[0].gen = q->fl[1].gen = 1; q->fl[0].size = p->fl_size; diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c index 869431a1eedd..af4839e7c07e 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c @@ -2660,15 +2660,15 @@ static int ctrl_xmit(struct sge_ctrl_txq *q, struct sk_buff *skb) /** * restart_ctrlq - restart a suspended control queue - * @data: the control queue to restart + * @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx control queue. */ -static void restart_ctrlq(unsigned long data) +static void restart_ctrlq(struct tasklet_struct *t) { struct sk_buff *skb; unsigned int written = 0; - struct sge_ctrl_txq *q = (struct sge_ctrl_txq *)data; + struct sge_ctrl_txq *q = from_tasklet(q, t, qresume_tsk); spin_lock(&q->sendq.lock); reclaim_completed_tx_imm(&q->q); @@ -2961,13 +2961,13 @@ static int ofld_xmit(struct sge_uld_txq *q, struct sk_buff *skb) /** * restart_ofldq - restart a suspended offload queue - * @data: the offload queue to restart + * @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx offload queue. */ -static void restart_ofldq(unsigned long data) +static void restart_ofldq(struct tasklet_struct *t) { - struct sge_uld_txq *q = (struct sge_uld_txq *)data; + struct sge_uld_txq *q = from_tasklet(q, t, qresume_tsk); spin_lock(&q->sendq.lock); q->full = 0; /* the queue actually is completely empty now */ @@ -4580,7 +4580,7 @@ int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq, init_txq(adap, &txq->q, FW_EQ_CTRL_CMD_EQID_G(ntohl(c.cmpliqid_eqid))); txq->adap = adap; skb_queue_head_init(&txq->sendq); - tasklet_init(&txq->qresume_tsk, restart_ctrlq, (unsigned long)txq); + tasklet_setup(&txq->qresume_tsk, restart_ctrlq); txq->full = 0; return 0; } @@ -4670,7 +4670,7 @@ int t4_sge_alloc_uld_txq(struct adapter *adap, struct sge_uld_txq *txq, txq->q.q_type = CXGB4_TXQ_ULD; txq->adap = adap; skb_queue_head_init(&txq->sendq); - tasklet_init(&txq->qresume_tsk, restart_ofldq, (unsigned long)txq); + tasklet_setup(&txq->qresume_tsk, restart_ofldq); txq->full = 0; txq->mapping_err = 0; return 0; From patchwork Wed Sep 9 08:44:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 261284 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37882C433E2 for ; Wed, 9 Sep 2020 08:46:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE3F5215A4 for ; Wed, 9 Sep 2020 08:46:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UQoXF0jJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729911AbgIIIqF (ORCPT ); Wed, 9 Sep 2020 04:46:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729507AbgIIIpv (ORCPT ); Wed, 9 Sep 2020 04:45:51 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06F6BC061573 for ; Wed, 9 Sep 2020 01:45:51 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id 7so1555907pgm.11 for ; Wed, 09 Sep 2020 01:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZEmlUg19qzoBm1BuvHVSKp+FeDxOQArVCaZ12ri1ZPo=; b=UQoXF0jJXo/QZPZi+O87UxeUf8IDHmfXjftSHkdgz7T5t3zcaNf0YArXFVEGgQbUDo BaRjrhW1VY5tmDwPDXHrlfIcWfCWL+rVEEv0ZSNpSmUGmZcPUQNT/lwu9wfhxZm9cZha FD0/NJavWkzCjW+uh0o1tVs7IC16NOFLSXTUDhkGV6C7+ITrt2XbPKnmJYsGXfCGdahw yMteFlxcJmOwOE2N4MDrqU7c1A0beqF4oULnV7sNwDKlVw7tH8yb4JnFqjWjwNZMmq0u R6NUvHAEvF3ZV/bBw8BKP82ja8zmo+AQAGO7cwJWmhaGHq53dFmGnOD2mj9H2XKar86V xFEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZEmlUg19qzoBm1BuvHVSKp+FeDxOQArVCaZ12ri1ZPo=; b=mZBA98FmxJBz6Tmmk5gvCRsdyA3vUZiFQjP/BiokW50I/voox1KxaqRCAZGy7/DKnb RaTzqL7DcwVex9sLYChiQYpmf3+7T8jH7RtbSK1CimK3qnty3q3MzORpQcAbcjU9Ryd+ oelPi/sGiD1Ev4TyK32InY0ykLQVPUKvQACejQTxO5cQo2KNTg1AA4OfzBzKB+muR8NY GCzMMLT3Z7Y8B0SiLmc8C/iEacdIQwP4EwGFBAOixpXMDSnYr6KKxk51bnGs5d8Kb0iv HXyTBFMOX4bqcl02JJ19uroQlRbkpq3QGXMYKZ4mRU8C262vApMhMfb9UXJue5nVCQCF 5y2g== X-Gm-Message-State: AOAM531H6pqpz0vUEFlld4Gl/pYL73MMv0Ostz6IJEamWZKqJf1akgus Tz85hnlDcD+k79YBoBx18vs= X-Google-Smtp-Source: ABdhPJymLcOETdDB2iWln5YkeHdjdhZbqPhHEmger4K3hkucIqZKbgx9GQLwD6TKsQeE4wy8d2P5iQ== X-Received: by 2002:a62:3083:: with SMTP id w125mr2699844pfw.81.1599641148143; Wed, 09 Sep 2020 01:45:48 -0700 (PDT) Received: from localhost.localdomain ([49.207.214.52]) by smtp.gmail.com with ESMTPSA id u21sm1468355pjn.27.2020.09.09.01.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 01:45:47 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v2 07/20] ethernet: dlink: convert tasklets to use new tasklet_setup() API Date: Wed, 9 Sep 2020 14:14:57 +0530 Message-Id: <20200909084510.648706-8-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com> References: <20200909084510.648706-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/net/ethernet/dlink/sundance.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c index b3f8597e77aa..58022396b053 100644 --- a/drivers/net/ethernet/dlink/sundance.c +++ b/drivers/net/ethernet/dlink/sundance.c @@ -429,8 +429,8 @@ static void init_ring(struct net_device *dev); static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev); static int reset_tx (struct net_device *dev); static irqreturn_t intr_handler(int irq, void *dev_instance); -static void rx_poll(unsigned long data); -static void tx_poll(unsigned long data); +static void rx_poll(struct tasklet_struct *t); +static void tx_poll(struct tasklet_struct *t); static void refill_rx (struct net_device *dev); static void netdev_error(struct net_device *dev, int intr_status); static void netdev_error(struct net_device *dev, int intr_status); @@ -537,8 +537,8 @@ static int sundance_probe1(struct pci_dev *pdev, np->msg_enable = (1 << debug) - 1; spin_lock_init(&np->lock); spin_lock_init(&np->statlock); - tasklet_init(&np->rx_tasklet, rx_poll, (unsigned long)dev); - tasklet_init(&np->tx_tasklet, tx_poll, (unsigned long)dev); + tasklet_setup(&np->rx_tasklet, rx_poll); + tasklet_setup(&np->tx_tasklet, tx_poll); ring_space = dma_alloc_coherent(&pdev->dev, TX_TOTAL_SIZE, &ring_dma, GFP_KERNEL); @@ -1054,10 +1054,9 @@ static void init_ring(struct net_device *dev) } } -static void tx_poll (unsigned long data) +static void tx_poll(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *)data; - struct netdev_private *np = netdev_priv(dev); + struct netdev_private *np = from_tasklet(np, t, tx_tasklet); unsigned head = np->cur_task % TX_RING_SIZE; struct netdev_desc *txdesc = &np->tx_ring[(np->cur_tx - 1) % TX_RING_SIZE]; @@ -1312,10 +1311,11 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) return IRQ_RETVAL(handled); } -static void rx_poll(unsigned long data) +static void rx_poll(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *)data; - struct netdev_private *np = netdev_priv(dev); + struct netdev_private *np = from_tasklet(np, t, rx_tasklet); + struct net_device *dev = (struct net_device *)((char *)np - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); int entry = np->cur_rx % RX_RING_SIZE; int boguscnt = np->budget; void __iomem *ioaddr = np->base; From patchwork Wed Sep 9 08:45:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 261283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AE5FC10DAA for ; Wed, 9 Sep 2020 08:46:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D35A21D7A for ; Wed, 9 Sep 2020 08:46:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U92Ifl+U" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729953AbgIIIqV (ORCPT ); Wed, 9 Sep 2020 04:46:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729808AbgIIIp7 (ORCPT ); Wed, 9 Sep 2020 04:45:59 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23799C061573 for ; Wed, 9 Sep 2020 01:45:59 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id u13so1591200pgh.1 for ; Wed, 09 Sep 2020 01:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nrLJ1wxGaA9ONEh/pOZ2pIe/eGFDTsPnlUFuXEF5U7Q=; b=U92Ifl+UoXjQjymBcD3UQyWITzndeqj4PNDWD8KIoVjZgXa/X1I6tC30DEqnh+WvAX N8U2axoBhW1Tgq6pMRFrqpNns5ovTA0qDAam3mBhdmlyMI22xMBBHvsYgF4c2QirGz0v 2+w0IdtCKn8Hs8XJe6IjW/eLDyAaAR9X1tIvd/hvbye8xKp8hcYv2RYF0ZLlIKpXxVUC Q8sx6ijPjOnemhjk8mmWplKrIAN+4T7X2wgvbCLzEP/3k9hWKrtrdaj0bxJJg9bNtMXh a7N6AaXSDCcs3m1Cm3MyjIy2io/55KM9KylXF6rX6vExxvVWq15KHJqXT313qsn1xGPC lTmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nrLJ1wxGaA9ONEh/pOZ2pIe/eGFDTsPnlUFuXEF5U7Q=; b=QSsq9LzfG34vNIr7uiUoCz3J6A5DwilkjLuC0TO5eWwxkVlQTunJT2ffB1pjaumX+y C0Z9Bqi+8dgUpUrTwHzpQupjDlNEqRjTLSSBYUytEpnuHDICrBLQS9bF9lzfyHh8zJAb 5o86FsMCwicsZdcZIIeG/cn1eGV3/eH7LADxt/STRkM0qYaYlHqQK/q4gjUOsDInqQoQ twy3YpQEh9TKkPYXHQpOf0WwvbQ0tp9YW0mAjx+B7GK/3/Sl/o0/57gyZDb5b83tkwHj lz+84HUnlGmifFUA0Ti2DdGSoeFncuPzranvAjRiuA6xHymn8vLbHed05fC/mdGadXCE 9/VA== X-Gm-Message-State: AOAM532yfA/aTOTJStutuL9Y2ma3aUlvSoPvPeW3b8Y4DBTHLIZqFZRQ 7n8lO0DJLmAJg2RxlxkYnq0= X-Google-Smtp-Source: ABdhPJwhO1UHj0xX8vFdRj673c2I6xPabA0H9WeVXGSld7GrDKDCp3wvpBJTQNc+uf9i3PH+fN4VeQ== X-Received: by 2002:a63:1455:: with SMTP id 21mr2341060pgu.52.1599641158714; Wed, 09 Sep 2020 01:45:58 -0700 (PDT) Received: from localhost.localdomain ([49.207.214.52]) by smtp.gmail.com with ESMTPSA id u21sm1468355pjn.27.2020.09.09.01.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 01:45:58 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v2 10/20] ethernet: ibmvnic: convert tasklets to use new tasklet_setup() API Date: Wed, 9 Sep 2020 14:15:00 +0530 Message-Id: <20200909084510.648706-11-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com> References: <20200909084510.648706-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/net/ethernet/ibm/ibmvnic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index d3a774331afc..1a3e65bae17f 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4810,9 +4810,9 @@ static irqreturn_t ibmvnic_interrupt(int irq, void *instance) return IRQ_HANDLED; } -static void ibmvnic_tasklet(void *data) +static void ibmvnic_tasklet(struct tasklet_struct *t) { - struct ibmvnic_adapter *adapter = data; + struct ibmvnic_adapter *adapter = from_tasklet(adapter, t, tasklet); struct ibmvnic_crq_queue *queue = &adapter->crq; union ibmvnic_crq *crq; unsigned long flags; @@ -4947,8 +4947,7 @@ static int init_crq_queue(struct ibmvnic_adapter *adapter) retrc = 0; - tasklet_init(&adapter->tasklet, (void *)ibmvnic_tasklet, - (unsigned long)adapter); + tasklet_setup(&adapter->tasklet, (void *)ibmvnic_tasklet); netdev_dbg(adapter->netdev, "registering irq 0x%x\n", vdev->irq); snprintf(crq->name, sizeof(crq->name), "ibmvnic-%x", From patchwork Wed Sep 9 08:45:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 261281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4E7FC43461 for ; Wed, 9 Sep 2020 08:46:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7CDD321919 for ; Wed, 9 Sep 2020 08:46:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uFnwHD9W" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730115AbgIIIqj (ORCPT ); Wed, 9 Sep 2020 04:46:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbgIIIqL (ORCPT ); Wed, 9 Sep 2020 04:46:11 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBBBFC061573 for ; Wed, 9 Sep 2020 01:46:09 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id 7so1556507pgm.11 for ; Wed, 09 Sep 2020 01:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x+vfSm1yZ1eR3JadcSzJY6I4W3670E5ZjWQPr/OYozg=; b=uFnwHD9WO77HXD+72QxGPT/ZvJyLKXvo6OIq4FleTpkFG56RItVSzT+R3Jn0YFflYh 2p4QUWlBoqAvpG3J2JKfEKjRoAt0ZIPZ7QknVSRtydMGLvcz3KFwyeWP4ml0ofmvdlQW QGqHKJT5PbsRWZyDuPILOtqJLu+8utMppVXTpu/aBOzrICAltruBmqBSY49ePOuwYwxr INVU2TPJxAfAr3H3MKgTLgTpZxs4QFxXp9d6/YxYa1sarb6Ho2aNuvsLeSTGQT5mmsVv sxyshKJTUWz+Dsgjw/PVtnFP/ekca6KpHElLFZA9fZiPps7UmN+6klUFgH2y9+7RaJ3c IWzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x+vfSm1yZ1eR3JadcSzJY6I4W3670E5ZjWQPr/OYozg=; b=Opj12rIy4p639fUwU5fBZ+qA7p5yIlQUnhSH0NQOVg4unEwOUC60pR/v/yJWAEopuX +6IlknotWyJSaiDM/+QesKEG3woDzW79VA+jxM08a07pyNbinc4DGtCtZdMnYHaA61NP lnkNBkPOs5ca86HLgOHrUJSbiSdrfF2At8i9WDtVhPSg5yy5OMNrzReBlvFiEK7qrAlt enyFhknYr/zJ9du74KGh/+JJZRkv5rHoL/zmjvB0S8b185isVPPBiHQYfOWn5y26GN/P w0yBdl/4ocR/7TnAkFrFfxrQbEebkNr2kQi7AgksjX91+UWuVuvTPeucG89MgNJJr/Ng CG/Q== X-Gm-Message-State: AOAM531fTVWlpGPCglxVYHUgDYeCJhE5M3SW1oFwhQsyGHpzp3JDBFrS a+HybgWGnKcsu6BdKKpqbsM= X-Google-Smtp-Source: ABdhPJzRxsgd9qzISJ4YQO7xn6GCSS+u0JLs4dPzpb51tv7B0mo90B/jM1tOo+GA00rnXq09PaD66Q== X-Received: by 2002:a65:5689:: with SMTP id v9mr2283456pgs.271.1599641169386; Wed, 09 Sep 2020 01:46:09 -0700 (PDT) Received: from localhost.localdomain ([49.207.214.52]) by smtp.gmail.com with ESMTPSA id u21sm1468355pjn.27.2020.09.09.01.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 01:46:08 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v2 13/20] ethernet: mellanox: convert tasklets to use new tasklet_setup() API Date: Wed, 9 Sep 2020 14:15:03 +0530 Message-Id: <20200909084510.648706-14-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com> References: <20200909084510.648706-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/net/ethernet/mellanox/mlx4/cq.c | 4 ++-- drivers/net/ethernet/mellanox/mlx4/eq.c | 3 +-- drivers/net/ethernet/mellanox/mlx4/mlx4.h | 2 +- drivers/net/ethernet/mellanox/mlx5/core/cq.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 3 +-- drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c | 7 +++---- drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h | 2 +- drivers/net/ethernet/mellanox/mlxsw/pci.c | 12 ++++++------ 8 files changed, 17 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/cq.c b/drivers/net/ethernet/mellanox/mlx4/cq.c index 65f8a4b6ed0c..3b8576b9c2f9 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cq.c +++ b/drivers/net/ethernet/mellanox/mlx4/cq.c @@ -55,11 +55,11 @@ #define TASKLET_MAX_TIME 2 #define TASKLET_MAX_TIME_JIFFIES msecs_to_jiffies(TASKLET_MAX_TIME) -void mlx4_cq_tasklet_cb(unsigned long data) +void mlx4_cq_tasklet_cb(struct tasklet_struct *t) { unsigned long flags; unsigned long end = jiffies + TASKLET_MAX_TIME_JIFFIES; - struct mlx4_eq_tasklet *ctx = (struct mlx4_eq_tasklet *)data; + struct mlx4_eq_tasklet *ctx = from_tasklet(ctx, t, task); struct mlx4_cq *mcq, *temp; spin_lock_irqsave(&ctx->lock, flags); diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index ae305c2e9225..9e48509ed3b2 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c @@ -1057,8 +1057,7 @@ static int mlx4_create_eq(struct mlx4_dev *dev, int nent, INIT_LIST_HEAD(&eq->tasklet_ctx.list); INIT_LIST_HEAD(&eq->tasklet_ctx.process_list); spin_lock_init(&eq->tasklet_ctx.lock); - tasklet_init(&eq->tasklet_ctx.task, mlx4_cq_tasklet_cb, - (unsigned long)&eq->tasklet_ctx); + tasklet_setup(&eq->tasklet_ctx.task, mlx4_cq_tasklet_cb); return err; diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h index 527b52e48276..64bed7ac3836 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h @@ -1217,7 +1217,7 @@ void mlx4_cmd_use_polling(struct mlx4_dev *dev); int mlx4_comm_cmd(struct mlx4_dev *dev, u8 cmd, u16 param, u16 op, unsigned long timeout); -void mlx4_cq_tasklet_cb(unsigned long data); +void mlx4_cq_tasklet_cb(struct tasklet_struct *t); void mlx4_cq_completion(struct mlx4_dev *dev, u32 cqn); void mlx4_cq_event(struct mlx4_dev *dev, u32 cqn, int event_type); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cq.c b/drivers/net/ethernet/mellanox/mlx5/core/cq.c index 8379b24cb838..df3e4938ecdd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cq.c @@ -42,11 +42,11 @@ #define TASKLET_MAX_TIME 2 #define TASKLET_MAX_TIME_JIFFIES msecs_to_jiffies(TASKLET_MAX_TIME) -void mlx5_cq_tasklet_cb(unsigned long data) +void mlx5_cq_tasklet_cb(struct tasklet_struct *t) { unsigned long flags; unsigned long end = jiffies + TASKLET_MAX_TIME_JIFFIES; - struct mlx5_eq_tasklet *ctx = (struct mlx5_eq_tasklet *)data; + struct mlx5_eq_tasklet *ctx = from_tasklet(ctx, t, task); struct mlx5_core_cq *mcq; struct mlx5_core_cq *temp; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index 31ef9f8420c8..ec38405d467f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -788,8 +788,7 @@ static int create_comp_eqs(struct mlx5_core_dev *dev) INIT_LIST_HEAD(&eq->tasklet_ctx.list); INIT_LIST_HEAD(&eq->tasklet_ctx.process_list); spin_lock_init(&eq->tasklet_ctx.lock); - tasklet_init(&eq->tasklet_ctx.task, mlx5_cq_tasklet_cb, - (unsigned long)&eq->tasklet_ctx); + tasklet_setup(&eq->tasklet_ctx.task, mlx5_cq_tasklet_cb); eq->irq_nb.notifier_call = mlx5_eq_comp_int; param = (struct mlx5_eq_param) { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c index 831d2c39e153..9f6d97eae0ae 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c @@ -388,9 +388,9 @@ static inline void mlx5_fpga_conn_cqes(struct mlx5_fpga_conn *conn, mlx5_fpga_conn_arm_cq(conn); } -static void mlx5_fpga_conn_cq_tasklet(unsigned long data) +static void mlx5_fpga_conn_cq_tasklet(struct tasklet_struct *t) { - struct mlx5_fpga_conn *conn = (void *)data; + struct mlx5_fpga_conn *conn = from_tasklet(conn, t, cq.tasklet); if (unlikely(!conn->qp.active)) return; @@ -478,8 +478,7 @@ static int mlx5_fpga_conn_create_cq(struct mlx5_fpga_conn *conn, int cq_size) conn->cq.mcq.comp = mlx5_fpga_conn_cq_complete; conn->cq.mcq.irqn = irqn; conn->cq.mcq.uar = fdev->conn_res.uar; - tasklet_init(&conn->cq.tasklet, mlx5_fpga_conn_cq_tasklet, - (unsigned long)conn); + tasklet_setup(&conn->cq.tasklet, mlx5_fpga_conn_cq_tasklet); mlx5_fpga_dbg(fdev, "Created CQ #0x%x\n", conn->cq.mcq.cqn); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h index 4aaca7400fb2..078a7cc29bf0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h @@ -77,7 +77,7 @@ int mlx5_eq_add_cq(struct mlx5_eq *eq, struct mlx5_core_cq *cq); void mlx5_eq_del_cq(struct mlx5_eq *eq, struct mlx5_core_cq *cq); struct mlx5_eq_comp *mlx5_eqn2comp_eq(struct mlx5_core_dev *dev, int eqn); struct mlx5_eq *mlx5_get_async_eq(struct mlx5_core_dev *dev); -void mlx5_cq_tasklet_cb(unsigned long data); +void mlx5_cq_tasklet_cb(struct tasklet_struct *t); struct cpumask *mlx5_eq_comp_cpumask(struct mlx5_core_dev *dev, int ix); u32 mlx5_eq_poll_irq_disabled(struct mlx5_eq_comp *eq); diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c index 1c64b03ff48e..641cdd81882b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c @@ -620,9 +620,9 @@ static char *mlxsw_pci_cq_sw_cqe_get(struct mlxsw_pci_queue *q) return elem; } -static void mlxsw_pci_cq_tasklet(unsigned long data) +static void mlxsw_pci_cq_tasklet(struct tasklet_struct *t) { - struct mlxsw_pci_queue *q = (struct mlxsw_pci_queue *) data; + struct mlxsw_pci_queue *q = from_tasklet(q, t, tasklet); struct mlxsw_pci *mlxsw_pci = q->pci; char *cqe; int items = 0; @@ -733,9 +733,9 @@ static char *mlxsw_pci_eq_sw_eqe_get(struct mlxsw_pci_queue *q) return elem; } -static void mlxsw_pci_eq_tasklet(unsigned long data) +static void mlxsw_pci_eq_tasklet(struct tasklet_struct *t) { - struct mlxsw_pci_queue *q = (struct mlxsw_pci_queue *) data; + struct mlxsw_pci_queue *q = from_tasklet(q, t, tasklet); struct mlxsw_pci *mlxsw_pci = q->pci; u8 cq_count = mlxsw_pci_cq_count(mlxsw_pci); unsigned long active_cqns[BITS_TO_LONGS(MLXSW_PCI_CQS_MAX)]; @@ -792,7 +792,7 @@ struct mlxsw_pci_queue_ops { struct mlxsw_pci_queue *q); void (*fini)(struct mlxsw_pci *mlxsw_pci, struct mlxsw_pci_queue *q); - void (*tasklet)(unsigned long data); + void (*tasklet)(struct tasklet_struct *t); u16 (*elem_count_f)(const struct mlxsw_pci_queue *q); u8 (*elem_size_f)(const struct mlxsw_pci_queue *q); u16 elem_count; @@ -855,7 +855,7 @@ static int mlxsw_pci_queue_init(struct mlxsw_pci *mlxsw_pci, char *mbox, q->pci = mlxsw_pci; if (q_ops->tasklet) - tasklet_init(&q->tasklet, q_ops->tasklet, (unsigned long) q); + tasklet_setup(&q->tasklet, q_ops->tasklet); mem_item->size = MLXSW_PCI_AQ_SIZE; mem_item->buf = pci_alloc_consistent(mlxsw_pci->pdev, From patchwork Wed Sep 9 08:45:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 261282 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4212C43461 for ; Wed, 9 Sep 2020 08:46:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5FEA8218AC for ; Wed, 9 Sep 2020 08:46:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tbMjEAwl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729986AbgIIIqe (ORCPT ); Wed, 9 Sep 2020 04:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729913AbgIIIqN (ORCPT ); Wed, 9 Sep 2020 04:46:13 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58A8EC061755 for ; Wed, 9 Sep 2020 01:46:13 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id d6so1539614pfn.9 for ; Wed, 09 Sep 2020 01:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CcGH3OaKGIRV140OK3AVmjY82UA6At2MB1ivUZ6U1Vk=; b=tbMjEAwlSq5Ehc8uFj4k5xBZWtMdkl4zXBiw9GxPqRDK1osoaoT2aXhC8goKziroxr /S8P/qpGba65Jwg6EFeZ+evy+oWFoMMc+9uSKSo0+RIdOKO6JRrfiUbaaSxVy9Z/TWys feYCZ36korQh6tfcEakBdUV1IpSjcM+12Q/jqt7qBwc8TfWlCTPM5LJHDkFhuPjwa/fE z2/mAa8zG2/DkKbJhQZoH/0N5PB1ZLaxd1Z1l10g1HHwY+kXb10LboyVXG5MHspZ6z9E GFCyJZv7TYdAbuA5LtfMjsD9T62yQPMFPPqLQX4TCIgmkXgHB5FJ+Rlxi8kiydLa6drI 4L1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CcGH3OaKGIRV140OK3AVmjY82UA6At2MB1ivUZ6U1Vk=; b=faPkf6aPxGNlpiF3AtFRwsIGn0AQ+un3KyRR7yloeU+z4LgVE/o9wCMlTnxA7ii0yx 2ph4E1+Nxox2ASWcyscUXBKu27dQZahbjZ0xMizxUhNOkLXt62PxAr8PnUQq93dQFtpe PxnE5YkMAP1DByN3lQwnZnu/ar6CE9a5qLTmVo079uyAlt/k3xO2VbFvYqzFvTdN7aJw bNRwQfmfObpWaqWKikcsVLaiHGYlhs5ztGZ1jIOExLtnRKZEGM0YEL/V3ZtmUaxRGUMm F+FOyYZ1Ya8JX3seWocq/TKmUStV4+xuXznm5z3Ay7dktAxawqC8HrJE8OgH/q60H5ZB KneQ== X-Gm-Message-State: AOAM533OVYekYwLAVSuRWSzKK9BpSZTFh0q+WOime3hP/RBy8QXy2ETi vRJtxO1pMtzrI4nlEbBeX9s= X-Google-Smtp-Source: ABdhPJzlLr6tw7ZMzn+va94clj7N9h60keyjZGcVK7ABhTy3T124GKtM6yAhnOu7N3vz4DivZXMqxQ== X-Received: by 2002:a62:8349:: with SMTP id h70mr2806346pfe.47.1599641172937; Wed, 09 Sep 2020 01:46:12 -0700 (PDT) Received: from localhost.localdomain ([49.207.214.52]) by smtp.gmail.com with ESMTPSA id u21sm1468355pjn.27.2020.09.09.01.46.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 01:46:12 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v2 14/20] ethernet: micrel: convert tasklets to use new tasklet_setup() API Date: Wed, 9 Sep 2020 14:15:04 +0530 Message-Id: <20200909084510.648706-15-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com> References: <20200909084510.648706-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/net/ethernet/micrel/ks8842.c | 19 ++++++++++--------- drivers/net/ethernet/micrel/ksz884x.c | 14 ++++++-------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c index f3f6dfe3eddc..8fd32f98c494 100644 --- a/drivers/net/ethernet/micrel/ks8842.c +++ b/drivers/net/ethernet/micrel/ks8842.c @@ -587,10 +587,11 @@ static int __ks8842_start_new_rx_dma(struct net_device *netdev) return err; } -static void ks8842_rx_frame_dma_tasklet(unsigned long arg) +static void ks8842_rx_frame_dma_tasklet(struct tasklet_struct *t) { - struct net_device *netdev = (struct net_device *)arg; - struct ks8842_adapter *adapter = netdev_priv(netdev); + struct ks8842_adapter *adapter = from_tasklet(adapter, t, dma_rx.tasklet); + struct net_device *netdev = (struct net_device *)((char *)adapter - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); struct ks8842_rx_dma_ctl *ctl = &adapter->dma_rx; struct sk_buff *skb = ctl->skb; dma_addr_t addr = sg_dma_address(&ctl->sg); @@ -720,10 +721,11 @@ static void ks8842_handle_rx_overrun(struct net_device *netdev, netdev->stats.rx_fifo_errors++; } -static void ks8842_tasklet(unsigned long arg) +static void ks8842_tasklet(struct tasklet_struct *t) { - struct net_device *netdev = (struct net_device *)arg; - struct ks8842_adapter *adapter = netdev_priv(netdev); + struct ks8842_adapter *adapter = from_tasklet(adapter, t, tasklet); + struct net_device *netdev = (struct net_device *)((char *)adapter - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); u16 isr; unsigned long flags; u16 entry_bank; @@ -953,8 +955,7 @@ static int ks8842_alloc_dma_bufs(struct net_device *netdev) goto err; } - tasklet_init(&rx_ctl->tasklet, ks8842_rx_frame_dma_tasklet, - (unsigned long)netdev); + tasklet_setup(&rx_ctl->tasklet, ks8842_rx_frame_dma_tasklet); return 0; err: @@ -1173,7 +1174,7 @@ static int ks8842_probe(struct platform_device *pdev) adapter->dma_tx.channel = -1; } - tasklet_init(&adapter->tasklet, ks8842_tasklet, (unsigned long)netdev); + tasklet_setup(&adapter->tasklet, ks8842_tasklet); spin_lock_init(&adapter->lock); netdev->netdev_ops = &ks8842_netdev_ops; diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c index bb646b65cc95..5130507bbf54 100644 --- a/drivers/net/ethernet/micrel/ksz884x.c +++ b/drivers/net/ethernet/micrel/ksz884x.c @@ -5159,9 +5159,9 @@ static int dev_rcv_special(struct dev_info *hw_priv) return received; } -static void rx_proc_task(unsigned long data) +static void rx_proc_task(struct tasklet_struct *t) { - struct dev_info *hw_priv = (struct dev_info *) data; + struct dev_info *hw_priv = from_tasklet(hw_priv, t, rx_tasklet); struct ksz_hw *hw = &hw_priv->hw; if (!hw->enabled) @@ -5181,9 +5181,9 @@ static void rx_proc_task(unsigned long data) } } -static void tx_proc_task(unsigned long data) +static void tx_proc_task(struct tasklet_struct *t) { - struct dev_info *hw_priv = (struct dev_info *) data; + struct dev_info *hw_priv = from_tasklet(hw_priv, t, tx_tasklet); struct ksz_hw *hw = &hw_priv->hw; hw_ack_intr(hw, KS884X_INT_TX_MASK); @@ -5436,10 +5436,8 @@ static int prepare_hardware(struct net_device *dev) rc = request_irq(dev->irq, netdev_intr, IRQF_SHARED, dev->name, dev); if (rc) return rc; - tasklet_init(&hw_priv->rx_tasklet, rx_proc_task, - (unsigned long) hw_priv); - tasklet_init(&hw_priv->tx_tasklet, tx_proc_task, - (unsigned long) hw_priv); + tasklet_setup(&hw_priv->rx_tasklet, rx_proc_task); + tasklet_setup(&hw_priv->tx_tasklet, tx_proc_task); hw->promiscuous = 0; hw->all_multi = 0; From patchwork Wed Sep 9 08:45:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 261278 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D351C433E2 for ; Wed, 9 Sep 2020 08:47:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D55B421973 for ; Wed, 9 Sep 2020 08:47:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CSYfLNc9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730193AbgIIIrP (ORCPT ); Wed, 9 Sep 2020 04:47:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729960AbgIIIq0 (ORCPT ); Wed, 9 Sep 2020 04:46:26 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CC4AC061573 for ; Wed, 9 Sep 2020 01:46:24 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id s2so1001291pjr.4 for ; Wed, 09 Sep 2020 01:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DACBqctBh6K/lxXBtUEpWPPKXy/+y/7V6/I8NP3tZNw=; b=CSYfLNc9HhhetvhmGa8yIRj616OC+BHBaSLAQ1seXj7RWM0bXluUQgb7EP2UnQUA2d 8rYRFvPx4Xrly67HQ9/NBiwRuOyJAcQtVOhCMGDpOthaA0TBKmrtR/zU8usV6Stl8ehr W5MnfuirrFsozgUc6ULclgtimRQKmyg2MJ6//TFH3O1XtSd7JI6+2JpqT4OcVgP+1ieq ScesDchm8LbafCVhfr4rTI9XuCzwpeeeffk/gemh9zmmGqNCdGZ6bi1msTWAiwGw2E+o JCx4AnSv8goehSLNns2wE6Oh3ACDlLX3Zd8f1K3i5fKCccd1QRQNcND1quEn8ucfPHes zbfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DACBqctBh6K/lxXBtUEpWPPKXy/+y/7V6/I8NP3tZNw=; b=YCYSifHJ8X8kznvYfee5ub1yFyWrj/OYG6jOhKdEOrbHxsrUrbrApntGbNaVnvFU09 ZznB89ALIxuce8g7HjrJVExdluESaj6wNEAWoSt/xB1rkpJhzjjUCAkLWnkXwIMrjS2t 5Y2IvAb4F5kXBD7yH1GlfZh6SAqcl5prGOUd7sMwiHQ5zjghCt/BUqKoRVpYrJI6dG02 w+t7lribxInif9zSVT09o1DntAPeWawXLPY51Xva0jMrigUuqcgFxVNdfTYm3pefbt28 I/K/Corm0LOGQevmCVfvCeVmJSX/hc64fluj4bDfCcHKU+oGTviBwmikf8ca3P4PaU4T Nu5A== X-Gm-Message-State: AOAM532Nv+tI9O6wue+O4Uz2PnuQWm+w/dZOT8RxcM8Vsrk49JeerzSX bc+nnbvPNMBoTLil+pOiYE0= X-Google-Smtp-Source: ABdhPJxDKMng6NCm58G/wa6NgVEVOWibpt14HedO6cZou3eY/uduRDZZlIE+KCxmzAb6ZuHiOoDYwA== X-Received: by 2002:a17:90a:930c:: with SMTP id p12mr387pjo.72.1599641184086; Wed, 09 Sep 2020 01:46:24 -0700 (PDT) Received: from localhost.localdomain ([49.207.214.52]) by smtp.gmail.com with ESMTPSA id u21sm1468355pjn.27.2020.09.09.01.46.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 01:46:23 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v2 17/20] ethernet: ni: convert tasklets to use new tasklet_setup() API Date: Wed, 9 Sep 2020 14:15:07 +0530 Message-Id: <20200909084510.648706-18-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com> References: <20200909084510.648706-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/net/ethernet/ni/nixge.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c index 4075f5e59955..a6861df9904f 100644 --- a/drivers/net/ethernet/ni/nixge.c +++ b/drivers/net/ethernet/ni/nixge.c @@ -787,9 +787,9 @@ static irqreturn_t nixge_rx_irq(int irq, void *_ndev) return IRQ_HANDLED; } -static void nixge_dma_err_handler(unsigned long data) +static void nixge_dma_err_handler(struct tasklet_struct *t) { - struct nixge_priv *lp = (struct nixge_priv *)data; + struct nixge_priv *lp = from_tasklet(lp, t, dma_err_tasklet); struct nixge_hw_dma_bd *cur_p; struct nixge_tx_skb *tx_skb; u32 cr, i; @@ -879,8 +879,7 @@ static int nixge_open(struct net_device *ndev) phy_start(phy); /* Enable tasklets for Axi DMA error handling */ - tasklet_init(&priv->dma_err_tasklet, nixge_dma_err_handler, - (unsigned long)priv); + tasklet_setup(&priv->dma_err_tasklet, nixge_dma_err_handler); napi_enable(&priv->napi); From patchwork Wed Sep 9 08:45:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 261279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B83AC43461 for ; Wed, 9 Sep 2020 08:47:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 11C8921D7A for ; Wed, 9 Sep 2020 08:47:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QlwuFOhp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728442AbgIIIrM (ORCPT ); Wed, 9 Sep 2020 04:47:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729993AbgIIIqc (ORCPT ); Wed, 9 Sep 2020 04:46:32 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D17CDC061755 for ; Wed, 9 Sep 2020 01:46:31 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id x123so1547276pfc.7 for ; Wed, 09 Sep 2020 01:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e1DqThIxcgkkSH7JhlwB5IFFaSNM9DTU0sdoZsrDzFY=; b=QlwuFOhpr9+cHSSUWqEc3vXQrzfD+XVC9IPugIoNDYWTUKbWcFoQM8mVt9rikAQhhc JhHqKi+b/zxIXzL+p0DzCDwMiDZvSZ3AKRjvT0GAGRslfOukE3l6dL95USudBK0R4sV0 IiMgP6JMlGTRLel6udnNl2YQBcljEtZ8AWzkncjJULxmolwvgh7wsQ1gKuSxUyrOV6Km 8apGM8+3e4ZfRWChVbvXYSQB45ypvu/QZGjLSALURGt2sP7DSbXjtn3F8pkSnXieSLvh MCFPvKV7PeBimNpWGB1IsXlpcX8Cpn5y9Es+3ZziqqjeFtqEdMhtzKxj8BmNKjFLOETX xKBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e1DqThIxcgkkSH7JhlwB5IFFaSNM9DTU0sdoZsrDzFY=; b=dK1x2DJczzTgc+Oosc8IO7YYiBJ6L+KSdQ5CNTewy42XWwHZq6szaN1Bhjm/Oedb4t gEMJ9fkRitXNBtKECu5pRyCMHgtH7pCD/myJvA8cpilnU1FiWLhGOtfXpKE1LnOhYtVK XS+e+Kt97wGsqRUiCtGS23tUotzGSX+CMSF6LYaVjm89yyExbsTAjWxoLjLdO/dQDBN+ o0wCdHgZu8nbWVfgiG3SE5/K2c+BoPUiPQ5pg9K7dxHkoRKT6fbkOBXjZKg6Q6sKa1/9 E2pza4+J9TYIsPsyPN+eRWtTT0gTsGoIoWRT1sw0QsN21tHMNbS2Z4Qpc7bWip4aoo54 ePDg== X-Gm-Message-State: AOAM531qjDQqNXG3sOaYfGVvhABfLDrMBXgqEj2b00SK79pqvvXMtiel y2CSgk5wJZTyqqOVhc8CE58= X-Google-Smtp-Source: ABdhPJzU1/SUgCP03ZbsqbFapejzUyuQKlfhEVEoveC+iSFbwywvqVrcqPpCX5oBrTGiSQ4wLGFdgA== X-Received: by 2002:a63:3742:: with SMTP id g2mr2141937pgn.71.1599641191455; Wed, 09 Sep 2020 01:46:31 -0700 (PDT) Received: from localhost.localdomain ([49.207.214.52]) by smtp.gmail.com with ESMTPSA id u21sm1468355pjn.27.2020.09.09.01.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 01:46:31 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v2 19/20] ethernet: silan: convert tasklets to use new tasklet_setup() API Date: Wed, 9 Sep 2020 14:15:09 +0530 Message-Id: <20200909084510.648706-20-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com> References: <20200909084510.648706-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/net/ethernet/silan/sc92031.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/silan/sc92031.c b/drivers/net/ethernet/silan/sc92031.c index f94078f8ebe5..8d56eca5be17 100644 --- a/drivers/net/ethernet/silan/sc92031.c +++ b/drivers/net/ethernet/silan/sc92031.c @@ -829,10 +829,11 @@ static void _sc92031_link_tasklet(struct net_device *dev) } } -static void sc92031_tasklet(unsigned long data) +static void sc92031_tasklet(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *)data; - struct sc92031_priv *priv = netdev_priv(dev); + struct sc92031_priv *priv = from_tasklet(priv, t, tasklet); + struct net_device *dev = (struct net_device *)((char *)priv - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); void __iomem *port_base = priv->port_base; u32 intr_status, intr_mask; @@ -1108,7 +1109,7 @@ static void sc92031_poll_controller(struct net_device *dev) disable_irq(irq); if (sc92031_interrupt(irq, dev) != IRQ_NONE) - sc92031_tasklet((unsigned long)dev); + sc92031_tasklet(&priv->tasklet); enable_irq(irq); } #endif @@ -1446,7 +1447,7 @@ static int sc92031_probe(struct pci_dev *pdev, const struct pci_device_id *id) spin_lock_init(&priv->lock); priv->port_base = port_base; priv->pdev = pdev; - tasklet_init(&priv->tasklet, sc92031_tasklet, (unsigned long)dev); + tasklet_setup(&priv->tasklet, sc92031_tasklet); /* Fudge tasklet count so the call to sc92031_enable_interrupts at * sc92031_open will work correctly */ tasklet_disable_nosync(&priv->tasklet); From patchwork Wed Sep 9 08:45:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 261280 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F00AC433E2 for ; Wed, 9 Sep 2020 08:46:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C812C21919 for ; Wed, 9 Sep 2020 08:46:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kWuWcYjn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730128AbgIIIqs (ORCPT ); Wed, 9 Sep 2020 04:46:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730104AbgIIIqg (ORCPT ); Wed, 9 Sep 2020 04:46:36 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B4E2C061573 for ; Wed, 9 Sep 2020 01:46:35 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id b124so1522856pfg.13 for ; Wed, 09 Sep 2020 01:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/7Lo0Zq19j3NrPlc5d1RuKodohY5I8pKUv1aJVGLWfo=; b=kWuWcYjn9OteFZzsj+svqPV7VHwMfLMz9ILf6rQVl3ISGsTLH0fbua61BDxoITwXtq FDsu9oeWwr8mXDAC7oYQr+BF9+Ud41HSSpqPNLHSKKWg0jTSiKUIoJO4lLiqiVuL3CnQ bQXvWMnCLIBdflEaNWCmbfDLxmhnVCoqRj9fnhXjAoEphOoArBGSc+25ET69iYrXCA/Q 6DJyqkKbUdrLJrwadrTVf66a1FnlnrAmCnBozVY563IDAVeox8dMcWwk5bhRiuo7gMv8 qBbVQhi7SqIcl96efMVUt4tManHfNnfogszgUqE/OKlxQXOoKQvHeYFlIfRSOaSZZ9/A P3bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/7Lo0Zq19j3NrPlc5d1RuKodohY5I8pKUv1aJVGLWfo=; b=DSN7gchs0o+yu4YX0xf2tOVQP7CZvLl7jXts4alYIad9iVHLzQuV3hdN8FRjZ0vB9+ EvYW15qKxA7t4dw1jN6+9jr9xgxwCwh2Un+dElK+0B1ayv/v0vnGLbeJsiFsqNpmkU0i AsSYQ29oCEUEd97ByaOOSZdiMh1HIzc/q8oiAqFZbfRW2jlIntCaJMGE3BobFIG6nI7J n2qwSbzthK8KanBHGbIaMgEw5MZAi5qckk6u50exyQ8fH6LPoXgJBxWfe7nSKtQ0xSS4 +it6PHvinTqF3DjQGs1BW5OJlDPKTGY21kCnEiNSv4dSIC2TM77ra9e8Pc7hEyKKNtGQ nsZQ== X-Gm-Message-State: AOAM533d/nu9TimsPf205okzotj0neC3JlXlKoAJFdlY1sBscY9wUlKG fK6v4eWC1oqWcPbhPjax/1Q= X-Google-Smtp-Source: ABdhPJwsALSdFvB0YVF3SyCp/WB6lBThSLtxqN6kYvgICJSYHcdIjKOpPLn1+6xf+cS/9SBm6Io12w== X-Received: by 2002:a17:902:70c9:b029:d0:cbe1:e749 with SMTP id l9-20020a17090270c9b02900d0cbe1e749mr2961971plt.36.1599641195025; Wed, 09 Sep 2020 01:46:35 -0700 (PDT) Received: from localhost.localdomain ([49.207.214.52]) by smtp.gmail.com with ESMTPSA id u21sm1468355pjn.27.2020.09.09.01.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 01:46:34 -0700 (PDT) From: Allen Pais To: davem@davemloft.net Cc: jes@trained-monkey.org, kuba@kernel.org, dougmill@linux.ibm.com, cooldavid@cooldavid.org, mlindner@marvell.com, stephen@networkplumber.org, borisp@mellanox.com, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v2 20/20] ethernet: smsc: convert tasklets to use new tasklet_setup() API Date: Wed, 9 Sep 2020 14:15:10 +0530 Message-Id: <20200909084510.648706-21-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200909084510.648706-1-allen.lkml@gmail.com> References: <20200909084510.648706-1-allen.lkml@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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/net/ethernet/smsc/smc91x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index 1c4fea9c3ec4..7e585aa3031c 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c @@ -535,10 +535,10 @@ static inline void smc_rcv(struct net_device *dev) /* * This is called to actually send a packet to the chip. */ -static void smc_hardware_send_pkt(unsigned long data) +static void smc_hardware_send_pkt(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *)data; - struct smc_local *lp = netdev_priv(dev); + struct smc_local *lp = from_tasklet(lp, t, tx_task); + struct net_device *dev = lp->dev; void __iomem *ioaddr = lp->base; struct sk_buff *skb; unsigned int packet_no, len; @@ -688,7 +688,7 @@ smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) * Allocation succeeded: push packet to the chip's own memory * immediately. */ - smc_hardware_send_pkt((unsigned long)dev); + smc_hardware_send_pkt(&lp->tx_task); } return NETDEV_TX_OK; @@ -1965,7 +1965,7 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr, dev->netdev_ops = &smc_netdev_ops; dev->ethtool_ops = &smc_ethtool_ops; - tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev); + tasklet_setup(&lp->tx_task, smc_hardware_send_pkt); INIT_WORK(&lp->phy_configure, smc_phy_configure); lp->dev = dev; lp->mii.phy_id_mask = 0x1f;