From: Allen Pais <allen.lkml@gmail.com>
To: davem@davemloft.net
Cc: gerrit@erg.abdn.ac.uk, 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,
steffen.klassert@secunet.com, herbert@gondor.apana.org.au,
netdev@vger.kernel.org, Allen Pais <apais@linux.microsoft.com>,
Romain Perier <romain.perier@gmail.com>
Subject: [net-next v4 6/8] net: sched: convert tasklets to use new tasklet_setup() API
Date: Tue, 3 Nov 2020 14:48:21 +0530 [thread overview]
Message-ID: <20201103091823.586717-7-allen.lkml@gmail.com> (raw)
In-Reply-To: <20201103091823.586717-1-allen.lkml@gmail.com>
From: Allen Pais <apais@linux.microsoft.com>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <apais@linux.microsoft.com>
---
include/net/pkt_sched.h | 5 +++++
net/sched/sch_atm.c | 8 ++++----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 4ed32e6b0201..15b1b30f454e 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -24,6 +24,11 @@ static inline void *qdisc_priv(struct Qdisc *q)
return &q->privdata;
}
+static inline struct Qdisc *qdisc_from_priv(void *priv)
+{
+ return container_of(priv, struct Qdisc, privdata);
+}
+
/*
Timer resolution MUST BE < 10% of min_schedulable_packet_size/bandwidth
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index 1c281cc81f57..007bd2d9f1ff 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -466,10 +466,10 @@ drop: __maybe_unused
* non-ATM interfaces.
*/
-static void sch_atm_dequeue(unsigned long data)
+static void sch_atm_dequeue(struct tasklet_struct *t)
{
- struct Qdisc *sch = (struct Qdisc *)data;
- struct atm_qdisc_data *p = qdisc_priv(sch);
+ struct atm_qdisc_data *p = from_tasklet(p, t, task);
+ struct Qdisc *sch = qdisc_from_priv(p);
struct atm_flow_data *flow;
struct sk_buff *skb;
@@ -563,7 +563,7 @@ static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt,
if (err)
return err;
- tasklet_init(&p->task, sch_atm_dequeue, (unsigned long)sch);
+ tasklet_setup(&p->task, sch_atm_dequeue);
return 0;
}
--
2.25.1
next prev parent reply other threads:[~2020-11-03 9:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 9:18 [net-next v4 0/8]net: convert tasklets to use new tasklet_setup API Allen Pais
2020-11-03 9:18 ` [net-next v4 1/8] net: dccp: convert tasklets to use new tasklet_setup() API Allen Pais
2020-11-03 9:18 ` [net-next v4 2/8] net: ipv4: " Allen Pais
2020-11-03 9:18 ` [net-next v4 3/8] net: mac80211: " Allen Pais
2020-11-03 9:18 ` [net-next v4 4/8] net: mac802154: " Allen Pais
2020-11-03 9:18 ` [net-next v4 5/8] net: rds: " Allen Pais
2020-11-06 0:47 ` Jakub Kicinski
2020-11-03 9:18 ` Allen Pais [this message]
2020-11-03 9:18 ` [net-next v4 7/8] net: smc: " Allen Pais
2020-11-06 0:49 ` Jakub Kicinski
2020-11-06 6:32 ` Karsten Graul
2020-11-03 9:18 ` [net-next v4 8/8] net: xfrm: " Allen Pais
2020-11-06 0:48 ` Jakub Kicinski
2020-11-06 13:25 ` Steffen Klassert
2020-11-07 18:47 ` [net-next v4 0/8]net: convert tasklets to use new tasklet_setup API Jakub Kicinski
2020-11-09 6:38 ` Allen Pais
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201103091823.586717-7-allen.lkml@gmail.com \
--to=allen.lkml@gmail.com \
--cc=alex.aring@gmail.com \
--cc=apais@linux.microsoft.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gerrit@erg.abdn.ac.uk \
--cc=herbert@gondor.apana.org.au \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=romain.perier@gmail.com \
--cc=santosh.shilimkar@oracle.com \
--cc=stefan@datenfreihafen.org \
--cc=steffen.klassert@secunet.com \
--cc=xiyou.wangcong@gmail.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).