From: Allen Pais <allen.lkml@gmail.com>
To: netdev@vger.kernel.org
Cc: Allen Pais <allen.lkml@gmail.com>
Subject: [PATCH 06/15] net: octeon: Convert tasklet API to new bottom half workqueue mechanism
Date: Fri, 21 Jun 2024 11:39:38 -0700 [thread overview]
Message-ID: <20240621183947.4105278-7-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 cavium/octeon 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/octeon/octeon_mgmt.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
index 744f2434f7fa..0db993c1cc36 100644
--- a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
@@ -13,6 +13,7 @@
#include <linux/net_tstamp.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
+#include <linux/workqueue.h>
#include <linux/spinlock.h>
#include <linux/if_vlan.h>
#include <linux/of_mdio.h>
@@ -144,7 +145,7 @@ struct octeon_mgmt {
unsigned int last_speed;
struct device *dev;
struct napi_struct napi;
- struct tasklet_struct tx_clean_tasklet;
+ struct work_struct tx_clean_bh_work;
struct device_node *phy_np;
resource_size_t mix_phys;
resource_size_t mix_size;
@@ -315,9 +316,9 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)
netif_wake_queue(p->netdev);
}
-static void octeon_mgmt_clean_tx_tasklet(struct tasklet_struct *t)
+static void octeon_mgmt_clean_tx_bh_work(struct work_struct *work)
{
- struct octeon_mgmt *p = from_tasklet(p, t, tx_clean_tasklet);
+ struct octeon_mgmt *p = from_work(p, work, tx_clean_bh_work);
octeon_mgmt_clean_tx_buffers(p);
octeon_mgmt_enable_tx_irq(p);
}
@@ -684,7 +685,7 @@ static irqreturn_t octeon_mgmt_interrupt(int cpl, void *dev_id)
}
if (mixx_isr.s.orthresh) {
octeon_mgmt_disable_tx_irq(p);
- tasklet_schedule(&p->tx_clean_tasklet);
+ queue_work(system_bh_wq, &p->tx_clean_bh_work);
}
return IRQ_HANDLED;
@@ -1487,8 +1488,8 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
skb_queue_head_init(&p->tx_list);
skb_queue_head_init(&p->rx_list);
- tasklet_setup(&p->tx_clean_tasklet,
- octeon_mgmt_clean_tx_tasklet);
+ INIT_WORK(&p->tx_clean_bh_work,
+ octeon_mgmt_clean_tx_bh_work);
netdev->priv_flags |= IFF_UNICAST_FLT;
--
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 ` Allen Pais [this message]
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 ` [PATCH 11/15] net: ehea: " Allen Pais
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 06/15] net: octeon: " 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-7-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).