linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue
@ 2024-06-21  5:05 Allen Pais
  2024-06-21  5:05 ` [PATCH 07/15] net: thunderx: Convert tasklet API to new bottom half workqueue mechanism Allen Pais
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Allen Pais @ 2024-06-21  5:05 UTC (permalink / raw)
  To: kuba, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: jes, davem, edumazet, pabeni, kda, cai.huoqing, dougmill, npiggin,
	christophe.leroy, aneesh.kumar, naveen.n.rao, nnac123, tlfalcon,
	cooldavid, marcin.s.wojtas, mlindner, stephen, nbd, sean.wang,
	Mark-MC.Lee, lorenzo, borisp, bryan.whitehead, UNGLinuxDriver,
	louis.peens, richardcochran, linux-rdma, linux-kernel,
	linux-acenic, linux-net-drivers, Allen Pais, linux-arm-kernel,
	linux-mediatek

The only generic interface to execute asynchronously in the BH context is
tasklet; however, it's marked deprecated and has some design flaws. To
replace tasklets, BH workqueue support was recently added. A BH workqueue
behaves similarly to regular workqueues except that the queued work items
are executed in the BH context.

This patch converts a few drivers in drivers/ethernet/* from tasklet
to BH workqueue. The next set will be sent out after the next -rc is
out.

This series is based on 
commit a6ec08beec9e ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")

First version converting all the drivers can be found at:
https://lore.kernel.org/all/20240507190111.16710
-2-apais@linux.microsoft.com/


Allen Pais (15):
  net: alteon: Convert tasklet API to new bottom half workqueue
    mechanism
  net: xgbe: Convert tasklet API to new bottom half workqueue mechanism
  net: cnic: Convert tasklet API to new bottom half workqueue mechanism
  net: macb: Convert tasklet API to new bottom half workqueue mechanism
  net: cavium/liquidio: Convert tasklet API to new bottom half workqueue
    mechanism
  net: octeon: Convert tasklet API to new bottom half workqueue
    mechanism
  net: thunderx: Convert tasklet API to new bottom half workqueue
    mechanism
  net: chelsio: Convert tasklet API to new bottom half workqueue
    mechanism
  net: sundance: Convert tasklet API to new bottom half workqueue
    mechanism
  net: hinic: Convert tasklet API to new bottom half workqueue mechanism
  net: ehea: Convert tasklet API to new bottom half workqueue mechanism
  net: ibmvnic: Convert tasklet API to new bottom half workqueue
    mechanism
  net: jme: Convert tasklet API to new bottom half workqueue mechanism
  net: marvell: Convert tasklet API to new bottom half workqueue
    mechanism
  net: mtk-wed: Convert tasklet API to new bottom half workqueue
    mechanism

 drivers/net/ethernet/alteon/acenic.c          | 26 +++----
 drivers/net/ethernet/alteon/acenic.h          |  8 +--
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c      | 30 ++++----
 drivers/net/ethernet/amd/xgbe/xgbe-i2c.c      | 16 ++---
 drivers/net/ethernet/amd/xgbe/xgbe-mdio.c     | 16 ++---
 drivers/net/ethernet/amd/xgbe/xgbe-pci.c      |  4 +-
 drivers/net/ethernet/amd/xgbe/xgbe.h          | 10 +--
 drivers/net/ethernet/broadcom/cnic.c          | 19 ++---
 drivers/net/ethernet/broadcom/cnic.h          |  2 +-
 drivers/net/ethernet/cadence/macb.h           |  3 +-
 drivers/net/ethernet/cadence/macb_main.c      | 10 +--
 .../net/ethernet/cavium/liquidio/lio_core.c   |  4 +-
 .../net/ethernet/cavium/liquidio/lio_main.c   | 24 +++----
 .../ethernet/cavium/liquidio/lio_vf_main.c    | 10 +--
 .../ethernet/cavium/liquidio/octeon_droq.c    |  4 +-
 .../ethernet/cavium/liquidio/octeon_main.h    |  4 +-
 .../net/ethernet/cavium/octeon/octeon_mgmt.c  | 13 ++--
 drivers/net/ethernet/cavium/thunder/nic.h     |  5 +-
 .../net/ethernet/cavium/thunder/nicvf_main.c  | 24 +++----
 .../ethernet/cavium/thunder/nicvf_queues.c    |  4 +-
 .../ethernet/cavium/thunder/nicvf_queues.h    |  2 +-
 drivers/net/ethernet/chelsio/cxgb/sge.c       | 19 ++---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h    |  9 +--
 .../net/ethernet/chelsio/cxgb4/cxgb4_main.c   |  2 +-
 .../ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c  |  4 +-
 .../net/ethernet/chelsio/cxgb4/cxgb4_uld.c    |  2 +-
 drivers/net/ethernet/chelsio/cxgb4/sge.c      | 40 +++++------
 drivers/net/ethernet/chelsio/cxgb4vf/sge.c    |  6 +-
 drivers/net/ethernet/dlink/sundance.c         | 41 +++++------
 .../net/ethernet/huawei/hinic/hinic_hw_cmdq.c |  2 +-
 .../net/ethernet/huawei/hinic/hinic_hw_eqs.c  | 17 +++--
 .../net/ethernet/huawei/hinic/hinic_hw_eqs.h  |  2 +-
 drivers/net/ethernet/ibm/ehea/ehea.h          |  3 +-
 drivers/net/ethernet/ibm/ehea/ehea_main.c     | 14 ++--
 drivers/net/ethernet/ibm/ibmvnic.c            | 24 +++----
 drivers/net/ethernet/ibm/ibmvnic.h            |  2 +-
 drivers/net/ethernet/jme.c                    | 72 +++++++++----------
 drivers/net/ethernet/jme.h                    |  8 +--
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  4 +-
 drivers/net/ethernet/marvell/skge.c           | 12 ++--
 drivers/net/ethernet/marvell/skge.h           |  3 +-
 drivers/net/ethernet/mediatek/mtk_wed_wo.c    | 12 ++--
 drivers/net/ethernet/mediatek/mtk_wed_wo.h    |  3 +-
 43 files changed, 273 insertions(+), 266 deletions(-)

-- 
2.34.1



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

* [PATCH 07/15] net: thunderx: Convert tasklet API to new bottom half workqueue mechanism
  2024-06-21  5:05 [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Allen Pais
@ 2024-06-21  5:05 ` Allen Pais
  2024-06-21 11:49   ` Sunil Kovvuri Goutham
  2024-06-21  5:05 ` [PATCH 15/15] net: mtk-wed: " Allen Pais
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Allen Pais @ 2024-06-21  5:05 UTC (permalink / raw)
  To: kuba, Sunil Goutham, David S. Miller, Eric Dumazet, Paolo Abeni
  Cc: jes, kda, cai.huoqing, dougmill, npiggin, christophe.leroy,
	aneesh.kumar, naveen.n.rao, nnac123, tlfalcon, cooldavid,
	marcin.s.wojtas, mlindner, stephen, nbd, sean.wang, Mark-MC.Lee,
	lorenzo, matthias.bgg, angelogioacchino.delregno, borisp,
	bryan.whitehead, UNGLinuxDriver, louis.peens, richardcochran,
	linux-rdma, linux-kernel, linux-acenic, linux-net-drivers,
	Allen Pais, linux-arm-kernel, netdev

