From patchwork Mon Aug 17 08:51:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259601 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=unavailable 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 01413C433E1 for ; Mon, 17 Aug 2020 08:51:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1F2B2080D for ; Mon, 17 Aug 2020 08:51:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FhPl0yES" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727956AbgHQIvh (ORCPT ); Mon, 17 Aug 2020 04:51:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726779AbgHQIvh (ORCPT ); Mon, 17 Aug 2020 04:51:37 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1B26C061389; Mon, 17 Aug 2020 01:51:36 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id y10so5603518plr.11; Mon, 17 Aug 2020 01:51:36 -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; bh=wOFnP+mIOUunUyi6RmfOX+Q5ALinLxcvae3Yp9Ni+zM=; b=FhPl0yESGUE8TFhEMqa043m95wRC5RdMMRPdR5UgsrxCgGMSnZzudvjAwnJEl2hIJ1 oGndCZEaXVgoEMpGLQWbDq4g3kJ7z95+EP4HzK121db5e9kS55CzPp0XdHralL2dfHQh dgpDPajBcs1sN12jaJpV3bPULcS4nizJvfIo9rn/3fx7vilSqLpMAKagKZrY7/vxomUR /JvCYcmXLl2q9Y472Ww1UkCTwD/85BnJRzs3v8oBCg2Xd0tNW8YFSoJqcc2ADB76cSwb 2ZTQh2o3tq+8V+wdji6oB02Wot5qgPQpO+XpR/ggCT5pnQeKTXhPd1Wd60Oid5sZ9psL 3KfA== 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; bh=wOFnP+mIOUunUyi6RmfOX+Q5ALinLxcvae3Yp9Ni+zM=; b=CcRbs4NcmDfom0OZH1z12y9Az0knzvKtAXBvdPAlAmhVy7MLX3gYqZFk92cfchySs8 V1z/WJBpc/YBY/arZRTIRxuK8lKRNW4Btjt7XIhSADpdFbC6hxsXtrf9SYDSeFAiWzlF Y9pRxjfnPtPvMwTxcAo6oqSDNNuRlKXJvCcbVZ78vFZ3KSe4oPOcXBTFmYqh5pGi9fKM h8Znui2VSWjxfqgwstPJxzsv6YijPaZ35IjtUBmTjfwWqs3gCUzuFrlNMb6hN8z4fY6B W614ZG4c77J5MoAE7WXMmMijEGlLa1cahLdasAbdEH+TYh1oO1WfCsoVLBwIrwoaODld 1UVQ== X-Gm-Message-State: AOAM533EhBRQei4eartpp5/gbi7csWF8Jrsd7ZPw7ll6si5wUR2dk39R Jd+HVHI6Dc4RFfvMqucguvo= X-Google-Smtp-Source: ABdhPJwkHrfrADxoARIyFesLt8svDhCVc8Neq3PWKmf9xTMPVNTGXJJNDk1NroIFsEd4Jvyoxz8amQ== X-Received: by 2002:a17:90b:1493:: with SMTP id js19mr10627721pjb.223.1597654296487; Mon, 17 Aug 2020 01:51:36 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id b185sm18554863pfg.71.2020.08.17.01.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:51:35 -0700 (PDT) From: Allen Pais To: gerrit@erg.abdn.ac.uk, davem@davemloft.net, kuba@kernel.org, edumazet@google.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, johannes@sipsolutions.net, alex.aring@gmail.com, stefan@datenfreihafen.org, santosh.shilimkar@oracle.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us Cc: keescook@chromium.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH 1/8] net: dccp: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:21:13 +0530 Message-Id: <20200817085120.24894-1-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais 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 --- net/dccp/timer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/dccp/timer.c b/net/dccp/timer.c index 0e06dfc32273..f174ecb2fb4e 100644 --- a/net/dccp/timer.c +++ b/net/dccp/timer.c @@ -220,9 +220,10 @@ static void dccp_delack_timer(struct timer_list *t) * * See the comments above %ccid_dequeueing_decision for supported modes. */ -static void dccp_write_xmitlet(unsigned long data) +static void dccp_write_xmitlet(struct tasklet_struct *t) { - struct sock *sk = (struct sock *)data; + struct dccp_sock *dp = from_tasklet(dp, t, dccps_xmitlet); + struct sock *sk = &dp->dccps_inet_connection.icsk_inet.sk; bh_lock_sock(sk); if (sock_owned_by_user(sk)) @@ -236,16 +237,15 @@ static void dccp_write_xmitlet(unsigned long data) static void dccp_write_xmit_timer(struct timer_list *t) { struct dccp_sock *dp = from_timer(dp, t, dccps_xmit_timer); - struct sock *sk = &dp->dccps_inet_connection.icsk_inet.sk; - dccp_write_xmitlet((unsigned long)sk); + dccp_write_xmitlet(&dp->dccps_xmitlet); } void dccp_init_xmit_timers(struct sock *sk) { struct dccp_sock *dp = dccp_sk(sk); - tasklet_init(&dp->dccps_xmitlet, dccp_write_xmitlet, (unsigned long)sk); + tasklet_setup(&dp->dccps_xmitlet, dccp_write_xmitlet); timer_setup(&dp->dccps_xmit_timer, dccp_write_xmit_timer, 0); inet_csk_init_xmit_timers(sk, &dccp_write_timer, &dccp_delack_timer, &dccp_keepalive_timer); From patchwork Mon Aug 17 08:51:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259600 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=unavailable 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 35D09C433DF for ; Mon, 17 Aug 2020 08:52:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C8C3207DF for ; Mon, 17 Aug 2020 08:52:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y+DhcifE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728114AbgHQIv6 (ORCPT ); Mon, 17 Aug 2020 04:51:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727007AbgHQIvz (ORCPT ); Mon, 17 Aug 2020 04:51:55 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E583C061388; Mon, 17 Aug 2020 01:51:55 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id 189so7155584pgg.13; Mon, 17 Aug 2020 01:51:55 -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; bh=ijTmpsgasiQrLvP/jHqs2Q1457rFN2p2/RaYnWwesps=; b=Y+DhcifEg1q72HMDHgIEsMC86tLascLHtdlfcBtATq+XLVwpAc1id3Mtkz2CzT3/53 KhbfMP01NKykwYZWMhM3x8OfyiTSkI4txHco8YdCMzje7oGC472Hz640G/x2DPQ/9sCz 9RIn6W3+013jpVX7J1qlpPTlKtyr/abO4vTO0AWt0Sye83C4fGxjmiMggQb+CDGHfLES akz2DP9CIN70SIomBKNxI3DSZo9prunVFT018KcBoA0gNCTsuepbEWcqnOtFE2huwje7 0qk8tjm7BV3WJXRG8tqQFlxS3UkMovwou8Wer+klKxaYNwXWW3NUXBeTascKbHyLfRd7 JzEg== 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; bh=ijTmpsgasiQrLvP/jHqs2Q1457rFN2p2/RaYnWwesps=; b=b8QfJIRzPRCLpweWsDnNEv9icA0PbT0n19mbDmJi94dKcpUkhWMB3Ohq0xTHAnGhiE L2mc+gawbGxmvJhaBWYMIezkrbxhWaR28KOFWqWI325lwQLpqe5Q/8FelJFxG76bRxrX ugk8cPkfrEDDuOpmRPTSZGXtp/8hae1cr4o3JElWG5bMBSymz1FQn2AgTtfjpW5uNioU ztezzFEzjjmVVcu/SncoqfCHDoFucecYf1LQd/y2TVFkC7f+yoNE9NVsh/lwsjFFWCB4 fpCRz7AuvXkBV3MMak4B2zs8sV4TIjCZ7jN94iUJDOBhyrcOdk9MzQYdhHmYBZK8U1iu yWYg== X-Gm-Message-State: AOAM533s0lFzqCTUDGUs+JK7v1i94O9SJhQh2B1Tu9J6nRGxpcREw8vt 8j0/WoC1U7SC6v/sFegqZmM= X-Google-Smtp-Source: ABdhPJwdNRCoiHOQtKGcoJCuvg7c2qTxDPh3FsDh3LRlUqjN5h2YP89Nv1bV6FSD4miIDTJhwo5dkA== X-Received: by 2002:a63:4b21:: with SMTP id y33mr9418126pga.142.1597654314904; Mon, 17 Aug 2020 01:51:54 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id b185sm18554863pfg.71.2020.08.17.01.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:51:54 -0700 (PDT) From: Allen Pais To: gerrit@erg.abdn.ac.uk, davem@davemloft.net, kuba@kernel.org, edumazet@google.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, johannes@sipsolutions.net, alex.aring@gmail.com, stefan@datenfreihafen.org, santosh.shilimkar@oracle.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us Cc: keescook@chromium.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH 3/8] net: mac80211: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:21:15 +0530 Message-Id: <20200817085120.24894-3-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085120.24894-1-allen.cryptic@gmail.com> References: <20200817085120.24894-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais 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 --- net/mac80211/ieee80211_i.h | 4 ++-- net/mac80211/main.c | 14 +++++--------- net/mac80211/tx.c | 5 +++-- net/mac80211/util.c | 5 +++-- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 0b1eaec6649f..3fb87a3cee30 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1775,7 +1775,7 @@ static inline bool ieee80211_sdata_running(struct ieee80211_sub_if_data *sdata) /* tx handling */ void ieee80211_clear_tx_pending(struct ieee80211_local *local); -void ieee80211_tx_pending(unsigned long data); +void ieee80211_tx_pending(struct tasklet_struct *t); netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev); netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, @@ -2125,7 +2125,7 @@ void ieee80211_txq_remove_vlan(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata); void ieee80211_fill_txq_stats(struct cfg80211_txq_stats *txqstats, struct txq_info *txqi); -void ieee80211_wake_txqs(unsigned long data); +void ieee80211_wake_txqs(struct tasklet_struct *t); void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, u16 transaction, u16 auth_alg, u16 status, const u8 *extra, size_t extra_len, const u8 *bssid, diff --git a/net/mac80211/main.c b/net/mac80211/main.c index b4a2efe8e83a..dd489b841bb7 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -220,9 +220,9 @@ u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata) BSS_CHANGED_ERP_SLOT; } -static void ieee80211_tasklet_handler(unsigned long data) +static void ieee80211_tasklet_handler(struct tasklet_struct *t) { - struct ieee80211_local *local = (struct ieee80211_local *) data; + struct ieee80211_local *local = from_tasklet(local, t, tasklet); struct sk_buff *skb; while ((skb = skb_dequeue(&local->skb_queue)) || @@ -733,16 +733,12 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len, skb_queue_head_init(&local->pending[i]); atomic_set(&local->agg_queue_stop[i], 0); } - tasklet_init(&local->tx_pending_tasklet, ieee80211_tx_pending, - (unsigned long)local); + tasklet_setup(&local->tx_pending_tasklet, ieee80211_tx_pending); if (ops->wake_tx_queue) - tasklet_init(&local->wake_txqs_tasklet, ieee80211_wake_txqs, - (unsigned long)local); + tasklet_setup(&local->wake_txqs_tasklet, ieee80211_wake_txqs); - tasklet_init(&local->tasklet, - ieee80211_tasklet_handler, - (unsigned long) local); + tasklet_setup(&local->tasklet, ieee80211_tasklet_handler); skb_queue_head_init(&local->skb_queue); skb_queue_head_init(&local->skb_queue_unreliable); diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index dca01d7e6e3e..a7fafd2f196b 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -4401,9 +4401,10 @@ static bool ieee80211_tx_pending_skb(struct ieee80211_local *local, /* * Transmit all pending packets. Called from tasklet. */ -void ieee80211_tx_pending(unsigned long data) +void ieee80211_tx_pending(struct tasklet_struct *t) { - struct ieee80211_local *local = (struct ieee80211_local *)data; + struct ieee80211_local *local = from_tasklet(local, t, + tx_pending_tasklet); unsigned long flags; int i; bool txok; diff --git a/net/mac80211/util.c b/net/mac80211/util.c index c8504ffc71a1..b99d3d2721df 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -334,9 +334,10 @@ _ieee80211_wake_txqs(struct ieee80211_local *local, unsigned long *flags) rcu_read_unlock(); } -void ieee80211_wake_txqs(unsigned long data) +void ieee80211_wake_txqs(struct tasklet_struct *t) { - struct ieee80211_local *local = (struct ieee80211_local *)data; + struct ieee80211_local *local = from_tasklet(local, t, + wake_txqs_tasklet); unsigned long flags; spin_lock_irqsave(&local->queue_stop_reason_lock, flags); From patchwork Mon Aug 17 08:51:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259598 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=unavailable 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 241A8C433DF for ; Mon, 17 Aug 2020 08:53:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFF952067C for ; Mon, 17 Aug 2020 08:53:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UNXbknHW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbgHQIwQ (ORCPT ); Mon, 17 Aug 2020 04:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728449AbgHQIwL (ORCPT ); Mon, 17 Aug 2020 04:52:11 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36117C061388; Mon, 17 Aug 2020 01:52:11 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id t10so7157183plz.10; Mon, 17 Aug 2020 01:52:11 -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; bh=FBwgroa5ysfr0mOctJOQjACyLAT2zXIJaPJz3rnhkuM=; b=UNXbknHW6Kjd/+Qrjr+x0igc7PXrS8iFuBBcvR4LmNo7I3d93wK0HQ0pJpE2l810Rc kd5aQJu7Czwuoks2B/EonPDstuPaV9k19zY9NOXOdBzJdZ2fz2bGfyvK7QB1K2cD+ZGd qAUqSPH9fpsLj+EqIOxWOkC/mT4G2fftllOK8kzgjr4DAHXNi8figb6vBuuCQQQfbnZt SA8wtgta58pLjDkKLl/VneyFfZHGTFNDPr+p9r7ut0nAov0NKZBb2bhb7NyI/s2ia3qm UIpkg1fmaJ7tX5Zs3zZbOGpMnkBu1DXVHmS6eglYeAQ2CAtLYtgVCHF9raly2gfaDdV4 2fwQ== 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; bh=FBwgroa5ysfr0mOctJOQjACyLAT2zXIJaPJz3rnhkuM=; b=kNT6uuSwcIPQYl/y2MSOhQUHEsGk17a2L1eBuT082e6mPjm1I+2+mqqe8e99ben01G fLRFRIJZXG8Mnd6dLG6EFdEFZcWtxwujV7MmippJOW6F/ifOMBKxynZzZXSeG+E3l7ot uOSPtupHTc+d2rM4HJlG2WkAHpunbONg75Y2ZrTLmXcERegEzfhe3Ev/kBKsw1FHQsad HAyPC655dU2pcL2zUkt6up9ikCsSQpvHIL0bDQhpiFH4yEElZW/jKsIGAJ7z16WRrQXz JpIpDe5kEZegobZiEOpdjvUKp0xwIhlpRQRpbvTSG85XyQwEDZIfWuR1FQqfMk0zX7KD yZNA== X-Gm-Message-State: AOAM5313ojsgGRhWPW/gH0DJG4p7RhpUmoh6n+dm3nLM0M7Kb3yLA3CE n50uDawpgycfZQAEWcBr+XQ= X-Google-Smtp-Source: ABdhPJzHWrkDQzqDFcQ5s56yRVeDTo9be/bCA2S56GP8Ll8Uy+wcH4cPFMPncT3lbIdRtXKCLdaq1g== X-Received: by 2002:a17:90a:d986:: with SMTP id d6mr11019969pjv.134.1597654330763; Mon, 17 Aug 2020 01:52:10 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id b185sm18554863pfg.71.2020.08.17.01.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:52:10 -0700 (PDT) From: Allen Pais To: gerrit@erg.abdn.ac.uk, davem@davemloft.net, kuba@kernel.org, edumazet@google.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, johannes@sipsolutions.net, alex.aring@gmail.com, stefan@datenfreihafen.org, santosh.shilimkar@oracle.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us Cc: keescook@chromium.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH 5/8] net: rds: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:21:17 +0530 Message-Id: <20200817085120.24894-5-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085120.24894-1-allen.cryptic@gmail.com> References: <20200817085120.24894-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais 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 --- net/rds/ib_cm.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index c3319ff3ee11..2e8872d51fa8 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -314,9 +314,9 @@ static void poll_scq(struct rds_ib_connection *ic, struct ib_cq *cq, } } -static void rds_ib_tasklet_fn_send(unsigned long data) +static void rds_ib_tasklet_fn_send(struct tasklet_struct *t) { - struct rds_ib_connection *ic = (struct rds_ib_connection *)data; + struct rds_ib_connection *ic = from_tasklet(ic, t, i_send_tasklet); struct rds_connection *conn = ic->conn; rds_ib_stats_inc(s_ib_tasklet_call); @@ -354,9 +354,9 @@ static void poll_rcq(struct rds_ib_connection *ic, struct ib_cq *cq, } } -static void rds_ib_tasklet_fn_recv(unsigned long data) +static void rds_ib_tasklet_fn_recv(struct tasklet_struct *t) { - struct rds_ib_connection *ic = (struct rds_ib_connection *)data; + struct rds_ib_connection *ic = from_tasklet(ic, t, i_recv_tasklet); struct rds_connection *conn = ic->conn; struct rds_ib_device *rds_ibdev = ic->rds_ibdev; struct rds_ib_ack_state state; @@ -1218,10 +1218,8 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp) } INIT_LIST_HEAD(&ic->ib_node); - tasklet_init(&ic->i_send_tasklet, rds_ib_tasklet_fn_send, - (unsigned long)ic); - tasklet_init(&ic->i_recv_tasklet, rds_ib_tasklet_fn_recv, - (unsigned long)ic); + tasklet_setup(&ic->i_send_tasklet, rds_ib_tasklet_fn_send); + tasklet_setup(&ic->i_recv_tasklet, rds_ib_tasklet_fn_recv); mutex_init(&ic->i_recv_mutex); #ifndef KERNEL_HAS_ATOMIC64 spin_lock_init(&ic->i_ack_lock); From patchwork Mon Aug 17 08:51:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 259599 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=unavailable 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 9DD5BC433E3 for ; Mon, 17 Aug 2020 08:52:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7922B2067C for ; Mon, 17 Aug 2020 08:52:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pdRLg8iR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728602AbgHQIwh (ORCPT ); Mon, 17 Aug 2020 04:52:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbgHQIw0 (ORCPT ); Mon, 17 Aug 2020 04:52:26 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D3ABC061389; Mon, 17 Aug 2020 01:52:26 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id u20so7906181pfn.0; Mon, 17 Aug 2020 01:52: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; bh=f+E4SgVdMO+b7ElHO75sW6+6/fY3ssvuHvraNgGnP/E=; b=pdRLg8iRDGDLF30BBijqm3rf6TfVm30mEuP7Iz9gToAPk1OPgfqiJoh4Mk9Fexv+80 h5SCcbAwDLziu+LzPv126UhenrAgryUk7MXlFL1cDavMyJwVczwUe4YgLo6v9GEa8edk k3+wRQL9PkY2ZPTbV+Sj5P7M7jwvf9quuFJYfH+FVo/mS6R66yjxcsWUQQExDGI3DHJD OAnbriN4Lih1WA4rll1rPo03ExSl2RFZNnedruxuI0RuA+7u53BS/BclJNXk72fVqIxL sPOHU4zdirVM3zIKPNuu8SWis+ODPrWDtLHtKT4LpbzIMMUTQd74weBV7s2GFuixTfzv YX5Q== 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; bh=f+E4SgVdMO+b7ElHO75sW6+6/fY3ssvuHvraNgGnP/E=; b=SNxKxnxoSnh1knkTOJiA7jaf+P+TjYiWevrRITNcQrPkq4R0bom1b8gJC+/zYhfVxV W5/q1bkS0MeAgUfFRZgdSNciWHXywGd/1e/yTWAz639Rfj7UQnUeCM5GCfAY6jUnxHF+ sEhzFaDjrN3pYwLlE4X7dbbG+jdQNQ6wihbg3FomqghGN+AcXABiAFS+hf1WW0itKW8i 6kdtC0CtsKIOFynEf7sNBA2IkwZl59jGA49Ak/1/XZats2ZEKuT7icTYHCuGKsIPIe9D Xo+oCqBwd1xrd+FozGxDVakSg5qgPZY/uKbcar84LwQvceD9AykCLu5ZkWtV9uTAnxvf 0uqw== X-Gm-Message-State: AOAM533VgHvNZP7RT/+9Jjw8h0b0rsWbbJOHc8/BfvmU/kvo/WggaZUD 16lzCK7RQvgECwNQdJ48JfE= X-Google-Smtp-Source: ABdhPJzX80hEbA1rN26FtQEDQBz2kq/iAKdArrH+iwXPU05gdzLr4uc1KCMX+/YvoDlYfeJ1iPpalQ== X-Received: by 2002:aa7:989e:: with SMTP id r30mr10475433pfl.205.1597654345610; Mon, 17 Aug 2020 01:52:25 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id b185sm18554863pfg.71.2020.08.17.01.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:52:25 -0700 (PDT) From: Allen Pais To: gerrit@erg.abdn.ac.uk, davem@davemloft.net, kuba@kernel.org, edumazet@google.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, johannes@sipsolutions.net, alex.aring@gmail.com, stefan@datenfreihafen.org, santosh.shilimkar@oracle.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us Cc: keescook@chromium.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH 7/8] net: smc: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 14:21:19 +0530 Message-Id: <20200817085120.24894-7-allen.cryptic@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817085120.24894-1-allen.cryptic@gmail.com> References: <20200817085120.24894-1-allen.cryptic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais 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 --- net/smc/smc_cdc.c | 6 +++--- net/smc/smc_wr.c | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/net/smc/smc_cdc.c b/net/smc/smc_cdc.c index ce468ff62a19..5db2166197d3 100644 --- a/net/smc/smc_cdc.c +++ b/net/smc/smc_cdc.c @@ -389,9 +389,9 @@ static void smc_cdc_msg_recv(struct smc_sock *smc, struct smc_cdc_msg *cdc) * Context: * - tasklet context */ -static void smcd_cdc_rx_tsklet(unsigned long data) +static void smcd_cdc_rx_tsklet(struct tasklet_struct *t) { - struct smc_connection *conn = (struct smc_connection *)data; + struct smc_connection *conn = from_tasklet(conn, t, rx_tsklet); struct smcd_cdc_msg *data_cdc; struct smcd_cdc_msg cdc; struct smc_sock *smc; @@ -411,7 +411,7 @@ static void smcd_cdc_rx_tsklet(unsigned long data) */ void smcd_cdc_rx_init(struct smc_connection *conn) { - tasklet_init(&conn->rx_tsklet, smcd_cdc_rx_tsklet, (unsigned long)conn); + tasklet_setup(&conn->rx_tsklet, smcd_cdc_rx_tsklet); } /***************************** init, exit, misc ******************************/ diff --git a/net/smc/smc_wr.c b/net/smc/smc_wr.c index 1e23cdd41eb1..cbc73a7e4d59 100644 --- a/net/smc/smc_wr.c +++ b/net/smc/smc_wr.c @@ -131,9 +131,9 @@ static inline void smc_wr_tx_process_cqe(struct ib_wc *wc) wake_up(&link->wr_tx_wait); } -static void smc_wr_tx_tasklet_fn(unsigned long data) +static void smc_wr_tx_tasklet_fn(struct tasklet_struct *t) { - struct smc_ib_device *dev = (struct smc_ib_device *)data; + struct smc_ib_device *dev = from_tasklet(dev, t, send_tasklet); struct ib_wc wc[SMC_WR_MAX_POLL_CQE]; int i = 0, rc; int polled = 0; @@ -435,9 +435,9 @@ static inline void smc_wr_rx_process_cqes(struct ib_wc wc[], int num) } } -static void smc_wr_rx_tasklet_fn(unsigned long data) +static void smc_wr_rx_tasklet_fn(struct tasklet_struct *t) { - struct smc_ib_device *dev = (struct smc_ib_device *)data; + struct smc_ib_device *dev = from_tasklet(dev, t, recv_tasklet); struct ib_wc wc[SMC_WR_MAX_POLL_CQE]; int polled = 0; int rc; @@ -698,10 +698,8 @@ void smc_wr_remove_dev(struct smc_ib_device *smcibdev) void smc_wr_add_dev(struct smc_ib_device *smcibdev) { - tasklet_init(&smcibdev->recv_tasklet, smc_wr_rx_tasklet_fn, - (unsigned long)smcibdev); - tasklet_init(&smcibdev->send_tasklet, smc_wr_tx_tasklet_fn, - (unsigned long)smcibdev); + tasklet_setup(&smcibdev->recv_tasklet, smc_wr_rx_tasklet_fn); + tasklet_setup(&smcibdev->send_tasklet, smc_wr_tx_tasklet_fn); } int smc_wr_create_link(struct smc_link *lnk)