All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next v2 0/8] net: convert tasklets to use new
@ 2020-10-07 10:12 Allen Pais
  2020-10-07 10:12 ` [net-next v2 1/8] net: dccp: convert tasklets to use new tasklet_setup() API Allen Pais
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Allen Pais @ 2020-10-07 10:12 UTC (permalink / raw)
  To: davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais

From: Allen Pais <apais@linux.microsoft.com>

Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")'
introduced a new tasklet initialization API. This series converts
all the net/* drivers to use the new tasklet_setup() API

The following series is based on net-next (9faebeb2d)

v1:
  fix kerneldoc

Allen Pais (8):
  net: dccp: convert tasklets to use new tasklet_setup() API
  net: ipv4: convert tasklets to use new tasklet_setup() API
  net: mac80211: convert tasklets to use new tasklet_setup() API
  net: mac802154: convert tasklets to use new tasklet_setup() API
  net: rds: convert tasklets to use new tasklet_setup() API
  net: sched: convert tasklets to use new tasklet_setup() API
  net: smc: convert tasklets to use new tasklet_setup() API
  net: xfrm: convert tasklets to use new tasklet_setup() API

 net/dccp/timer.c           | 12 ++++++------
 net/ipv4/tcp_output.c      |  8 +++-----
 net/mac80211/ieee80211_i.h |  4 ++--
 net/mac80211/main.c        | 14 +++++---------
 net/mac80211/tx.c          |  5 +++--
 net/mac80211/util.c        |  5 +++--
 net/mac802154/main.c       |  8 +++-----
 net/rds/ib_cm.c            | 14 ++++++--------
 net/sched/sch_atm.c        |  9 +++++----
 net/smc/smc_cdc.c          |  6 +++---
 net/smc/smc_wr.c           | 14 ++++++--------
 net/xfrm/xfrm_input.c      |  7 +++----
 12 files changed, 48 insertions(+), 58 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [net-next v2 1/8] net: dccp: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 [net-next v2 0/8] net: convert tasklets to use new Allen Pais
@ 2020-10-07 10:12 ` Allen Pais
  2020-10-07 10:12 ` [net-next v2 2/8] net: ipv4: " Allen Pais
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Allen Pais @ 2020-10-07 10:12 UTC (permalink / raw)
  To: davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais, Romain Perier

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>
---
 net/dccp/timer.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/dccp/timer.c b/net/dccp/timer.c
index a934d2932..db768f223 100644
--- a/net/dccp/timer.c
+++ b/net/dccp/timer.c
@@ -215,13 +215,14 @@ static void dccp_delack_timer(struct timer_list *t)
 
 /**
  * dccp_write_xmitlet  -  Workhorse for CCID packet dequeueing interface
- * @data: Socket to act on
+ * @t: pointer to the tasklet associated with this handler
  *
  * 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))
@@ -235,16 +236,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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [net-next v2 2/8] net: ipv4: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 [net-next v2 0/8] net: convert tasklets to use new Allen Pais
  2020-10-07 10:12 ` [net-next v2 1/8] net: dccp: convert tasklets to use new tasklet_setup() API Allen Pais
@ 2020-10-07 10:12 ` Allen Pais
  2020-10-07 10:12 ` [net-next v2 3/8] net: mac80211: " Allen Pais
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Allen Pais @ 2020-10-07 10:12 UTC (permalink / raw)
  To: davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais, Romain Perier

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>
---
 net/ipv4/tcp_output.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index bf48cd73e..6e998d428 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1038,9 +1038,9 @@ static void tcp_tsq_handler(struct sock *sk)
  * transferring tsq->head because tcp_wfree() might
  * interrupt us (non NAPI drivers)
  */
-static void tcp_tasklet_func(unsigned long data)
+static void tcp_tasklet_func(struct tasklet_struct *t)
 {
-	struct tsq_tasklet *tsq = (struct tsq_tasklet *)data;
+	struct tsq_tasklet *tsq = from_tasklet(tsq,  t, tasklet);
 	LIST_HEAD(list);
 	unsigned long flags;
 	struct list_head *q, *n;
@@ -1125,9 +1125,7 @@ void __init tcp_tasklet_init(void)
 		struct tsq_tasklet *tsq = &per_cpu(tsq_tasklet, i);
 
 		INIT_LIST_HEAD(&tsq->head);
-		tasklet_init(&tsq->tasklet,
-			     tcp_tasklet_func,
-			     (unsigned long)tsq);
+		tasklet_setup(&tsq->tasklet, tcp_tasklet_func);
 	}
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [net-next v2 3/8] net: mac80211: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 [net-next v2 0/8] net: convert tasklets to use new Allen Pais
  2020-10-07 10:12 ` [net-next v2 1/8] net: dccp: convert tasklets to use new tasklet_setup() API Allen Pais
  2020-10-07 10:12 ` [net-next v2 2/8] net: ipv4: " Allen Pais