Migrate tasklet APIs to the new bottom half workqueue mechanism. It
replaces all occurrences of tasklet usage with the appropriate workqueue
APIs throughout the cavium/thunderx driver. This transition ensures
compatibility with the latest design and enhances performance.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/cavium/thunder/nic.h     |  5 ++--
 .../net/ethernet/cavium/thunder/nicvf_main.c  | 24 +++++++++----------
 .../ethernet/cavium/thunder/nicvf_queues.c    |  4 ++--
 .../ethernet/cavium/thunder/nicvf_queues.h    |  2 +-
 4 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/nic.h b/drivers/net/ethernet/cavium/thunder/nic.h
index 090d6b83982a..ecc175b6e7fa 100644
--- a/drivers/net/ethernet/cavium/thunder/nic.h
+++ b/drivers/net/ethernet/cavium/thunder/nic.h
@@ -8,6 +8,7 @@
 
 #include <linux/netdevice.h>
 #include <linux/interrupt.h>
+#include <linux/workqueue.h>
 #include <linux/pci.h>
 #include "thunder_bgx.h"
 
@@ -295,7 +296,7 @@ struct nicvf {
 	bool			rb_work_scheduled;
 	struct page		*rb_page;
 	struct delayed_work	rbdr_work;
-	struct tasklet_struct	rbdr_task;
+	struct work_struct	rbdr_bh_work;
 
 	/* Secondary Qset */
 	u8			sqs_count;
@@ -319,7 +320,7 @@ struct nicvf {
 	bool			loopback_supported;
 	struct nicvf_rss_info	rss_info;
 	struct nicvf_pfc	pfc;
-	struct tasklet_struct	qs_err_task;
+	struct work_struct	qs_err_bh_work;
 	struct work_struct	reset_task;
 	struct nicvf_work       rx_mode_work;
 	/* spinlock to protect workqueue arguments from concurrent access */
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index aebb9fef3f6e..b0878bd25cf0 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -982,9 +982,9 @@ static int nicvf_poll(struct napi_struct *napi, int budget)
  *
  * As of now only CQ errors are handled
  */
-static void nicvf_handle_qs_err(struct tasklet_struct *t)
+static void nicvf_handle_qs_err(struct work_struct *work)
 {
-	struct nicvf *nic = from_tasklet(nic, t, qs_err_task);
+	struct nicvf *nic = from_work(nic, work, qs_err_bh_work);
 	struct queue_set *qs = nic->qs;
 	int qidx;
 	u64 status;
@@ -1069,7 +1069,7 @@ static irqreturn_t nicvf_rbdr_intr_handler(int irq, void *nicvf_irq)
 		if (!nicvf_is_intr_enabled(nic, NICVF_INTR_RBDR, qidx))
 			continue;
 		nicvf_disable_intr(nic, NICVF_INTR_RBDR, qidx);
-		tasklet_hi_schedule(&nic->rbdr_task);
+		queue_work(system_bh_highpri_wq, &nic->rbdr_bh_work);
 		/* Clear interrupt */
 		nicvf_clear_intr(nic, NICVF_INTR_RBDR, qidx);
 	}
@@ -1085,7 +1085,7 @@ static irqreturn_t nicvf_qs_err_intr_handler(int irq, void *nicvf_irq)
 
 	/* Disable Qset err interrupt and schedule softirq */
 	nicvf_disable_intr(nic, NICVF_INTR_QS_ERR, 0);
-	tasklet_hi_schedule(&nic->qs_err_task);
+	queue_work(system_bh_highpri_wq, &nic->qs_err_bh_work);
 	nicvf_clear_intr(nic, NICVF_INTR_QS_ERR, 0);
 
 	return IRQ_HANDLED;
@@ -1364,8 +1364,8 @@ int nicvf_stop(struct net_device *netdev)
 	for (irq = 0; irq < nic->num_vec; irq++)
 		synchronize_irq(pci_irq_vector(nic->pdev, irq));
 
-	tasklet_kill(&nic->rbdr_task);
-	tasklet_kill(&nic->qs_err_task);
+	cancel_work_sync(&nic->rbdr_bh_work);
+	cancel_work_sync(&nic->qs_err_bh_work);
 	if (nic->rb_work_scheduled)
 		cancel_delayed_work_sync(&nic->rbdr_work);
 
@@ -1488,11 +1488,11 @@ int nicvf_open(struct net_device *netdev)
 		nicvf_hw_set_mac_addr(nic, netdev);
 	}
 
-	/* Init tasklet for handling Qset err interrupt */
-	tasklet_setup(&nic->qs_err_task, nicvf_handle_qs_err);
+	/* Init bh_work for handling Qset err interrupt */
+	INIT_WORK(&nic->qs_err_bh_work, nicvf_handle_qs_err);
 
-	/* Init RBDR tasklet which will refill RBDR */
-	tasklet_setup(&nic->rbdr_task, nicvf_rbdr_task);
+	/* Init RBDR bh_work which will refill RBDR */
+	INIT_WORK(&nic->rbdr_bh_work, nicvf_rbdr_bh_work);
 	INIT_DELAYED_WORK(&nic->rbdr_work, nicvf_rbdr_work);
 
 	/* Configure CPI alorithm */
@@ -1561,8 +1561,8 @@ int nicvf_open(struct net_device *netdev)
 cleanup:
 	nicvf_disable_intr(nic, NICVF_INTR_MBOX, 0);
 	nicvf_unregister_interrupts(nic);
-	tasklet_kill(&nic->qs_err_task);
-	tasklet_kill(&nic->rbdr_task);
+	cancel_work_sync(&nic->qs_err_bh_work);
+	cancel_work_sync(&nic->rbdr_bh_work);
 napi_del:
 	for (qidx = 0; qidx < qs->cq_cnt; qidx++) {
 		cq_poll = nic->napi[qidx];
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
index 06397cc8bb36..ad71160879e4 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.c
@@ -461,9 +461,9 @@ void nicvf_rbdr_work(struct work_struct *work)
 }
 
 /* In Softirq context, alloc rcv buffers in atomic mode */
-void nicvf_rbdr_task(struct tasklet_struct *t)
+void nicvf_rbdr_bh_work(struct work_struct *work)
 {
-	struct nicvf *nic = from_tasklet(nic, t, rbdr_task);
+	struct nicvf *nic = from_work(nic, work, rbdr_bh_work);
 
 	nicvf_refill_rbdr(nic, GFP_ATOMIC);
 	if (nic->rb_alloc_fail) {
diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
index 8453defc296c..c6f18fb7c50e 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_queues.h
@@ -348,7 +348,7 @@ void nicvf_xdp_sq_doorbell(struct nicvf *nic, struct snd_queue *sq, int sq_num);
 
 struct sk_buff *nicvf_get_rcv_skb(struct nicvf *nic,
 				  struct cqe_rx_t *cqe_rx, bool xdp);
-void nicvf_rbdr_task(struct tasklet_struct *t);
+void nicvf_rbdr_bh_work(struct work_struct *work);
 void nicvf_rbdr_work(struct work_struct *work);
 
 void nicvf_enable_intr(struct nicvf *nic, int int_type, int q_idx);
-- 
2.34.1



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

* [PATCH 15/15] net: mtk-wed: Convert tasklet API to new bottom half workqueue mechanism
  2024-06-21  5:05 [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Allen Pais
  2024-06-21  5:05 ` [PATCH 07/15] net: thunderx: Convert tasklet API to new bottom half workqueue mechanism Allen Pais
@ 2024-06-21  5:05 ` Allen Pais
  2024-06-21 15:25 ` [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Stephen Hemminger
  2024-06-25 10:24 ` Paolo Abeni
  3 siblings, 0 replies; 7+ messages in thread
From: Allen Pais @ 2024-06-21  5:05 UTC (permalink / raw)
  To: kuba, Felix Fietkau, Sean Wang, Mark Lee, Lorenzo Bianconi,
	David S. Miller, Eric Dumazet, Paolo Abeni, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: jes, kda, cai.huoqing, dougmill, npiggin, christophe.leroy,
	aneesh.kumar, naveen.n.rao, nnac123, tlfalcon, cooldavid,
	marcin.s.wojtas, mlindner, stephen, borisp, bryan.whitehead,
	UNGLinuxDriver, louis.peens, richardcochran, linux-rdma,
	linux-kernel, linux-acenic, linux-net-drivers, Allen Pais, netdev,
	linux-arm-kernel, linux-mediatek

Migrate tasklet APIs to the new bottom half workqueue mechanism. It
replaces all occurrences of tasklet usage with the appropriate workqueue
APIs throughout the mtk-wed driver. This transition ensures compatibility
with the latest design and enhances performance.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/mediatek/mtk_wed_wo.c | 12 ++++++------
 drivers/net/ethernet/mediatek/mtk_wed_wo.h |  3 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_wed_wo.c b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
index 7063c78bd35f..acca9ec67fcf 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
@@ -71,7 +71,7 @@ static void
 mtk_wed_wo_irq_enable(struct mtk_wed_wo *wo, u32 mask)
 {
 	mtk_wed_wo_set_isr_mask(wo, 0, mask, false);
-	tasklet_schedule(&wo->mmio.irq_tasklet);
+	queue_work(system_bh_wq, &wo->mmio.irq_bh_work);
 }
 
 static void
@@ -227,14 +227,14 @@ mtk_wed_wo_irq_handler(int irq, void *data)
 	struct mtk_wed_wo *wo = data;
 
 	mtk_wed_wo_set_isr(wo, 0);
-	tasklet_schedule(&wo->mmio.irq_tasklet);
+	queue_work(system_bh_wq, &wo->mmio.irq_bh_work);
 
 	return IRQ_HANDLED;
 }
 
-static void mtk_wed_wo_irq_tasklet(struct tasklet_struct *t)
+static void mtk_wed_wo_irq_bh_work(struct work_struct *work)
 {
-	struct mtk_wed_wo *wo = from_tasklet(wo, t, mmio.irq_tasklet);
+	struct mtk_wed_wo *wo = from_work(wo, work, mmio.irq_bh_work);
 	u32 intr, mask;
 
 	/* disable interrupts */
@@ -395,7 +395,7 @@ mtk_wed_wo_hardware_init(struct mtk_wed_wo *wo)
 	wo->mmio.irq = irq_of_parse_and_map(np, 0);
 	wo->mmio.irq_mask = MTK_WED_WO_ALL_INT_MASK;
 	spin_lock_init(&wo->mmio.lock);
-	tasklet_setup(&wo->mmio.irq_tasklet, mtk_wed_wo_irq_tasklet);
+	INIT_WORK(&wo->mmio.irq_bh_work, mtk_wed_wo_irq_bh_work);
 
 	ret = devm_request_irq(wo->hw->dev, wo->mmio.irq,
 			       mtk_wed_wo_irq_handler, IRQF_TRIGGER_HIGH,
@@ -449,7 +449,7 @@ mtk_wed_wo_hw_deinit(struct mtk_wed_wo *wo)
 	/* disable interrupts */
 	mtk_wed_wo_set_isr(wo, 0);
 
-	tasklet_disable(&wo->mmio.irq_tasklet);
+	disable_work_sync(&wo->mmio.irq_bh_work);
 
 	disable_irq(wo->mmio.irq);
 	devm_free_irq(wo->hw->dev, wo->mmio.irq, wo);
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_wo.h b/drivers/net/ethernet/mediatek/mtk_wed_wo.h
index 87a67fa3868d..50d619fa213a 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.h
+++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.h
@@ -6,6 +6,7 @@
 
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
+#include <linux/workqueue.h>
 
 struct mtk_wed_hw;
 
@@ -247,7 +248,7 @@ struct mtk_wed_wo {
 		struct regmap *regs;
 
 		spinlock_t lock;
-		struct tasklet_struct irq_tasklet;
+		struct work_struct irq_bh_work;
 		int irq;
 		u32 irq_mask;
 	} mmio;
-- 
2.34.1



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

* RE: [PATCH 07/15] net: thunderx: Convert tasklet API to new bottom half workqueue mechanism
  2024-06-21  5:05 ` [PATCH 07/15] net: thunderx: Convert tasklet API to new bottom half workqueue mechanism Allen Pais
@ 2024-06-21 11:49   ` Sunil Kovvuri Goutham
  0 siblings, 0 replies; 7+ messages in thread
From: Sunil Kovvuri Goutham @ 2024-06-21 11:49 UTC (permalink / raw)
  To: Allen Pais, kuba@kernel.org, David S. Miller, Eric Dumazet,
	Paolo Abeni
  Cc: jes@trained-monkey.org, kda@linux-powerpc.org,
	cai.huoqing@linux.dev, dougmill@linux.ibm.com, npiggin@gmail.com,
	christophe.leroy@csgroup.eu, aneesh.kumar@kernel.org,
	naveen.n.rao@linux.ibm.com, nnac123@linux.ibm.com,
	tlfalcon@linux.ibm.com, cooldavid@cooldavid.org,
	marcin.s.wojtas@gmail.com, Mirko Lindner,
	stephen@networkplumber.org, nbd@nbd.name, sean.wang@mediatek.com,
	Mark-MC.Lee@mediatek.com, lorenzo@kernel.org,
	matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com,
	borisp@nvidia.com, bryan.whitehead@microchip.com,
	UNGLinuxDriver@microchip.com, louis.peens@corigine.com,
	richardcochran@gmail.com, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-acenic@sunsite.dk,
	linux-net-drivers@amd.com, linux-arm-kernel@lists.infradead.org,
	netdev@vger.kernel.org

>Migrate tasklet APIs to the new bottom half workqueue mechanism. It replaces all
>occurrences of tasklet usage with the appropriate workqueue APIs throughout the
>cavium/thunderx driver. This transition ensures compatibility with the latest design
>and enhances performance.
>
>Signed-off-by: Allen Pais <allen.lkml@gmail.com>
>---
> drivers/net/ethernet/cavium/thunder/nic.h     |  5 ++--
> .../net/ethernet/cavium/thunder/nicvf_main.c  | 24 +++++++++----------
> .../ethernet/cavium/thunder/nicvf_queues.c    |  4 ++--
> .../ethernet/cavium/thunder/nicvf_queues.h    |  2 +-
> 4 files changed, 18 insertions(+), 17 deletions(-)
>

LGTM
Reviewed-by: Sunil Goutham <sgoutham@marvell.com>


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

* Re: [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue
  2024-06-21  5:05 [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Allen Pais
  2024-06-21  5:05 ` [PATCH 07/15] net: thunderx: Convert tasklet API to new bottom half workqueue mechanism Allen Pais
  2024-06-21  5:05 ` [PATCH 15/15] net: mtk-wed: " Allen Pais
@ 2024-06-21 15:25 ` Stephen Hemminger
  2024-06-21 17:49   ` Allen
  2024-06-25 10:24 ` Paolo Abeni
  3 siblings, 1 reply; 7+ messages in thread
From: Stephen Hemminger @ 2024-06-21 15:25 UTC (permalink / raw)
  To: Allen Pais
  Cc: kuba, Matthias Brugger, AngeloGioacchino Del Regno, jes, davem,
	edumazet, pabeni, kda, cai.huoqing, dougmill, npiggin,
	christophe.leroy, aneesh.kumar, naveen.n.rao, nnac123, tlfalcon,
	cooldavid, marcin.s.wojtas, mlindner, nbd, sean.wang, Mark-MC.Lee,
	lorenzo, borisp, bryan.whitehead, UNGLinuxDriver, louis.peens,
	richardcochran, linux-rdma, linux-kernel, linux-acenic,
	linux-net-drivers, linux-arm-kernel, linux-mediatek

On Thu, 20 Jun 2024 22:05:10 -0700
Allen Pais <allen.lkml@gmail.com> wrote:

> The only generic interface to execute asynchronously in the BH context is
> tasklet; however, it's marked deprecated and has some design flaws. To
> replace tasklets, BH workqueue support was recently added. A BH workqueue
> behaves similarly to regular workqueues except that the queued work items
> are executed in the BH context.
> 
> This patch converts a few drivers in drivers/ethernet/* from tasklet
> to BH workqueue. The next set will be sent out after the next -rc is
> out.
> 
> This series is based on 
> commit a6ec08beec9e ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
> 
> First version converting all the drivers can be found at:
> https://lore.kernel.org/all/20240507190111.16710
> -2-apais@linux.microsoft.com/
> 
> 
> Allen Pais (15):
>   net: alteon: Convert tasklet API to new bottom half workqueue
>     mechanism
>   net: xgbe: Convert tasklet API to new bottom half workqueue mechanism
>   net: cnic: Convert tasklet API to new bottom half workqueue mechanism
>   net: macb: Convert tasklet API to new bottom half workqueue mechanism
>   net: cavium/liquidio: Convert tasklet API to new bottom half workqueue
>     mechanism
>   net: octeon: Convert tasklet API to new bottom half workqueue
>     mechanism
>   net: thunderx: Convert tasklet API to new bottom half workqueue
>     mechanism
>   net: chelsio: Convert tasklet API to new bottom half workqueue
>     mechanism
>   net: sundance: Convert tasklet API to new bottom half workqueue
>     mechanism
>   net: hinic: Convert tasklet API to new bottom half workqueue mechanism
>   net: ehea: Convert tasklet API to new bottom half workqueue mechanism
>   net: ibmvnic: Convert tasklet API to new bottom half workqueue
>     mechanism
>   net: jme: Convert tasklet API to new bottom half workqueue mechanism
>   net: marvell: Convert tasklet API to new bottom half workqueue
>     mechanism
>   net: mtk-wed: Convert tasklet API to new bottom half workqueue
>     mechanism
> 
>  drivers/net/ethernet/alteon/acenic.c          | 26 +++----
>  drivers/net/ethernet/alteon/acenic.h          |  8 +--
>  drivers/net/ethernet/amd/xgbe/xgbe-drv.c      | 30 ++++----
>  drivers/net/ethernet/amd/xgbe/xgbe-i2c.c      | 16 ++---
>  drivers/net/ethernet/amd/xgbe/xgbe-mdio.c     | 16 ++---
>  drivers/net/ethernet/amd/xgbe/xgbe-pci.c      |  4 +-
>  drivers/net/ethernet/amd/xgbe/xgbe.h          | 10 +--
>  drivers/net/ethernet/broadcom/cnic.c          | 19 ++---
>  drivers/net/ethernet/broadcom/cnic.h          |  2 +-
>  drivers/net/ethernet/cadence/macb.h           |  3 +-
>  drivers/net/ethernet/cadence/macb_main.c      | 10 +--
>  .../net/ethernet/cavium/liquidio/lio_core.c   |  4 +-
>  .../net/ethernet/cavium/liquidio/lio_main.c   | 24 +++----
>  .../ethernet/cavium/liquidio/lio_vf_main.c    | 10 +--
>  .../ethernet/cavium/liquidio/octeon_droq.c    |  4 +-
>  .../ethernet/cavium/liquidio/octeon_main.h    |  4 +-
>  .../net/ethernet/cavium/octeon/octeon_mgmt.c  | 13 ++--
>  drivers/net/ethernet/cavium/thunder/nic.h     |  5 +-
>  .../net/ethernet/cavium/thunder/nicvf_main.c  | 24 +++----
>  .../ethernet/cavium/thunder/nicvf_queues.c    |  4 +-
>  .../ethernet/cavium/thunder/nicvf_queues.h    |  2 +-
>  drivers/net/ethernet/chelsio/cxgb/sge.c       | 19 ++---
>  drivers/net/ethernet/chelsio/cxgb4/cxgb4.h    |  9 +--
>  .../net/ethernet/chelsio/cxgb4/cxgb4_main.c   |  2 +-
>  .../ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c  |  4 +-
>  .../net/ethernet/chelsio/cxgb4/cxgb4_uld.c    |  2 +-
>  drivers/net/ethernet/chelsio/cxgb4/sge.c      | 40 +++++------
>  drivers/net/ethernet/chelsio/cxgb4vf/sge.c    |  6 +-
>  drivers/net/ethernet/dlink/sundance.c         | 41 +++++------
>  .../net/ethernet/huawei/hinic/hinic_hw_cmdq.c |  2 +-
>  .../net/ethernet/huawei/hinic/hinic_hw_eqs.c  | 17 +++--
>  .../net/ethernet/huawei/hinic/hinic_hw_eqs.h  |  2 +-
>  drivers/net/ethernet/ibm/ehea/ehea.h          |  3 +-
>  drivers/net/ethernet/ibm/ehea/ehea_main.c     | 14 ++--
>  drivers/net/ethernet/ibm/ibmvnic.c            | 24 +++----
>  drivers/net/ethernet/ibm/ibmvnic.h            |  2 +-
>  drivers/net/ethernet/jme.c                    | 72 +++++++++----------
>  drivers/net/ethernet/jme.h                    |  8 +--
>  .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  4 +-
>  drivers/net/ethernet/marvell/skge.c           | 12 ++--
>  drivers/net/ethernet/marvell/skge.h           |  3 +-
>  drivers/net/ethernet/mediatek/mtk_wed_wo.c    | 12 ++--
>  drivers/net/ethernet/mediatek/mtk_wed_wo.h    |  3 +-
>  43 files changed, 273 insertions(+), 266 deletions(-)
> 

This should also go to netdev@vger.kernel.org


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

* Re: [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue
  2024-06-21 15:25 ` [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Stephen Hemminger
@ 2024-06-21 17:49   ` Allen
  0 siblings, 0 replies; 7+ messages in thread
From: Allen @ 2024-06-21 17:49 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: kuba, Matthias Brugger, AngeloGioacchino Del Regno, jes, davem,
	edumazet, pabeni, kda, cai.huoqing, dougmill, npiggin,
	christophe.leroy, aneesh.kumar, naveen.n.rao, nnac123, tlfalcon,
	cooldavid, marcin.s.wojtas, mlindner, nbd, sean.wang, Mark-MC.Lee,
	lorenzo, borisp, bryan.whitehead, UNGLinuxDriver, louis.peens,
	richardcochran, linux-rdma, linux-kernel, linux-acenic,
	linux-net-drivers, linux-arm-kernel, linux-mediatek

>
> > The only generic interface to execute asynchronously in the BH context is
> > tasklet; however, it's marked deprecated and has some design flaws. To
> > replace tasklets, BH workqueue support was recently added. A BH workqueue
> > behaves similarly to regular workqueues except that the queued work items
> > are executed in the BH context.
> >
> > This patch converts a few drivers in drivers/ethernet/* from tasklet
> > to BH workqueue. The next set will be sent out after the next -rc is
> > out.
> >
> > This series is based on
> > commit a6ec08beec9e ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
> >
> > First version converting all the drivers can be found at:
> > https://lore.kernel.org/all/20240507190111.16710
> > -2-apais@linux.microsoft.com/
> >
> >
> > Allen Pais (15):
> >   net: alteon: Convert tasklet API to new bottom half workqueue
> >     mechanism
> >   net: xgbe: Convert tasklet API to new bottom half workqueue mechanism
> >   net: cnic: Convert tasklet API to new bottom half workqueue mechanism
> >   net: macb: Convert tasklet API to new bottom half workqueue mechanism
> >   net: cavium/liquidio: Convert tasklet API to new bottom half workqueue
> >     mechanism
> >   net: octeon: Convert tasklet API to new bottom half workqueue
> >     mechanism
> >   net: thunderx: Convert tasklet API to new bottom half workqueue
> >     mechanism
> >   net: chelsio: Convert tasklet API to new bottom half workqueue
> >     mechanism
> >   net: sundance: Convert tasklet API to new bottom half workqueue
> >     mechanism
> >   net: hinic: Convert tasklet API to new bottom half workqueue mechanism
> >   net: ehea: Convert tasklet API to new bottom half workqueue mechanism
> >   net: ibmvnic: Convert tasklet API to new bottom half workqueue
> >     mechanism
> >   net: jme: Convert tasklet API to new bottom half workqueue mechanism
> >   net: marvell: Convert tasklet API to new bottom half workqueue
> >     mechanism
> >   net: mtk-wed: Convert tasklet API to new bottom half workqueue
> >     mechanism
> >
> >  drivers/net/ethernet/alteon/acenic.c          | 26 +++----
> >  drivers/net/ethernet/alteon/acenic.h          |  8 +--
> >  drivers/net/ethernet/amd/xgbe/xgbe-drv.c      | 30 ++++----
> >  drivers/net/ethernet/amd/xgbe/xgbe-i2c.c      | 16 ++---
> >  drivers/net/ethernet/amd/xgbe/xgbe-mdio.c     | 16 ++---
> >  drivers/net/ethernet/amd/xgbe/xgbe-pci.c      |  4 +-
> >  drivers/net/ethernet/amd/xgbe/xgbe.h          | 10 +--
> >  drivers/net/ethernet/broadcom/cnic.c          | 19 ++---
> >  drivers/net/ethernet/broadcom/cnic.h          |  2 +-
> >  drivers/net/ethernet/cadence/macb.h           |  3 +-
> >  drivers/net/ethernet/cadence/macb_main.c      | 10 +--
> >  .../net/ethernet/cavium/liquidio/lio_core.c   |  4 +-
> >  .../net/ethernet/cavium/liquidio/lio_main.c   | 24 +++----
> >  .../ethernet/cavium/liquidio/lio_vf_main.c    | 10 +--
> >  .../ethernet/cavium/liquidio/octeon_droq.c    |  4 +-
> >  .../ethernet/cavium/liquidio/octeon_main.h    |  4 +-
> >  .../net/ethernet/cavium/octeon/octeon_mgmt.c  | 13 ++--
> >  drivers/net/ethernet/cavium/thunder/nic.h     |  5 +-
> >  .../net/ethernet/cavium/thunder/nicvf_main.c  | 24 +++----
> >  .../ethernet/cavium/thunder/nicvf_queues.c    |  4 +-
> >  .../ethernet/cavium/thunder/nicvf_queues.h    |  2 +-
> >  drivers/net/ethernet/chelsio/cxgb/sge.c       | 19 ++---
> >  drivers/net/ethernet/chelsio/cxgb4/cxgb4.h    |  9 +--
> >  .../net/ethernet/chelsio/cxgb4/cxgb4_main.c   |  2 +-
> >  .../ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c  |  4 +-
> >  .../net/ethernet/chelsio/cxgb4/cxgb4_uld.c    |  2 +-
> >  drivers/net/ethernet/chelsio/cxgb4/sge.c      | 40 +++++------
> >  drivers/net/ethernet/chelsio/cxgb4vf/sge.c    |  6 +-
> >  drivers/net/ethernet/dlink/sundance.c         | 41 +++++------
> >  .../net/ethernet/huawei/hinic/hinic_hw_cmdq.c |  2 +-
> >  .../net/ethernet/huawei/hinic/hinic_hw_eqs.c  | 17 +++--
> >  .../net/ethernet/huawei/hinic/hinic_hw_eqs.h  |  2 +-
> >  drivers/net/ethernet/ibm/ehea/ehea.h          |  3 +-
> >  drivers/net/ethernet/ibm/ehea/ehea_main.c     | 14 ++--
> >  drivers/net/ethernet/ibm/ibmvnic.c            | 24 +++----
> >  drivers/net/ethernet/ibm/ibmvnic.h            |  2 +-
> >  drivers/net/ethernet/jme.c                    | 72 +++++++++----------
> >  drivers/net/ethernet/jme.h                    |  8 +--
> >  .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  4 +-
> >  drivers/net/ethernet/marvell/skge.c           | 12 ++--
> >  drivers/net/ethernet/marvell/skge.h           |  3 +-
> >  drivers/net/ethernet/mediatek/mtk_wed_wo.c    | 12 ++--
> >  drivers/net/ethernet/mediatek/mtk_wed_wo.h    |  3 +-
> >  43 files changed, 273 insertions(+), 266 deletions(-)
> >
>
> This should also go to netdev@vger.kernel.org

My Bad, I thought I had it marked. Thanks for pointing it out.

       - Allen


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

* Re: [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue
  2024-06-21  5:05 [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Allen Pais
                   ` (2 preceding siblings ...)
  2024-06-21 15:25 ` [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Stephen Hemminger
@ 2024-06-25 10:24 ` Paolo Abeni
  3 siblings, 0 replies; 7+ messages in thread
From: Paolo Abeni @ 2024-06-25 10:24 UTC (permalink / raw)
  To: Allen Pais, kuba, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: jes, davem, edumazet, kda, cai.huoqing, dougmill, npiggin,
	christophe.leroy, aneesh.kumar, naveen.n.rao, nnac123, tlfalcon,
	cooldavid, marcin.s.wojtas, mlindner, stephen, nbd, sean.wang,
	Mark-MC.Lee, lorenzo, borisp, bryan.whitehead, UNGLinuxDriver,
	louis.peens, richardcochran, linux-rdma, linux-kernel,
	linux-acenic, linux-net-drivers, linux-arm-kernel, linux-mediatek

On Thu, 2024-06-20 at 22:05 -0700, Allen Pais wrote:
> The only generic interface to execute asynchronously in the BH context is
> tasklet; however, it's marked deprecated and has some design flaws. To
> replace tasklets, BH workqueue support was recently added. A BH workqueue
> behaves similarly to regular workqueues except that the queued work items
> are executed in the BH context.
> 
> This patch converts a few drivers in drivers/ethernet/* from tasklet
> to BH workqueue. The next set will be sent out after the next -rc is
> out.
> 
> This series is based on 
> commit a6ec08beec9e ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
> 
> First version converting all the drivers can be found at:
> https://lore.kernel.org/all/20240507190111.16710
> -2-apais@linux.microsoft.com/

The above link was mangled.

I guess you will have to re-submit to cope at least with Andrew's
feedback, but it think it's better to wait a little longer for the next
version, to give the vendors more time to actually test this.

When you will re-submit you can retain the already collected ack.

Please include the target tree ('net-next') in the subj title and a
revision counter ('v3'). The whole subj should be:

[PATCH net-next v3 00/15] ethernet: Convert from tasklet to BH workqueue

Thanks,

Paolo






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

end of thread, other threads:[~2024-06-25 10:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-21  5:05 [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Allen Pais
2024-06-21  5:05 ` [PATCH 07/15] net: thunderx: Convert tasklet API to new bottom half workqueue mechanism Allen Pais
2024-06-21 11:49   ` Sunil Kovvuri Goutham
2024-06-21  5:05 ` [PATCH 15/15] net: mtk-wed: " Allen Pais
2024-06-21 15:25 ` [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Stephen Hemminger
2024-06-21 17:49   ` Allen
2024-06-25 10:24 ` Paolo Abeni

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