From: Allen Pais <allen.lkml@gmail.com>
To: netdev@vger.kernel.org
Cc: Allen Pais <allen.lkml@gmail.com>
Subject: [PATCH 11/15] net: ehea: Convert tasklet API to new bottom half workqueue mechanism
Date: Fri, 21 Jun 2024 11:39:43 -0700 [thread overview]
Message-ID: <20240621183947.4105278-12-allen.lkml@gmail.com> (raw)
In-Reply-To: <20240621183947.4105278-1-allen.lkml@gmail.com>
Migrate tasklet APIs to the new bottom half workqueue mechanism. It
replaces all occurrences of tasklet usage with the appropriate workqueue
APIs throughout the ehea driver. This transition ensures compatibility
with the latest design and enhances performance.
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
drivers/net/ethernet/ibm/ehea/ehea.h | 3 ++-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 14 +++++++-------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea.h b/drivers/net/ethernet/ibm/ehea/ehea.h
index 208c440a602b..c1e7e22884fa 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea.h
@@ -19,6 +19,7 @@
#include <linux/ethtool.h>
#include <linux/vmalloc.h>
#include <linux/if_vlan.h>
+#include <linux/workqueue.h>
#include <linux/platform_device.h>
#include <asm/ibmebus.h>
@@ -381,7 +382,7 @@ struct ehea_adapter {
struct platform_device *ofdev;
struct ehea_port *port[EHEA_MAX_PORTS];
struct ehea_eq *neq; /* notification event queue */
- struct tasklet_struct neq_tasklet;
+ struct work_struct neq_bh_work;
struct ehea_mr mr;
u32 pd; /* protection domain */
u64 max_mc_mac; /* max number of multicast mac addresses */
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 1e29e5c9a2df..6960d06805f6 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -976,7 +976,7 @@ int ehea_sense_port_attr(struct ehea_port *port)
u64 hret;
struct hcp_ehea_port_cb0 *cb0;
- /* may be called via ehea_neq_tasklet() */
+ /* may be called via ehea_neq_bh_work() */
cb0 = (void *)get_zeroed_page(GFP_ATOMIC);
if (!cb0) {
pr_err("no mem for cb0\n");
@@ -1216,9 +1216,9 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe)
}
}
-static void ehea_neq_tasklet(struct tasklet_struct *t)
+static void ehea_neq_bh_work(struct work_struct *work)
{
- struct ehea_adapter *adapter = from_tasklet(adapter, t, neq_tasklet);
+ struct ehea_adapter *adapter = from_work(adapter, work, neq_bh_work);
struct ehea_eqe *eqe;
u64 event_mask;
@@ -1243,7 +1243,7 @@ static void ehea_neq_tasklet(struct tasklet_struct *t)
static irqreturn_t ehea_interrupt_neq(int irq, void *param)
{
struct ehea_adapter *adapter = param;
- tasklet_hi_schedule(&adapter->neq_tasklet);
+ queue_work(system_bh_highpri_wq, &adapter->neq_bh_work);
return IRQ_HANDLED;
}
@@ -3423,7 +3423,7 @@ static int ehea_probe_adapter(struct platform_device *dev)
goto out_free_ad;
}
- tasklet_setup(&adapter->neq_tasklet, ehea_neq_tasklet);
+ INIT_WORK(&adapter->neq_bh_work, ehea_neq_bh_work);
ret = ehea_create_device_sysfs(dev);
if (ret)
@@ -3444,7 +3444,7 @@ static int ehea_probe_adapter(struct platform_device *dev)
}
/* Handle any events that might be pending. */
- tasklet_hi_schedule(&adapter->neq_tasklet);
+ queue_work(system_bh_highpri_wq, &adapter->neq_bh_work);
ret = 0;
goto out;
@@ -3485,7 +3485,7 @@ static void ehea_remove(struct platform_device *dev)
ehea_remove_device_sysfs(dev);
ibmebus_free_irq(adapter->neq->attr.ist1, adapter);
- tasklet_kill(&adapter->neq_tasklet);
+ cancel_work_sync(&adapter->neq_bh_work);
ehea_destroy_eq(adapter->neq);
ehea_remove_adapter_mr(adapter);
--
2.34.1
next prev parent reply other threads:[~2024-06-21 18:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 18:39 [PATCH 00/15] ethernet: Convert from tasklet to BH workqueue Allen Pais
2024-06-21 18:39 ` [PATCH 01/15] net: alteon: Convert tasklet API to new bottom half workqueue mechanism Allen Pais
2024-06-21 18:39 ` [PATCH 02/15] net: xgbe: " Allen Pais
2024-06-21 18:39 ` [PATCH 03/15] net: cnic: " Allen Pais
2024-06-21 18:39 ` [PATCH 04/15] net: macb: " Allen Pais
2024-06-21 18:39 ` [PATCH 05/15] net: cavium/liquidio: " Allen Pais
2024-06-21 18:39 ` [PATCH 06/15] net: octeon: " Allen Pais
2024-06-21 18:39 ` [PATCH 07/15] net: thunderx: " Allen Pais
2024-06-21 18:39 ` [PATCH 08/15] net: chelsio: " Allen Pais
2024-06-21 18:39 ` [PATCH 09/15] net: sundance: " Allen Pais
2024-06-21 18:39 ` [PATCH 10/15] net: hinic: " Allen Pais
2024-06-21 18:39 ` Allen Pais [this message]
2024-06-21 18:39 ` [PATCH 12/15] net: ibmvnic: " Allen Pais
2024-06-21 18:39 ` [PATCH 13/15] net: jme: " Allen Pais
2024-06-21 18:39 ` [PATCH 14/15] net: marvell: " Allen Pais
2024-06-21 20:19 ` Andrew Lunn
2024-06-21 18:39 ` [PATCH 15/15] net: mtk-wed: " Allen Pais
[not found] <20240621050525.3720069-1-allen.lkml@gmail.com>
2024-06-21 5:05 ` [PATCH 11/15] net: ehea: " 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=20240621183947.4105278-12-allen.lkml@gmail.com \
--to=allen.lkml@gmail.com \
--cc=netdev@vger.kernel.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).