@ 2020-10-07 10:12 ` Allen Pais
  2020-10-07 10:55   ` Johannes Berg
  2020-10-07 10:12 ` [net-next v2 4/8] net: mac802154: " Allen Pais
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Allen Pais @ 2020-10-07 10:12 UTC (permalink / raw)
  To: davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais, Romain Perier

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>
---
 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 c3e357857..6d083a146 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1795,7 +1795,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,
@@ -2143,7 +2143,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 523380aed..48ab05186 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 8ba10a48d..a50c0edb1 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4406,9 +4406,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 493420604..a25e47750 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -386,9 +386,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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [net-next v2 4/8] net: mac802154: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 [net-next v2 0/8] net: convert tasklets to use new Allen Pais
                   ` (2 preceding siblings ...)
  2020-10-07 10:12 ` [net-next v2 3/8] net: mac80211: " Allen Pais
@ 2020-10-07 10:12 ` Allen Pais
  2020-10-07 10:12 ` [net-next v2 5/8] net: rds: " Allen Pais
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Allen Pais @ 2020-10-07 10:12 UTC (permalink / raw)
  To: davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais, Romain Perier

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.

Acked-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <apais@linux.microsoft.com>
---
 net/mac802154/main.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/net/mac802154/main.c b/net/mac802154/main.c
index 06ea0f8bf..520cedc59 100644
--- a/net/mac802154/main.c
+++ b/net/mac802154/main.c
@@ -20,9 +20,9 @@
 #include "ieee802154_i.h"
 #include "cfg.h"
 
-static void ieee802154_tasklet_handler(unsigned long data)
+static void ieee802154_tasklet_handler(struct tasklet_struct *t)
 {
-	struct ieee802154_local *local = (struct ieee802154_local *)data;
+	struct ieee802154_local *local = from_tasklet(local, t, tasklet);
 	struct sk_buff *skb;
 
 	while ((skb = skb_dequeue(&local->skb_queue))) {
@@ -91,9 +91,7 @@ ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops)
 	INIT_LIST_HEAD(&local->interfaces);
 	mutex_init(&local->iflist_mtx);
 
-	tasklet_init(&local->tasklet,
-		     ieee802154_tasklet_handler,
-		     (unsigned long)local);
+	tasklet_setup(&local->tasklet, ieee802154_tasklet_handler);
 
 	skb_queue_head_init(&local->skb_queue);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [net-next v2 5/8] net: rds: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 [net-next v2 0/8] net: convert tasklets to use new Allen Pais
                   ` (3 preceding siblings ...)
  2020-10-07 10:12 ` [net-next v2 4/8] net: mac802154: " Allen Pais
@ 2020-10-07 10:12 ` Allen Pais
  2020-10-07 10:12 ` [net-next v2 6/8] net: sched: " Allen Pais
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Allen Pais @ 2020-10-07 10:12 UTC (permalink / raw)
  To: davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais, Romain Perier

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>
---
 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 06603dd1c..396d6abf8 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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [net-next v2 6/8] net: sched: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 [net-next v2 0/8] net: convert tasklets to use new Allen Pais
                   ` (4 preceding siblings ...)
  2020-10-07 10:12 ` [net-next v2 5/8] net: rds: " Allen Pais
@ 2020-10-07 10:12 ` Allen Pais
  2020-10-07 16:52   ` Eric Dumazet
  2020-10-07 10:12 ` [net-next v2 7/8] net: smc: " Allen Pais
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Allen Pais @ 2020-10-07 10:12 UTC (permalink / raw)
  To: davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais, Romain Perier

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>
---
 net/sched/sch_atm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index 1c281cc81..0a4452178 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -466,10 +466,11 @@ 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 = (struct Qdisc *)((char *) p -
+					     QDISC_ALIGN(sizeof(struct Qdisc)));
 	struct atm_flow_data *flow;
 	struct sk_buff *skb;
 
@@ -563,7 +564,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


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [net-next v2 7/8] net: smc: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 [net-next v2 0/8] net: convert tasklets to use new Allen Pais
                   ` (5 preceding siblings ...)
  2020-10-07 10:12 ` [net-next v2 6/8] net: sched: " Allen Pais
@ 2020-10-07 10:12 ` Allen Pais
  2020-10-07 19:17   ` Karsten Graul
  2020-10-07 10:12 ` [net-next v2 8/8] net: xfrm: " Allen Pais
  2020-10-09 15:44 ` [net-next v2 0/8] net: convert tasklets to use new Jakub Kicinski
  8 siblings, 1 reply; 14+ messages in thread
From: Allen Pais @ 2020-10-07 10:12 UTC (permalink / raw)
  To: davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais, Romain Perier

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>
---
 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 b1ce6ccbf..f23f55805 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 1e23cdd41..cbc73a7e4 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)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [net-next v2 8/8] net: xfrm: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 [net-next v2 0/8] net: convert tasklets to use new Allen Pais
                   ` (6 preceding siblings ...)
  2020-10-07 10:12 ` [net-next v2 7/8] net: smc: " Allen Pais
@ 2020-10-07 10:12 ` Allen Pais
  2020-10-09 15:44 ` [net-next v2 0/8] net: convert tasklets to use new Jakub Kicinski
  8 siblings, 0 replies; 14+ messages in thread
From: Allen Pais @ 2020-10-07 10:12 UTC (permalink / raw)
  To: davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais, Romain Perier

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>
---
 net/xfrm/xfrm_input.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index 37456d022..be6351e3f 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -760,9 +760,9 @@ int xfrm_input_resume(struct sk_buff *skb, int nexthdr)
 }
 EXPORT_SYMBOL(xfrm_input_resume);
 
-static void xfrm_trans_reinject(unsigned long data)
+static void xfrm_trans_reinject(struct tasklet_struct *t)
 {
-	struct xfrm_trans_tasklet *trans = (void *)data;
+	struct xfrm_trans_tasklet *trans = from_tasklet(trans, t, tasklet);
 	struct sk_buff_head queue;
 	struct sk_buff *skb;
 
@@ -818,7 +818,6 @@ void __init xfrm_input_init(void)
 
 		trans = &per_cpu(xfrm_trans_tasklet, i);
 		__skb_queue_head_init(&trans->queue);
-		tasklet_init(&trans->tasklet, xfrm_trans_reinject,
-			     (unsigned long)trans);
+		tasklet_setup(&trans->tasklet, xfrm_trans_reinject);
 	}
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [net-next v2 3/8] net: mac80211: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 ` [net-next v2 3/8] net: mac80211: " Allen Pais
@ 2020-10-07 10:55   ` Johannes Berg
  2020-10-07 10:57     ` Allen Pais
  0 siblings, 1 reply; 14+ messages in thread
From: Johannes Berg @ 2020-10-07 10:55 UTC (permalink / raw)
  To: Allen Pais, davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, alex.aring, stefan,
	santosh.shilimkar, jhs, xiyou.wangcong, jiri, steffen.klassert,
	herbert, netdev, Allen Pais, Romain Perier

On Wed, 2020-10-07 at 15:42 +0530, Allen Pais wrote:
> 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.
> 

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

I'm going to assume for now that the whole series goes through the net-
next tree, holler if not.

Thanks,
johannes



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [net-next v2 3/8] net: mac80211: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:55   ` Johannes Berg
@ 2020-10-07 10:57     ` Allen Pais
  0 siblings, 0 replies; 14+ messages in thread
From: Allen Pais @ 2020-10-07 10:57 UTC (permalink / raw)
  To: Johannes Berg, Allen Pais, davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, alex.aring, stefan,
	santosh.shilimkar, jhs, xiyou.wangcong, jiri, steffen.klassert,
	herbert, netdev, Romain Perier



On 07/10/20 4:25 pm, Johannes Berg wrote:
> On Wed, 2020-10-07 at 15:42 +0530, Allen Pais wrote:
>> 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.
>>
> 
> Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
> 
> I'm going to assume for now that the whole series goes through the net-
> next tree, holler if not.

Yes. Thank you.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [net-next v2 6/8] net: sched: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 ` [net-next v2 6/8] net: sched: " Allen Pais
@ 2020-10-07 16:52   ` Eric Dumazet
  0 siblings, 0 replies; 14+ messages in thread
From: Eric Dumazet @ 2020-10-07 16:52 UTC (permalink / raw)
  To: Allen Pais, davem
  Cc: gerrit, kuba, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais, Romain Perier



On 10/7/20 12:12 PM, Allen Pais wrote:
> 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>
> ---
>  net/sched/sch_atm.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
> index 1c281cc81..0a4452178 100644
> --- a/net/sched/sch_atm.c
> +++ b/net/sched/sch_atm.c
> @@ -466,10 +466,11 @@ 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 = (struct Qdisc *)((char *) p -
> +					     QDISC_ALIGN(sizeof(struct Qdisc)));

Oh well. I would rather get rid of QDISC_ALIGN() completely, instead
of spreading it all over the places.

I have sent https://patchwork.ozlabs.org/project/netdev/patch/20201007165111.172419-1-eric.dumazet@gmail.com/


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [net-next v2 7/8] net: smc: convert tasklets to use new tasklet_setup() API
  2020-10-07 10:12 ` [net-next v2 7/8] net: smc: " Allen Pais
@ 2020-10-07 19:17   ` Karsten Graul
  0 siblings, 0 replies; 14+ messages in thread
From: Karsten Graul @ 2020-10-07 19:17 UTC (permalink / raw)
  To: Allen Pais
  Cc: davem, gerrit, kuba, edumazet, kuznet, yoshfuji, johannes,
	alex.aring, stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais, Romain Perier

On Wed,  7 Oct 2020 15:42:18 +0530
Allen Pais <allen.lkml@gmail.com> wrote:

> 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.
> 

Acked-by: Karsten Graul <kgraul@linux.ibm.com>

-- 
Karsten

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [net-next v2 0/8] net: convert tasklets to use new
  2020-10-07 10:12 [net-next v2 0/8] net: convert tasklets to use new Allen Pais
                   ` (7 preceding siblings ...)
  2020-10-07 10:12 ` [net-next v2 8/8] net: xfrm: " Allen Pais
@ 2020-10-09 15:44 ` Jakub Kicinski
  8 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2020-10-09 15:44 UTC (permalink / raw)
  To: Allen Pais
  Cc: davem, gerrit, edumazet, kuznet, yoshfuji, johannes, alex.aring,
	stefan, santosh.shilimkar, jhs, xiyou.wangcong, jiri,
	steffen.klassert, herbert, netdev, Allen Pais

On Wed,  7 Oct 2020 15:42:11 +0530 Allen Pais wrote:
> From: Allen Pais <apais@linux.microsoft.com>
> 
> Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")'
> introduced a new tasklet initialization API. This series converts
> all the net/* drivers to use the new tasklet_setup() API
> 
> The following series is based on net-next (9faebeb2d)
> 
> v1:
>   fix kerneldoc

Please respin, Eric's patch is in net-next now.

FWIW looks like both of your series for net-next had the subject of the
cover letter cut off.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-10-09 15:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 10:12 [net-next v2 0/8] net: convert tasklets to use new Allen Pais
2020-10-07 10:12 ` [net-next v2 1/8] net: dccp: convert tasklets to use new tasklet_setup() API Allen Pais
2020-10-07 10:12 ` [net-next v2 2/8] net: ipv4: " Allen Pais
2020-10-07 10:12 ` [net-next v2 3/8] net: mac80211: " Allen Pais
2020-10-07 10:55   ` Johannes Berg
2020-10-07 10:57     ` Allen Pais
2020-10-07 10:12 ` [net-next v2 4/8] net: mac802154: " Allen Pais
2020-10-07 10:12 ` [net-next v2 5/8] net: rds: " Allen Pais
2020-10-07 10:12 ` [net-next v2 6/8] net: sched: " Allen Pais
2020-10-07 16:52   ` Eric Dumazet
2020-10-07 10:12 ` [net-next v2 7/8] net: smc: " Allen Pais
2020-10-07 19:17   ` Karsten Graul
2020-10-07 10:12 ` [net-next v2 8/8] net: xfrm: " Allen Pais
2020-10-09 15:44 ` [net-next v2 0/8] net: convert tasklets to use new Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.