ethernet: convert tasklets to use new
Subsystems (21)
v2 cover ethernet: convert tasklets to use new
Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")' introduced a new tasklet initialization API. This series converts all the crypto modules to use the new tasklet_setup() API
This series is based on v5.9-rc4
v2:
fix kdoc reported by Jakub Kicinski.
Allen Pais (20):
ethernet: alteon: convert tasklets to use new tasklet_setup() API
ethernet: amd: convert tasklets to use new tasklet_setup() API
broadcom: cnic: convert tasklets to use new tasklet_setup() API
ethernet: cadence: convert tasklets to use new tasklet_setup() API
ethernet: cavium: convert tasklets to use new tasklet_setup() API
ethernet: chelsio: convert tasklets to use new tasklet_setup() API
ethernet: dlink: convert tasklets to use new tasklet_setup() API
ethernet: hinic: convert tasklets to use new tasklet_setup() API
ethernet: ehea: convert tasklets to use new tasklet_setup() API
ethernet: ibmvnic: convert tasklets to use new tasklet_setup() API
ethernet: jme: convert tasklets to use new tasklet_setup() API
ethernet: marvell: convert tasklets to use new tasklet_setup() API
ethernet: mellanox: convert tasklets to use new tasklet_setup() API
ethernet: micrel: convert tasklets to use new tasklet_setup() API
ethernet: natsemi: convert tasklets to use new tasklet_setup() API
ethernet: netronome: convert tasklets to use new tasklet_setup() API
ethernet: ni: convert tasklets to use new tasklet_setup() API
ethernet: qlogic: convert tasklets to use new tasklet_setup() API
ethernet: silan: convert tasklets to use new tasklet_setup() API
ethernet: smsc: convert tasklets to use new tasklet_setup() API
drivers/net/ethernet/alteon/acenic.c | 9 +++-- drivers/net/ethernet/alteon/acenic.h | 2 +- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 19 +++++---- drivers/net/ethernet/amd/xgbe/xgbe-i2c.c | 11 +++-- drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 11 +++-- drivers/net/ethernet/broadcom/cnic.c | 18 ++++----- drivers/net/ethernet/cadence/macb_main.c | 7 ++-- .../net/ethernet/cavium/liquidio/lio_main.c | 12 +++--- .../ethernet/cavium/liquidio/octeon_main.h | 1 + .../net/ethernet/cavium/octeon/octeon_mgmt.c | 8 ++-- .../net/ethernet/cavium/thunder/nicvf_main.c | 10 ++--- .../ethernet/cavium/thunder/nicvf_queues.c | 4 +- .../ethernet/cavium/thunder/nicvf_queues.h | 2 +- drivers/net/ethernet/chelsio/cxgb/sge.c | 12 ++++-- drivers/net/ethernet/chelsio/cxgb3/sge.c | 18 ++++----- drivers/net/ethernet/chelsio/cxgb4/sge.c | 16 ++++---- drivers/net/ethernet/dlink/sundance.c | 20 +++++----- .../net/ethernet/huawei/hinic/hinic_hw_eqs.c | 9 ++--- drivers/net/ethernet/ibm/ehea/ehea_main.c | 7 ++-- drivers/net/ethernet/ibm/ibmvnic.c | 7 ++-- drivers/net/ethernet/jme.c | 40 ++++++++----------- drivers/net/ethernet/marvell/skge.c | 6 +-- drivers/net/ethernet/mellanox/mlx4/cq.c | 4 +- drivers/net/ethernet/mellanox/mlx4/eq.c | 3 +- drivers/net/ethernet/mellanox/mlx4/mlx4.h | 2 +- drivers/net/ethernet/mellanox/mlx5/core/cq.c | 4 +- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 3 +- .../ethernet/mellanox/mlx5/core/fpga/conn.c | 7 ++-- .../net/ethernet/mellanox/mlx5/core/lib/eq.h | 2 +- drivers/net/ethernet/mellanox/mlxsw/pci.c | 12 +++--- drivers/net/ethernet/micrel/ks8842.c | 19 ++++----- drivers/net/ethernet/micrel/ksz884x.c | 14 +++---- drivers/net/ethernet/natsemi/ns83820.c | 8 ++-- .../ethernet/netronome/nfp/nfp_net_common.c | 7 ++-- drivers/net/ethernet/ni/nixge.c | 7 ++-- drivers/net/ethernet/qlogic/qed/qed.h | 2 +- drivers/net/ethernet/qlogic/qed/qed_int.c | 27 ++----------- drivers/net/ethernet/qlogic/qed/qed_int.h | 2 +- drivers/net/ethernet/qlogic/qed/qed_main.c | 14 +++---- drivers/net/ethernet/silan/sc92031.c | 11 ++--- drivers/net/ethernet/smsc/smc91x.c | 10 ++--- 41 files changed, 183 insertions(+), 224 deletions(-)
Signature · 1 line
2.25.1
PATCH v2 1/20 ethernet: alteon: convert tasklets to use new tasklet_setup() API
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.
--- drivers/net/ethernet/alteon/acenic.c | 9 +++++---- drivers/net/ethernet/alteon/acenic.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/net/ethernet/alteon/acenic.c +5 -4
@@ -1562,10 +1562,11 @@ static void ace_watchdog(struct net_device *data, unsigned int txqueue) } -static void ace_tasklet (unsigned long arg) +static void ace_tasklet (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *) arg; -struct ace_private *ap =netdev_priv (dev); +struct ace_private *ap =from_tasklet (ap, t, ace_tasklet); +struct net_device *dev = (struct net_device *)((char *)ap - +ALIGN (sizeof (struct net_device ),NETDEV_ALIGN ));int cur_size; cur_size =atomic_read (&ap->cur_rx_bufs);
@@ -2269,7 +2270,7 @@ static int ace_open(struct net_device *dev)/* * Setup the bottom half rx ring refill handler */ -tasklet_init (&ap->ace_tasklet, ace_tasklet, (unsigned long )dev); +tasklet_setup (&ap->ace_tasklet, ace_tasklet);return 0 ; }
drivers/net/ethernet/alteon/acenic.h +1 -1
@@ -776,7 +776,7 @@ static int ace_open(struct net_device *dev);static netdev_tx_t ace_start_xmit (struct sk_buff *skb,struct net_device *dev);static int ace_close (struct net_device *dev); -static void ace_tasklet (unsigned long dev); +static void ace_tasklet (struct tasklet_struct *t);static void ace_dump_trace (struct ace_private *ap);static void ace_set_multicast_list (struct net_device *dev);static int ace_change_mtu (struct net_device *dev,int new_mtu);
Signature · 1 line
2.25.1
David Miller
maintainerRe: [PATCH v2 01/20] ethernet: alteon: convert tasklets to use new tasklet_setup() API
From: Allen Pais <[email protected]>
Date: Wed, 9 Sep 2020 14:14:51 +0530
Quoted 4 lines
drivers/net/ethernet/alteon/acenic.c +0
-0@@ -1562,10 +1562,11 @@ static void ace_watchdog(struct net_device *data, unsigned int txqueue) }
drivers/net/ethernet/alteon/acenic.c static void ace_watchdog(struct net_device *data, unsigned int txqueue) · line 1571
Quoted 10 lines
drivers/net/ethernet/alteon/acenic.c +4
-3-static void ace_tasklet (unsigned long arg) +static void ace_tasklet (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *) arg; -struct ace_private *ap =netdev_priv (dev); +struct ace_private *ap =from_tasklet (ap, t, ace_tasklet); +struct net_device *dev = (struct net_device *)((char *)ap - +ALIGN (sizeof (struct net_device ),NETDEV_ALIGN ));int cur_size;
I don't see this is as an improvement. The 'dev' assignment looks so incredibly fragile and exposes so many internal details about netdev object allocation, alignment, and layout.
Who is going to find and fix this if someone changes how netdev object allocation works?
I don't want to apply this, it sets a very bad precedent. The existing code is so much cleaner and easier to understand and audit.
Re: [PATCH v2 01/20] ethernet: alteon: convert tasklets to use new tasklet_setup() API
Quoted 20 lines
Quoted 5 lines
drivers/net/ethernet/alteon/acenic.c +0
-0@@ -1562,10 +1562,11 @@ static void ace_watchdog(struct net_device *data, unsigned int txqueue) }drivers/net/ethernet/alteon/acenic.c static void ace_watchdog(struct net_device *data, unsigned int txqueue) · line 1571
Quoted 10 lines
drivers/net/ethernet/alteon/acenic.c +4
-3-static void ace_tasklet (unsigned long arg) +static void ace_tasklet (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *) arg; -struct ace_private *ap =netdev_priv (dev); +struct ace_private *ap =from_tasklet (ap, t, ace_tasklet); +struct net_device *dev = (struct net_device *)((char *)ap - +ALIGN (sizeof (struct net_device ),NETDEV_ALIGN ));int cur_size;I don't see this is as an improvement. The 'dev' assignment looks so incredibly fragile and exposes so many internal details about netdev object allocation, alignment, and layout.
Quoted 3 lines
Who is going to find and fix this if someone changes how netdev object allocation works?
Thanks for pointing it out. I'll see if I can fix it to keep it simple.
Quoted 3 lines
I don't want to apply this, it sets a very bad precedent. The existing code is so much cleaner and easier to understand and audit.
Will you pick the rest of the patches or would they have to wait till this one is
fixed.
Thanks,
Signature · 1 line
- Allen
David Miller
maintainerRe: [PATCH v2 01/20] ethernet: alteon: convert tasklets to use new tasklet_setup() API
From: Allen <[email protected]>
Date: Thu, 10 Sep 2020 00:06:47 +0530
Quoted 20 lines
Quoted 20 lines
Quoted 5 lines
drivers/net/ethernet/alteon/acenic.c +0
-0@@ -1562,10 +1562,11 @@ static void ace_watchdog(struct net_device *data, unsigned int txqueue) }drivers/net/ethernet/alteon/acenic.c static void ace_watchdog(struct net_device *data, unsigned int txqueue) · line 1571
Quoted 10 lines
drivers/net/ethernet/alteon/acenic.c +4
-3-static void ace_tasklet (unsigned long arg) +static void ace_tasklet (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *) arg; -struct ace_private *ap =netdev_priv (dev); +struct ace_private *ap =from_tasklet (ap, t, ace_tasklet); +struct net_device *dev = (struct net_device *)((char *)ap - +ALIGN (sizeof (struct net_device ),NETDEV_ALIGN ));int cur_size;I don't see this is as an improvement. The 'dev' assignment looks so incredibly fragile and exposes so many internal details about netdev object allocation, alignment, and layout.
Quoted 5 lines
Quoted 3 lines
Who is going to find and fix this if someone changes how netdev object allocation works?
Thanks for pointing it out. I'll see if I can fix it to keep it simple.
Just add a backpointer to the netdev from the netdev_priv() if you absolutely have too.
Quoted 6 lines
Quoted 2 lines
I don't want to apply this, it sets a very bad precedent. The existing code is so much cleaner and easier to understand and audit.
Will you pick the rest of the patches or would they have to wait till this one is
fixed.
I never pick up a partial series, ever. So yes you will have to fix these two patches up and resubmit the entire thing.
Re: [PATCH v2 01/20] ethernet: alteon: convert tasklets to use new tasklet_setup() API
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 6 lines
drivers/net/ethernet/alteon/acenic.c +0
-0@@ -1562,10 +1562,11 @@ static void ace_watchdog(struct net_device *data, unsigned int txqueue) }drivers/net/ethernet/alteon/acenic.c static void ace_watchdog(struct net_device *data, unsigned int txqueue) · line 1571
Quoted 10 lines
drivers/net/ethernet/alteon/acenic.c +4
-3-static void ace_tasklet (unsigned long arg) +static void ace_tasklet (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *) arg; -struct ace_private *ap =netdev_priv (dev); +struct ace_private *ap =from_tasklet (ap, t, ace_tasklet); +struct net_device *dev = (struct net_device *)((char *)ap - +ALIGN (sizeof (struct net_device ),NETDEV_ALIGN ));int cur_size;I don't see this is as an improvement. The 'dev' assignment looks so incredibly fragile and exposes so many internal details about netdev object allocation, alignment, and layout.
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
Who is going to find and fix this if someone changes how netdev object allocation works?
Thanks for pointing it out. I'll see if I can fix it to keep it simple.
Just add a backpointer to the netdev from the
netdev_priv()if you absolutely have too.
Okay.
Quoted 10 lines
Quoted 6 lines
Quoted 2 lines
I don't want to apply this, it sets a very bad precedent. The existing code is so much cleaner and easier to understand and audit.
Will you pick the rest of the patches or would they have to wait till this one is
fixed.I never pick up a partial series, ever. So yes you will have to fix these two patches up and resubmit the entire thing.
Sure, let me get these fixed up and ready. Thanks.
Signature · 1 line
- Allen
Re: [PATCH v2 01/20] ethernet: alteon: convert tasklets to use new tasklet_setup() API
In reply to David MillerQuoted 17 lines
Quoted 17 lines
Quoted 17 lines
Review
Quoted 12 lines
(quoted diff) +4
-3-static void ace_tasklet(unsigned long arg) +static void ace_tasklet(struct tasklet_struct *t) { - struct net_device *dev = (struct net_device *) arg; - struct ace_private *ap = netdev_priv(dev); + struct ace_private *ap = from_tasklet(ap, t, ace_tasklet); + struct net_device *dev = (struct net_device *)((char *)ap - + ALIGN(sizeof(struct net_device), NETDEV_ALIGN)); int cur_size;I don't see this is as an improvement. The 'dev' assignment looks so incredibly fragile and exposes so many internal details about netdev object allocation, alignment, and layout.
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
Who is going to find and fix this if someone changes how netdev object allocation works?
Thanks for pointing it out. I'll see if I can fix it to keep it simple.
Just add a backpointer to the netdev from the
netdev_priv()if you absolutely have too.
How does this look?
(quoted diff) +0 -0
b/drivers/net/ethernet/alteon/acenic.c
index 8470c836fa18..1a7e4df9b3e9 100644
drivers/net/ethernet/alteon/acenic.c +1 -0
@@ -465,6 +465,7 @@ static int acenic_probe_one(struct pci_dev *pdev,SET_NETDEV_DEV (dev, &pdev->dev); ap =netdev_priv (dev); + ap->ndev = dev; ap->pdev = pdev; ap->name =pci_name (pdev);
@@ -1562,10 +1563,10 @@ static void ace_watchdog(struct net_device
*data, unsigned int txqueue)
}
-static void ace_tasklet(unsigned long arg) +static void ace_tasklet(struct tasklet_struct *t)
{
- struct net_device *dev = (struct net_device *) arg;
- struct ace_private *ap = netdev_priv(dev);
+ struct ace_private *ap = from_tasklet(ap, t, ace_tasklet);
+ struct net_device *dev = ap->ndev;
int cur_size;
cur_size = atomic_read(&ap->cur_rx_bufs);
@@ -2269,7 +2270,7 @@ static int ace_open(struct net_device *dev)
/*
* Setup the bottom half rx ring refill handler
*/
- tasklet_init(&ap->ace_tasklet, ace_tasklet, (unsigned long)dev);
+ tasklet_setup(&ap->ace_tasklet, ace_tasklet);
return 0;}
(quoted diff) +0 -0
b/drivers/net/ethernet/alteon/acenic.h
index c670067b1541..265fa601a258 100644
drivers/net/ethernet/alteon/acenic.h +2 -1
@@ -633,6 +633,7 @@ struct ace_skb*/ struct ace_private { +struct net_device *ndev;/* backpointer */ struct ace_info *info;struct ace_regs __iomem *regs;/* register base */ struct ace_skb *skb;
@@ -776,7 +777,7 @@ static int ace_open(struct net_device *dev);static netdev_tx_t ace_start_xmit (struct sk_buff *skb,struct net_device *dev);static int ace_close (struct net_device *dev); -static void ace_tasklet (unsigned long dev); +static void ace_tasklet (struct tasklet_struct *t);static void ace_dump_trace (struct ace_private *ap);static void ace_set_multicast_list (struct net_device *dev);static int ace_change_mtu (struct net_device *dev,int new_mtu);
Let me know what you think.
Thanks.
David Miller
maintainerRe: [PATCH v2 01/20] ethernet: alteon: convert tasklets to use new tasklet_setup() API
From: Allen <[email protected]>
Date: Fri, 11 Sep 2020 15:30:41 +0530
Quoted 5 lines
Quoted 3 lines
Just add a backpointer to the netdev from the
netdev_priv()if you absolutely have too.How does this look?
Looks good.
PATCH v2 2/20 ethernet: amd: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 19 +++++++++---------- drivers/net/ethernet/amd/xgbe/xgbe-i2c.c | 11 +++++------ drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 11 +++++------ 3 files changed, 19 insertions(+), 22 deletions(-)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +9 -10
@@ -403,9 +403,9 @@ static bool xgbe_ecc_ded(struct xgbe_prv_data *pdata, unsigned long *period,return false; } -static void xgbe_ecc_isr_task (unsigned long data) +static void xgbe_ecc_isr_task (struct tasklet_struct *t) { -struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; +struct xgbe_prv_data *pdata =from_tasklet (pdata, t, tasklet_ecc);unsigned int ecc_isr;bool stop = false;
@@ -468,14 +468,14 @@ static irqreturn_t xgbe_ecc_isr(int irq, void *data)if (pdata->isr_as_tasklet)tasklet_schedule (&pdata->tasklet_ecc);else -xgbe_ecc_isr_task ((unsigned long )pdata); +xgbe_ecc_isr_task (&pdata->tasklet_ecc);return IRQ_HANDLED ; } -static void xgbe_isr_task (unsigned long data) +static void xgbe_isr_task (struct tasklet_struct *t) { -struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; +struct xgbe_prv_data *pdata =from_tasklet (pdata, t, tasklet_dev);struct xgbe_hw_if *hw_if = &pdata->hw_if;struct xgbe_channel *channel;unsigned int dma_isr, dma_ch_isr;
@@ -582,7 +582,7 @@ static void xgbe_isr_task(unsigned long data)/* If there is not a separate ECC irq, handle it here */ if (pdata->vdata->ecc_support && (pdata->dev_irq == pdata->ecc_irq)) -xgbe_ecc_isr_task ((unsigned long )pdata); +xgbe_ecc_isr_task (&pdata->tasklet_ecc);/* If there is not a separate I2C irq, handle it here */ if (pdata->vdata->i2c_support && (pdata->dev_irq == pdata->i2c_irq))
@@ -607,7 +607,7 @@ static irqreturn_t xgbe_isr(int irq, void *data)if (pdata->isr_as_tasklet)tasklet_schedule (&pdata->tasklet_dev);else -xgbe_isr_task ((unsigned long )pdata); +xgbe_isr_task (&pdata->tasklet_dev);return IRQ_HANDLED ; }
@@ -991,9 +991,8 @@ static int xgbe_request_irqs(struct xgbe_prv_data *pdata)unsigned int i;int ret; -tasklet_init (&pdata->tasklet_dev, xgbe_isr_task, (unsigned long )pdata); -tasklet_init (&pdata->tasklet_ecc, xgbe_ecc_isr_task, - (unsigned long )pdata); +tasklet_setup (&pdata->tasklet_dev, xgbe_isr_task); +tasklet_setup (&pdata->tasklet_ecc, xgbe_ecc_isr_task); ret =devm_request_irq (pdata->dev, pdata->dev_irq, xgbe_isr,0 ,netdev_name (netdev), pdata);
drivers/net/ethernet/amd/xgbe/xgbe-i2c.c +5 -6
@@ -274,9 +274,9 @@ static void xgbe_i2c_clear_isr_interrupts(struct xgbe_prv_data *pdata,XI2C_IOREAD (pdata,IC_CLR_STOP_DET ); } -static void xgbe_i2c_isr_task (unsigned long data) +static void xgbe_i2c_isr_task (struct tasklet_struct *t) { -struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; +struct xgbe_prv_data *pdata =from_tasklet (pdata, t, tasklet_i2c);struct xgbe_i2c_op_state *state = &pdata->i2c.op_state;unsigned int isr;
@@ -324,7 +324,7 @@ static irqreturn_t xgbe_i2c_isr(int irq, void *data)if (pdata->isr_as_tasklet)tasklet_schedule (&pdata->tasklet_i2c);else -xgbe_i2c_isr_task ((unsigned long )pdata); +xgbe_i2c_isr_task (&pdata->tasklet_i2c);return IRQ_HANDLED ; }
@@ -369,7 +369,7 @@ static void xgbe_i2c_set_target(struct xgbe_prv_data *pdata, unsigned int addr)static irqreturn_t xgbe_i2c_combined_isr (struct xgbe_prv_data *pdata) { -xgbe_i2c_isr_task ((unsigned long )pdata); +xgbe_i2c_isr_task (&pdata->tasklet_i2c);return IRQ_HANDLED ; }
@@ -462,8 +462,7 @@ static int xgbe_i2c_start(struct xgbe_prv_data *pdata)/* If we have a separate I2C irq, enable it */ if (pdata->dev_irq != pdata->i2c_irq) { -tasklet_init (&pdata->tasklet_i2c, xgbe_i2c_isr_task, - (unsigned long )pdata); +tasklet_setup (&pdata->tasklet_i2c, xgbe_i2c_isr_task); ret = devm_request_irq(pdata->dev, pdata->i2c_irq, xgbe_i2c_isr, 0, pdata->i2c_name,
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +5 -6
@@ -688,9 +688,9 @@ static void xgbe_an73_isr(struct xgbe_prv_data *pdata) } } -static void xgbe_an_isr_task (unsigned long data) +static void xgbe_an_isr_task (struct tasklet_struct *t) { -struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data; +struct xgbe_prv_data *pdata =from_tasklet (pdata, t, tasklet_an);netif_dbg (pdata, intr, pdata->netdev,"AN interrupt received\n" );
@@ -715,14 +715,14 @@ static irqreturn_t xgbe_an_isr(int irq, void *data)if (pdata->isr_as_tasklet)tasklet_schedule (&pdata->tasklet_an);else -xgbe_an_isr_task ((unsigned long )pdata); +xgbe_an_isr_task (&pdata->tasklet_an);return IRQ_HANDLED ; }static irqreturn_t xgbe_an_combined_isr (struct xgbe_prv_data *pdata) { -xgbe_an_isr_task ((unsigned long )pdata); +xgbe_an_isr_task (&pdata->tasklet_an);return IRQ_HANDLED ; }
@@ -1414,8 +1414,7 @@ static int xgbe_phy_start(struct xgbe_prv_data *pdata)/* If we have a separate AN irq, enable it */ if (pdata->dev_irq != pdata->an_irq) { -tasklet_init (&pdata->tasklet_an, xgbe_an_isr_task, - (unsigned long )pdata); +tasklet_setup (&pdata->tasklet_an, xgbe_an_isr_task); ret = devm_request_irq(pdata->dev, pdata->an_irq, xgbe_an_isr, 0, pdata->an_name,
Signature · 1 line
2.25.1
PATCH v2 3/20 broadcom: cnic: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/broadcom/cnic.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
drivers/net/ethernet/broadcom/cnic.c +8 -10
@@ -3009,10 +3009,10 @@ static int cnic_service_bnx2(void *data, void *status_blk)return cnic_service_bnx2_queues (dev); } -static void cnic_service_bnx2_msix (unsigned long data) +static void cnic_service_bnx2_msix (struct tasklet_struct *t) { -struct cnic_dev *dev = (struct cnic_dev *) data; -struct cnic_local *cp = dev->cnic_priv; +struct cnic_local *cp =from_tasklet (cp, t, cnic_irq_task); +struct cnic_dev *dev = cp->dev; cp->last_status_idx =cnic_service_bnx2_queues (dev);
@@ -3134,10 +3134,10 @@ static u32 cnic_service_bnx2x_kcq(struct cnic_dev *dev, struct kcq_info *info)return last_status; } -static void cnic_service_bnx2x_bh (unsigned long data) +static void cnic_service_bnx2x_bh (struct tasklet_struct *t) { -struct cnic_dev *dev = (struct cnic_dev *) data; -struct cnic_local *cp = dev->cnic_priv; +struct cnic_local *cp =from_tasklet (cp, t, cnic_irq_task); +struct cnic_dev *dev = cp->dev;struct bnx2x *bp =netdev_priv (dev->netdev);u32 status_idx, new_status_idx;
@@ -4458,8 +4458,7 @@ static int cnic_init_bnx2_irq(struct cnic_dev *dev)CNIC_WR (dev, base +BNX2_HC_CMD_TICKS_OFF , (64 <<16 ) |220 ); cp->last_status_idx = cp->status_blk.bnx2->status_idx; -tasklet_init (&cp->cnic_irq_task, cnic_service_bnx2_msix, - (unsigned long ) dev); +tasklet_setup (&cp->cnic_irq_task, cnic_service_bnx2_msix); err =cnic_request_irq (dev);if (err)return err;
@@ -4868,8 +4867,7 @@ static int cnic_init_bnx2x_irq(struct cnic_dev *dev)struct cnic_eth_dev *ethdev = cp->ethdev;int err =0 ; -tasklet_init (&cp->cnic_irq_task, cnic_service_bnx2x_bh, - (unsigned long ) dev); +tasklet_setup (&cp->cnic_irq_task, cnic_service_bnx2x_bh);if (ethdev->drv_state &CNIC_DRV_STATE_USING_MSIX ) err =cnic_request_irq (dev);
Signature · 1 line
2.25.1
PATCH v2 4/20 ethernet: cadence: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/cadence/macb_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +3 -4
@@ -1466,9 +1466,9 @@ static int macb_poll(struct napi_struct *napi, int budget)return work_done; } -static void macb_hresp_error_task (unsigned long data) +static void macb_hresp_error_task (struct tasklet_struct *t) { -struct macb *bp = (struct macb *)data; +struct macb *bp =from_tasklet (bp, t, hresp_err_tasklet);struct net_device *dev = bp->dev;struct macb_queue *queue;unsigned int q;
@@ -4560,8 +4560,7 @@ static int macb_probe(struct platform_device *pdev) goto err_out_unregister_mdio; } -tasklet_init (&bp->hresp_err_tasklet, macb_hresp_error_task, - (unsigned long )bp); +tasklet_setup (&bp->hresp_err_tasklet, macb_hresp_error_task); netdev_info(dev, "Cadence %s rev 0x%08x at 0x%08lx irq %d (%pM)\n", macb_is_gem(bp) ? "GEM" : "MACB", macb_readl(bp, MID),
Signature · 1 line
2.25.1
PATCH v2 5/20 ethernet: cavium: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/cavium/liquidio/lio_main.c | 12 ++++++------ drivers/net/ethernet/cavium/liquidio/octeon_main.h | 1 + drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 8 ++++---- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 10 ++++------ drivers/net/ethernet/cavium/thunder/nicvf_queues.c | 4 ++-- drivers/net/ethernet/cavium/thunder/nicvf_queues.h | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_main.c +6 -6
@@ -161,13 +161,13 @@ static int liquidio_set_vf_link_state(struct net_device *netdev, int vfidx,static struct handshake handshake[MAX_OCTEON_DEVICES ];static struct completion first_stage; -static void octeon_droq_bh (unsigned long pdev) +static void octeon_droq_bh (struct tasklet_struct *t) {int q_no;int reschedule =0 ; -struct octeon_device *oct = (struct octeon_device *)pdev; -struct octeon_device_priv *oct_priv = - (struct octeon_device_priv *)oct->priv; +struct octeon_device_priv *oct_priv =from_tasklet (oct_priv, t, + droq_tasklet); +struct octeon_device *oct = oct_priv->dev;for (q_no =0 ; q_no <MAX_OCTEON_OUTPUT_QUEUES (oct); q_no++) {if (!(oct->io_qmask.oq &BIT_ULL (q_no)))
@@ -4193,8 +4193,7 @@ static int octeon_device_init(struct octeon_device *octeon_dev)/* Initialize the tasklet that handles output queue packet processing.*/ dev_dbg (&octeon_dev->pci_dev->dev,"Initializing droq tasklet\n" ); -tasklet_init (&oct_priv->droq_tasklet, octeon_droq_bh, - (unsigned long )octeon_dev); +tasklet_setup (&oct_priv->droq_tasklet, octeon_droq_bh);/* Setup the interrupt handler and record the INT SUM register address */
@@ -4298,6 +4297,7 @@ static int octeon_device_init(struct octeon_device *octeon_dev)complete (&handshake[octeon_dev->octeon_id].init);atomic_set (&octeon_dev->status,OCT_DEV_HOST_OK ); + oct_priv->dev = octeon_dev;return 0 ; }
drivers/net/ethernet/cavium/liquidio/octeon_main.h +1 -0
@@ -39,6 +39,7 @@ struct octeon_device_priv {/** Tasklet structures for this device. */ struct tasklet_struct droq_tasklet;unsigned long napi_mask; +struct octeon_device *dev; };/** This structure is used by NIC driver to store information required
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c +4 -4
@@ -315,9 +315,9 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)netif_wake_queue (p->netdev); } -static void octeon_mgmt_clean_tx_tasklet (unsigned long arg) +static void octeon_mgmt_clean_tx_tasklet (struct tasklet_struct *t) { -struct octeon_mgmt *p = (struct octeon_mgmt *)arg; +struct octeon_mgmt *p =from_tasklet (p, t, tx_clean_tasklet);octeon_mgmt_clean_tx_buffers (p);octeon_mgmt_enable_tx_irq (p); }
@@ -1489,8 +1489,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_init (&p->tx_clean_tasklet, - octeon_mgmt_clean_tx_tasklet, (unsigned long )p); +tasklet_setup (&p->tx_clean_tasklet, + octeon_mgmt_clean_tx_tasklet); netdev->priv_flags |=IFF_UNICAST_FLT ;
drivers/net/ethernet/cavium/thunder/nicvf_main.c +4 -6
@@ -985,9 +985,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 (unsigned long data) +static void nicvf_handle_qs_err (struct tasklet_struct *t) { -struct nicvf *nic = (struct nicvf *)data; +struct nicvf *nic =from_tasklet (nic, t, qs_err_task);struct queue_set *qs = nic->qs;int qidx;u64 status;
@@ -1493,12 +1493,10 @@ int nicvf_open(struct net_device *netdev) }/* Init tasklet for handling Qset err interrupt */ -tasklet_init (&nic->qs_err_task, nicvf_handle_qs_err, - (unsigned long )nic); +tasklet_setup (&nic->qs_err_task, nicvf_handle_qs_err);/* Init RBDR tasklet which will refill RBDR */ -tasklet_init (&nic->rbdr_task, nicvf_rbdr_task, - (unsigned long )nic); +tasklet_setup (&nic->rbdr_task, nicvf_rbdr_task);INIT_DELAYED_WORK (&nic->rbdr_work, nicvf_rbdr_work);/* Configure CPI alorithm */
drivers/net/ethernet/cavium/thunder/nicvf_queues.c +2 -2
@@ -460,9 +460,9 @@ void nicvf_rbdr_work(struct work_struct *work) }/* In Softirq context, alloc rcv buffers in atomic mode */ -void nicvf_rbdr_task (unsigned long data) +void nicvf_rbdr_task (struct tasklet_struct *t) { -struct nicvf *nic = (struct nicvf *)data; +struct nicvf *nic =from_tasklet (nic, t, rbdr_task);nicvf_refill_rbdr (nic,GFP_ATOMIC );if (nic->rb_alloc_fail) {
drivers/net/ethernet/cavium/thunder/nicvf_queues.h +1 -1
@@ -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 (unsigned long data); +void nicvf_rbdr_task (struct tasklet_struct *t);void nicvf_rbdr_work (struct work_struct *work);void nicvf_enable_intr (struct nicvf *nic,int int_type,int q_idx);
Signature · 1 line
2.25.1
PATCH v2 6/20 ethernet: chelsio: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/chelsio/cxgb/sge.c | 12 ++++++++---- drivers/net/ethernet/chelsio/cxgb3/sge.c | 18 ++++++++---------- drivers/net/ethernet/chelsio/cxgb4/sge.c | 16 ++++++++-------- 3 files changed, 24 insertions(+), 22 deletions(-)
drivers/net/ethernet/chelsio/cxgb/sge.c +8 -4
@@ -239,8 +239,10 @@ struct sched {unsigned int num;/* num skbs in per port queues */ struct sched_port p[MAX_NPORTS ];struct tasklet_struct sched_tsk;/* tasklet used to run scheduler */ +struct sge *sge; }; -static void restart_sched (unsigned long ); + +static void restart_sched (struct tasklet_struct *t);/*
@@ -378,7 +380,8 @@ static int tx_sched_init(struct sge *sge)return -ENOMEM ;pr_debug ("tx_sched_init\n" ); -tasklet_init (&s->sched_tsk, restart_sched, (unsigned long ) sge); +tasklet_setup (&s->sched_tsk, restart_sched); + s->sge = sge; sge->tx_sched = s;for (i =0 ; i <MAX_NPORTS ; i++) {
@@ -1301,9 +1304,10 @@ static inline void reclaim_completed_tx(struct sge *sge, struct cmdQ *q)* Called from tasklet. Checks the scheduler for any * pending skbs that can be sent. */ -static void restart_sched (unsigned long arg) +static void restart_sched (struct tasklet_struct *t) { -struct sge *sge = (struct sge *) arg; +struct sched *s =from_tasklet (s, t, sched_tsk); +struct sge *sge = s->sge;struct adapter *adapter = sge->adapter;struct cmdQ *q = &sge->cmdQ[0 ];struct sk_buff *skb;
drivers/net/ethernet/chelsio/cxgb3/sge.c +8 -10
@@ -1516,14 +1516,14 @@ static int ctrl_xmit(struct adapter *adap, struct sge_txq *q,/** * restart_ctrlq - restart a suspended control queue -* @qs: the queue set cotaining the control queue +* @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx control queue. */ -static void restart_ctrlq (unsigned long data) +static void restart_ctrlq (struct tasklet_struct *t) {struct sk_buff *skb; -struct sge_qset *qs = (struct sge_qset *)data; +struct sge_qset *qs =from_tasklet (qs, t, txq[TXQ_CTRL ].qresume_tsk);struct sge_txq *q = &qs->txq[TXQ_CTRL ];spin_lock (&q->lock);
@@ -1733,14 +1733,14 @@ again: reclaim_completed_tx(adap, q, TX_RECLAIM_CHUNK);/** * restart_offloadq - restart a suspended offload queue -* @qs: the queue set cotaining the offload queue +* @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx offload queue. */ -static void restart_offloadq (unsigned long data) +static void restart_offloadq (struct tasklet_struct *t) {struct sk_buff *skb; -struct sge_qset *qs = (struct sge_qset *)data; +struct sge_qset *qs =from_tasklet (qs, t, txq[TXQ_OFLD ].qresume_tsk);struct sge_txq *q = &qs->txq[TXQ_OFLD ];const struct port_info *pi =netdev_priv (qs->netdev);struct adapter *adap = pi->adapter;
@@ -3084,10 +3084,8 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports,skb_queue_head_init (&q->txq[i].sendq); } -tasklet_init (&q->txq[TXQ_OFLD ].qresume_tsk, restart_offloadq, - (unsigned long )q); -tasklet_init (&q->txq[TXQ_CTRL ].qresume_tsk, restart_ctrlq, - (unsigned long )q); +tasklet_setup (&q->txq[TXQ_OFLD ].qresume_tsk, restart_offloadq); +tasklet_setup (&q->txq[TXQ_CTRL ].qresume_tsk, restart_ctrlq); q->fl[0 ].gen = q->fl[1 ].gen =1 ; q->fl[0 ].size = p->fl_size;
drivers/net/ethernet/chelsio/cxgb4/sge.c +8 -8
@@ -2660,15 +2660,15 @@ static int ctrl_xmit(struct sge_ctrl_txq *q, struct sk_buff *skb)/** * restart_ctrlq - restart a suspended control queue -* @data: the control queue to restart +* @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx control queue. */ -static void restart_ctrlq (unsigned long data) +static void restart_ctrlq (struct tasklet_struct *t) {struct sk_buff *skb;unsigned int written =0 ; -struct sge_ctrl_txq *q = (struct sge_ctrl_txq *)data; +struct sge_ctrl_txq *q =from_tasklet (q, t, qresume_tsk);spin_lock (&q->sendq.lock);reclaim_completed_tx_imm (&q->q);
@@ -2961,13 +2961,13 @@ static int ofld_xmit(struct sge_uld_txq *q, struct sk_buff *skb)/** * restart_ofldq - restart a suspended offload queue -* @data: the offload queue to restart +* @t: pointer to the tasklet associated with this handler * * Resumes transmission on a suspended Tx offload queue. */ -static void restart_ofldq (unsigned long data) +static void restart_ofldq (struct tasklet_struct *t) { -struct sge_uld_txq *q = (struct sge_uld_txq *)data; +struct sge_uld_txq *q =from_tasklet (q, t, qresume_tsk);spin_lock (&q->sendq.lock); q->full =0 ;/* the queue actually is completely empty now */
@@ -4580,7 +4580,7 @@ int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq,init_txq (adap, &txq->q,FW_EQ_CTRL_CMD_EQID_G (ntohl (c.cmpliqid_eqid))); txq->adap = adap;skb_queue_head_init (&txq->sendq); -tasklet_init (&txq->qresume_tsk, restart_ctrlq, (unsigned long )txq); +tasklet_setup (&txq->qresume_tsk, restart_ctrlq); txq->full =0 ;return 0 ; }
@@ -4670,7 +4670,7 @@ int t4_sge_alloc_uld_txq(struct adapter *adap, struct sge_uld_txq *txq, txq->q.q_type =CXGB4_TXQ_ULD ; txq->adap = adap;skb_queue_head_init (&txq->sendq); -tasklet_init (&txq->qresume_tsk, restart_ofldq, (unsigned long )txq); +tasklet_setup (&txq->qresume_tsk, restart_ofldq); txq->full =0 ; txq->mapping_err =0 ;return 0 ;
Signature · 1 line
2.25.1
PATCH v2 7/20 ethernet: dlink: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/dlink/sundance.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/net/ethernet/dlink/sundance.c +10 -10
@@ -429,8 +429,8 @@ static void init_ring(struct net_device *dev);static netdev_tx_t start_tx (struct sk_buff *skb,struct net_device *dev);static int reset_tx (struct net_device *dev);static irqreturn_t intr_handler (int irq,void *dev_instance); -static void rx_poll (unsigned long data); -static void tx_poll (unsigned long data); +static void rx_poll (struct tasklet_struct *t); +static void tx_poll (struct tasklet_struct *t);static void refill_rx (struct net_device *dev);static void netdev_error (struct net_device *dev,int intr_status);static void netdev_error (struct net_device *dev,int intr_status);
@@ -537,8 +537,8 @@ static int sundance_probe1(struct pci_dev *pdev, np->msg_enable = (1 << debug) -1 ;spin_lock_init (&np->lock);spin_lock_init (&np->statlock); -tasklet_init (&np->rx_tasklet, rx_poll, (unsigned long )dev); -tasklet_init (&np->tx_tasklet, tx_poll, (unsigned long )dev); +tasklet_setup (&np->rx_tasklet, rx_poll); +tasklet_setup (&np->tx_tasklet, tx_poll); ring_space =dma_alloc_coherent (&pdev->dev,TX_TOTAL_SIZE , &ring_dma,GFP_KERNEL );
@@ -1054,10 +1054,9 @@ static void init_ring(struct net_device *dev) } } -static void tx_poll (unsigned long data) +static void tx_poll (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *)data; -struct netdev_private *np =netdev_priv (dev); +struct netdev_private *np =from_tasklet (np, t, tx_tasklet);unsigned head = np->cur_task %TX_RING_SIZE ;struct netdev_desc *txdesc = &np->tx_ring[(np->cur_tx -1 ) %TX_RING_SIZE ];
@@ -1312,10 +1311,11 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)return IRQ_RETVAL (handled); } -static void rx_poll (unsigned long data) +static void rx_poll (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *)data; -struct netdev_private *np =netdev_priv (dev); +struct netdev_private *np =from_tasklet (np, t, rx_tasklet); +struct net_device *dev = (struct net_device *)((char *)np - +ALIGN (sizeof (struct net_device ),NETDEV_ALIGN ));int entry = np->cur_rx %RX_RING_SIZE ;int boguscnt = np->budget;void __iomem *ioaddr = np->base;
Signature · 1 line
2.25.1
David Miller
maintainerRe: [PATCH v2 07/20] ethernet: dlink: convert tasklets to use new tasklet_setup() API
From: Allen Pais <[email protected]>
Date: Wed, 9 Sep 2020 14:14:57 +0530
drivers/net/ethernet/dlink/sundance.c static irqreturn_t intr_handler(int irq, void *dev_instance) · line 1318
Quoted 12 lines
drivers/net/ethernet/dlink/sundance.c +4
-3@@ -1312,10 +1311,11 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)return IRQ_RETVAL (handled); } -static void rx_poll (unsigned long data) +static void rx_poll (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *)data; -struct netdev_private *np =netdev_priv (dev); +struct netdev_private *np =from_tasklet (np, t, rx_tasklet); +struct net_device *dev = (struct net_device *)((char *)np - +ALIGN (sizeof (struct net_device ),NETDEV_ALIGN ));
Just like patch #1, I don't want to see this brittle construct.
PATCH v2 8/20 ethernet: hinic: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/ethernet/huawei/hinic/hinic_hw_eqs.c +4 -5
@@ -368,11 +368,11 @@ static void eq_irq_work(struct work_struct *work)/** * ceq_tasklet - the tasklet of the EQ that received the event -* @ceq_data: the eq +* @t: pointer to the tasklet associated with this handler **/ -static void ceq_tasklet (unsigned long ceq_data) +static void ceq_tasklet (struct tasklet_struct *t) { -struct hinic_eq *ceq = (struct hinic_eq *)ceq_data; +struct hinic_eq *ceq =from_tasklet (ceq, t, ceq_tasklet);eq_irq_handler (ceq); }
@@ -782,8 +782,7 @@ static int init_eq(struct hinic_eq *eq, struct hinic_hwif *hwif,INIT_WORK (&aeq_work->work, eq_irq_work); }else if (type ==HINIC_CEQ ) { -tasklet_init (&eq->ceq_tasklet, ceq_tasklet, - (unsigned long )eq); +tasklet_setup (&eq->ceq_tasklet, ceq_tasklet); }/* set the attributes of the msix entry */
Signature · 1 line
2.25.1
PATCH v2 9/20 ethernet: ehea: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/ibm/ehea/ehea_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/ibm/ehea/ehea_main.c +3 -4
@@ -1212,9 +1212,9 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe) } } -static void ehea_neq_tasklet (unsigned long data) +static void ehea_neq_tasklet (struct tasklet_struct *t) { -struct ehea_adapter *adapter = (struct ehea_adapter *)data; +struct ehea_adapter *adapter =from_tasklet (adapter, t, neq_tasklet);struct ehea_eqe *eqe;u64 event_mask;
@@ -3417,8 +3417,7 @@ static int ehea_probe_adapter(struct platform_device *dev) goto out_free_ad; } -tasklet_init (&adapter->neq_tasklet, ehea_neq_tasklet, - (unsigned long )adapter); +tasklet_setup (&adapter->neq_tasklet, ehea_neq_tasklet); ret =ehea_create_device_sysfs (dev);if (ret)
Signature · 1 line
2.25.1
PATCH v2 10/20 ethernet: ibmvnic: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/ibm/ibmvnic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/ibm/ibmvnic.c +3 -4
@@ -4810,9 +4810,9 @@ static irqreturn_t ibmvnic_interrupt(int irq, void *instance)return IRQ_HANDLED ; } -static void ibmvnic_tasklet (void *data) +static void ibmvnic_tasklet (struct tasklet_struct *t) { -struct ibmvnic_adapter *adapter = data; +struct ibmvnic_adapter *adapter =from_tasklet (adapter, t, tasklet);struct ibmvnic_crq_queue *queue = &adapter->crq;union ibmvnic_crq *crq;unsigned long flags;
@@ -4947,8 +4947,7 @@ static int init_crq_queue(struct ibmvnic_adapter *adapter) retrc =0 ; -tasklet_init (&adapter->tasklet, (void *)ibmvnic_tasklet, - (unsigned long )adapter); +tasklet_setup (&adapter->tasklet, (void *)ibmvnic_tasklet);netdev_dbg (adapter->netdev,"registering irq 0x%x\n" , vdev->irq); snprintf(crq->name, sizeof(crq->name), "ibmvnic-%x",
Signature · 1 line
2.25.1
PATCH v2 11/20 ethernet: jme: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/jme.c | 40 +++++++++++++++----------------------- 1 file changed, 16 insertions(+), 24 deletions(-)
drivers/net/ethernet/jme.c +16 -24
@@ -1187,9 +1187,9 @@ jme_shutdown_nic(struct jme_adapter *jme) }static void -jme_pcc_tasklet (unsigned long arg) +jme_pcc_tasklet (struct tasklet_struct *t) { -struct jme_adapter *jme = (struct jme_adapter *)arg; +struct jme_adapter *jme =from_tasklet (jme, t, pcc_task);struct net_device *netdev = jme->dev;if (unlikely (test_bit (JME_FLAG_SHUTDOWN , &jme->flags))) {
@@ -1265,10 +1265,9 @@ jme_stop_shutdown_timer(struct jme_adapter *jme)jwrite32f (jme,JME_APMC , apmc); } -static void -jme_link_change_tasklet (unsigned long arg) +static void jme_link_change_tasklet (struct tasklet_struct *t) { -struct jme_adapter *jme = (struct jme_adapter *)arg; +struct jme_adapter *jme =from_tasklet (jme, t, linkch_task);struct net_device *netdev = jme->dev;int rc;
@@ -1345,9 +1344,9 @@ jme_link_change_tasklet(unsigned long arg) }static void -jme_rx_clean_tasklet (unsigned long arg) +jme_rx_clean_tasklet (struct tasklet_struct *t) { -struct jme_adapter *jme = (struct jme_adapter *)arg; +struct jme_adapter *jme =from_tasklet (jme, t, rxclean_task);struct dynpcc_info *dpi = &(jme->dpi);jme_process_receive (jme, jme->rx_ring_size);
@@ -1380,9 +1379,9 @@ jme_poll(JME_NAPI_HOLDER(holder), JME_NAPI_WEIGHT(budget)) }static void -jme_rx_empty_tasklet (unsigned long arg) +jme_rx_empty_tasklet (struct tasklet_struct *t) { -struct jme_adapter *jme = (struct jme_adapter *)arg; +struct jme_adapter *jme =from_tasklet (jme, t, rxempty_task);if (unlikely (atomic_read (&jme->link_changing) !=1 ))return ;
@@ -1392,7 +1391,7 @@ jme_rx_empty_tasklet(unsigned long arg)netif_info (jme, rx_status, jme->dev,"RX Queue Full!\n" ); -jme_rx_clean_tasklet (arg); +jme_rx_clean_tasklet (&jme->rxclean_task);while (atomic_read (&jme->rx_empty) >0 ) {atomic_dec (&jme->rx_empty);
@@ -1416,10 +1415,9 @@ jme_wake_queue_if_stopped(struct jme_adapter *jme) } -static void -jme_tx_clean_tasklet (unsigned long arg) +static void jme_tx_clean_tasklet (struct tasklet_struct *t) { -struct jme_adapter *jme = (struct jme_adapter *)arg; +struct jme_adapter *jme =from_tasklet (jme, t, txclean_task);struct jme_ring *txring = &(jme->txring[0 ]);struct txdesc *txdesc = txring->desc;struct jme_buffer_info *txbi = txring->bufinf, *ctxbi, *ttxbi;
@@ -1834,14 +1832,10 @@ jme_open(struct net_device *netdev)jme_clear_pm_disable_wol (jme);JME_NAPI_ENABLE (jme); -tasklet_init (&jme->linkch_task, jme_link_change_tasklet, - (unsigned long ) jme); -tasklet_init (&jme->txclean_task, jme_tx_clean_tasklet, - (unsigned long ) jme); -tasklet_init (&jme->rxclean_task, jme_rx_clean_tasklet, - (unsigned long ) jme); -tasklet_init (&jme->rxempty_task, jme_rx_empty_tasklet, - (unsigned long ) jme); +tasklet_setup (&jme->linkch_task, jme_link_change_tasklet); +tasklet_setup (&jme->txclean_task, jme_tx_clean_tasklet); +tasklet_setup (&jme->rxclean_task, jme_rx_clean_tasklet); +tasklet_setup (&jme->rxempty_task, jme_rx_empty_tasklet); rc =jme_request_irq (jme);if (rc)
@@ -3040,9 +3034,7 @@ jme_init_one(struct pci_dev *pdev,atomic_set (&jme->tx_cleaning,1 );atomic_set (&jme->rx_empty,1 ); -tasklet_init (&jme->pcc_task, - jme_pcc_tasklet, - (unsigned long ) jme); +tasklet_setup (&jme->pcc_task, jme_pcc_tasklet); jme->dpi.cur =PCC_P1 ; jme->reg_ghc =0 ;
Signature · 1 line
2.25.1
PATCH v2 12/20 ethernet: marvell: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/marvell/skge.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/marvell/skge.c +3 -3
@@ -3338,9 +3338,9 @@ static void skge_error_irq(struct skge_hw *hw)* because accessing phy registers requires spin wait which might * cause excess interrupt latency. */ -static void skge_extirq (unsigned long arg) +static void skge_extirq (struct tasklet_struct *t) { -struct skge_hw *hw = (struct skge_hw *) arg; +struct skge_hw *hw =from_tasklet (hw, t, phy_task);int port;for (port =0 ; port < hw->ports; port++) {
@@ -3927,7 +3927,7 @@ static int skge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) hw->pdev = pdev;spin_lock_init (&hw->hw_lock);spin_lock_init (&hw->phy_lock); -tasklet_init (&hw->phy_task, skge_extirq, (unsigned long ) hw); +tasklet_setup (&hw->phy_task, skge_extirq); hw->regs =ioremap (pci_resource_start (pdev,0 ),0x4000 );if (!hw->regs) {
Signature · 1 line
2.25.1
PATCH v2 13/20 ethernet: mellanox: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/mellanox/mlx4/cq.c | 4 ++-- drivers/net/ethernet/mellanox/mlx4/eq.c | 3 +-- drivers/net/ethernet/mellanox/mlx4/mlx4.h | 2 +- drivers/net/ethernet/mellanox/mlx5/core/cq.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 3 +-- drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c | 7 +++---- drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h | 2 +- drivers/net/ethernet/mellanox/mlxsw/pci.c | 12 ++++++------ 8 files changed, 17 insertions(+), 20 deletions(-)
drivers/net/ethernet/mellanox/mlx4/cq.c +2 -2
@@ -55,11 +55,11 @@#define TASKLET_MAX_TIME 2#define TASKLET_MAX_TIME_JIFFIES msecs_to_jiffies(TASKLET_MAX_TIME) -void mlx4_cq_tasklet_cb (unsigned long data) +void mlx4_cq_tasklet_cb (struct tasklet_struct *t) {unsigned long flags;unsigned long end = jiffies +TASKLET_MAX_TIME_JIFFIES ; -struct mlx4_eq_tasklet *ctx = (struct mlx4_eq_tasklet *)data; +struct mlx4_eq_tasklet *ctx =from_tasklet (ctx, t, task);struct mlx4_cq *mcq, *temp;spin_lock_irqsave (&ctx->lock, flags);
drivers/net/ethernet/mellanox/mlx4/eq.c +1 -2
@@ -1057,8 +1057,7 @@ static int mlx4_create_eq(struct mlx4_dev *dev, int nent,INIT_LIST_HEAD (&eq->tasklet_ctx.list);INIT_LIST_HEAD (&eq->tasklet_ctx.process_list);spin_lock_init (&eq->tasklet_ctx.lock); -tasklet_init (&eq->tasklet_ctx.task, mlx4_cq_tasklet_cb, - (unsigned long )&eq->tasklet_ctx); +tasklet_setup (&eq->tasklet_ctx.task, mlx4_cq_tasklet_cb);return err;
drivers/net/ethernet/mellanox/mlx4/mlx4.h +1 -1
@@ -1217,7 +1217,7 @@ void mlx4_cmd_use_polling(struct mlx4_dev *dev);int mlx4_comm_cmd (struct mlx4_dev *dev,u8 cmd,u16 param,u16 op,unsigned long timeout); -void mlx4_cq_tasklet_cb (unsigned long data); +void mlx4_cq_tasklet_cb (struct tasklet_struct *t);void mlx4_cq_completion (struct mlx4_dev *dev,u32 cqn);void mlx4_cq_event (struct mlx4_dev *dev,u32 cqn,int event_type);
drivers/net/ethernet/mellanox/mlx5/core/cq.c +2 -2
@@ -42,11 +42,11 @@#define TASKLET_MAX_TIME 2#define TASKLET_MAX_TIME_JIFFIES msecs_to_jiffies(TASKLET_MAX_TIME) -void mlx5_cq_tasklet_cb (unsigned long data) +void mlx5_cq_tasklet_cb (struct tasklet_struct *t) {unsigned long flags;unsigned long end = jiffies +TASKLET_MAX_TIME_JIFFIES ; -struct mlx5_eq_tasklet *ctx = (struct mlx5_eq_tasklet *)data; +struct mlx5_eq_tasklet *ctx =from_tasklet (ctx, t, task);struct mlx5_core_cq *mcq;struct mlx5_core_cq *temp;
drivers/net/ethernet/mellanox/mlx5/core/eq.c +1 -2
@@ -788,8 +788,7 @@ static int create_comp_eqs(struct mlx5_core_dev *dev)INIT_LIST_HEAD (&eq->tasklet_ctx.list);INIT_LIST_HEAD (&eq->tasklet_ctx.process_list);spin_lock_init (&eq->tasklet_ctx.lock); -tasklet_init (&eq->tasklet_ctx.task, mlx5_cq_tasklet_cb, - (unsigned long )&eq->tasklet_ctx); +tasklet_setup (&eq->tasklet_ctx.task, mlx5_cq_tasklet_cb); eq->irq_nb.notifier_call = mlx5_eq_comp_int; param = (struct mlx5_eq_param ) {
drivers/net/ethernet/mellanox/mlx5/core/fpga/conn.c +3 -4
@@ -388,9 +388,9 @@ static inline void mlx5_fpga_conn_cqes(struct mlx5_fpga_conn *conn,mlx5_fpga_conn_arm_cq (conn); } -static void mlx5_fpga_conn_cq_tasklet (unsigned long data) +static void mlx5_fpga_conn_cq_tasklet (struct tasklet_struct *t) { -struct mlx5_fpga_conn *conn = (void *)data; +struct mlx5_fpga_conn *conn =from_tasklet (conn, t, cq.tasklet);if (unlikely (!conn->qp.active))return ;
@@ -478,8 +478,7 @@ static int mlx5_fpga_conn_create_cq(struct mlx5_fpga_conn *conn, int cq_size) conn->cq.mcq.comp = mlx5_fpga_conn_cq_complete; conn->cq.mcq.irqn = irqn; conn->cq.mcq.uar = fdev->conn_res.uar; -tasklet_init (&conn->cq.tasklet, mlx5_fpga_conn_cq_tasklet, - (unsigned long )conn); +tasklet_setup (&conn->cq.tasklet, mlx5_fpga_conn_cq_tasklet);mlx5_fpga_dbg (fdev,"Created CQ #0x%x\n" , conn->cq.mcq.cqn);
drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h +1 -1
@@ -77,7 +77,7 @@ int mlx5_eq_add_cq(struct mlx5_eq *eq, struct mlx5_core_cq *cq);void mlx5_eq_del_cq (struct mlx5_eq *eq,struct mlx5_core_cq *cq);struct mlx5_eq_comp *mlx5_eqn2comp_eq (struct mlx5_core_dev *dev,int eqn);struct mlx5_eq *mlx5_get_async_eq (struct mlx5_core_dev *dev); -void mlx5_cq_tasklet_cb (unsigned long data); +void mlx5_cq_tasklet_cb (struct tasklet_struct *t);struct cpumask *mlx5_eq_comp_cpumask (struct mlx5_core_dev *dev,int ix);u32 mlx5_eq_poll_irq_disabled (struct mlx5_eq_comp *eq);
drivers/net/ethernet/mellanox/mlxsw/pci.c +6 -6
@@ -620,9 +620,9 @@ static char *mlxsw_pci_cq_sw_cqe_get(struct mlxsw_pci_queue *q)return elem; } -static void mlxsw_pci_cq_tasklet (unsigned long data) +static void mlxsw_pci_cq_tasklet (struct tasklet_struct *t) { -struct mlxsw_pci_queue *q = (struct mlxsw_pci_queue *) data; +struct mlxsw_pci_queue *q =from_tasklet (q, t, tasklet);struct mlxsw_pci *mlxsw_pci = q->pci;char *cqe;int items =0 ;
@@ -733,9 +733,9 @@ static char *mlxsw_pci_eq_sw_eqe_get(struct mlxsw_pci_queue *q)return elem; } -static void mlxsw_pci_eq_tasklet (unsigned long data) +static void mlxsw_pci_eq_tasklet (struct tasklet_struct *t) { -struct mlxsw_pci_queue *q = (struct mlxsw_pci_queue *) data; +struct mlxsw_pci_queue *q =from_tasklet (q, t, tasklet);struct mlxsw_pci *mlxsw_pci = q->pci;u8 cq_count =mlxsw_pci_cq_count (mlxsw_pci);unsigned long active_cqns[BITS_TO_LONGS (MLXSW_PCI_CQS_MAX )];
@@ -792,7 +792,7 @@ struct mlxsw_pci_queue_ops { struct mlxsw_pci_queue *q);void (*fini)(struct mlxsw_pci *mlxsw_pci,struct mlxsw_pci_queue *q); -void (*tasklet)(unsigned long data); +void (*tasklet)(struct tasklet_struct *t);u16 (*elem_count_f)(const struct mlxsw_pci_queue *q);u8 (*elem_size_f)(const struct mlxsw_pci_queue *q);u16 elem_count;
@@ -855,7 +855,7 @@ static int mlxsw_pci_queue_init(struct mlxsw_pci *mlxsw_pci, char *mbox, q->pci = mlxsw_pci;if (q_ops->tasklet) -tasklet_init (&q->tasklet, q_ops->tasklet, (unsigned long ) q); +tasklet_setup (&q->tasklet, q_ops->tasklet); mem_item->size =MLXSW_PCI_AQ_SIZE ; mem_item->buf = pci_alloc_consistent(mlxsw_pci->pdev,
Signature · 1 line
2.25.1
PATCH v2 14/20 ethernet: micrel: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/micrel/ks8842.c | 19 ++++++++++--------- drivers/net/ethernet/micrel/ksz884x.c | 14 ++++++-------- 2 files changed, 16 insertions(+), 17 deletions(-)
drivers/net/ethernet/micrel/ks8842.c +10 -9
@@ -587,10 +587,11 @@ static int __ks8842_start_new_rx_dma(struct net_device *netdev)return err; } -static void ks8842_rx_frame_dma_tasklet (unsigned long arg) +static void ks8842_rx_frame_dma_tasklet (struct tasklet_struct *t) { -struct net_device *netdev = (struct net_device *)arg; -struct ks8842_adapter *adapter =netdev_priv (netdev); +struct ks8842_adapter *adapter =from_tasklet (adapter, t, dma_rx.tasklet); +struct net_device *netdev = (struct net_device *)((char *)adapter - +ALIGN (sizeof (struct net_device ),NETDEV_ALIGN ));struct ks8842_rx_dma_ctl *ctl = &adapter->dma_rx;struct sk_buff *skb = ctl->skb;dma_addr_t addr =sg_dma_address (&ctl->sg);
@@ -720,10 +721,11 @@ static void ks8842_handle_rx_overrun(struct net_device *netdev, netdev->stats.rx_fifo_errors++; } -static void ks8842_tasklet (unsigned long arg) +static void ks8842_tasklet (struct tasklet_struct *t) { -struct net_device *netdev = (struct net_device *)arg; -struct ks8842_adapter *adapter =netdev_priv (netdev); +struct ks8842_adapter *adapter =from_tasklet (adapter, t, tasklet); +struct net_device *netdev = (struct net_device *)((char *)adapter - +ALIGN (sizeof (struct net_device ),NETDEV_ALIGN ));u16 isr;unsigned long flags;u16 entry_bank;
@@ -953,8 +955,7 @@ static int ks8842_alloc_dma_bufs(struct net_device *netdev) goto err; } -tasklet_init (&rx_ctl->tasklet, ks8842_rx_frame_dma_tasklet, - (unsigned long )netdev); +tasklet_setup (&rx_ctl->tasklet, ks8842_rx_frame_dma_tasklet);return 0 ; err:
@@ -1173,7 +1174,7 @@ static int ks8842_probe(struct platform_device *pdev) adapter->dma_tx.channel =-1 ; } -tasklet_init (&adapter->tasklet, ks8842_tasklet, (unsigned long )netdev); +tasklet_setup (&adapter->tasklet, ks8842_tasklet);spin_lock_init (&adapter->lock); netdev->netdev_ops = &ks8842_netdev_ops;
drivers/net/ethernet/micrel/ksz884x.c +6 -8
@@ -5159,9 +5159,9 @@ static int dev_rcv_special(struct dev_info *hw_priv)return received; } -static void rx_proc_task (unsigned long data) +static void rx_proc_task (struct tasklet_struct *t) { -struct dev_info *hw_priv = (struct dev_info *) data; +struct dev_info *hw_priv =from_tasklet (hw_priv, t, rx_tasklet);struct ksz_hw *hw = &hw_priv->hw;if (!hw->enabled)
@@ -5181,9 +5181,9 @@ static void rx_proc_task(unsigned long data) } } -static void tx_proc_task (unsigned long data) +static void tx_proc_task (struct tasklet_struct *t) { -struct dev_info *hw_priv = (struct dev_info *) data; +struct dev_info *hw_priv =from_tasklet (hw_priv, t, tx_tasklet);struct ksz_hw *hw = &hw_priv->hw;hw_ack_intr (hw,KS884X_INT_TX_MASK );
@@ -5436,10 +5436,8 @@ static int prepare_hardware(struct net_device *dev) rc =request_irq (dev->irq, netdev_intr,IRQF_SHARED , dev->name, dev);if (rc)return rc; -tasklet_init (&hw_priv->rx_tasklet, rx_proc_task, - (unsigned long ) hw_priv); -tasklet_init (&hw_priv->tx_tasklet, tx_proc_task, - (unsigned long ) hw_priv); +tasklet_setup (&hw_priv->rx_tasklet, rx_proc_task); +tasklet_setup (&hw_priv->tx_tasklet, tx_proc_task); hw->promiscuous =0 ; hw->all_multi =0 ;
Signature · 1 line
2.25.1
PATCH v2 15/20 ethernet: natsemi: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/natsemi/ns83820.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/natsemi/ns83820.c +4 -4
@@ -923,10 +923,10 @@ static void rx_irq(struct net_device *ndev)spin_unlock_irqrestore (&info->lock, flags); } -static void rx_action (unsigned long _dev) +static void rx_action (struct tasklet_struct *t) { -struct net_device *ndev = (void *)_dev; -struct ns83820 *dev =PRIV (ndev); +struct ns83820 *dev =from_tasklet (dev, t, rx_tasklet); +struct net_device *ndev = dev->ndev;rx_irq (ndev);writel (ihr, dev->base +IHR );
@@ -1927,7 +1927,7 @@ static int ns83820_init_one(struct pci_dev *pci_dev,SET_NETDEV_DEV (ndev, &pci_dev->dev);INIT_WORK (&dev->tq_refill, queue_refill); -tasklet_init (&dev->rx_tasklet, rx_action, (unsigned long )ndev); +tasklet_setup (&dev->rx_tasklet, rx_action); err =pci_enable_device (pci_dev);if (err) {
Signature · 1 line
2.25.1
PATCH v2 16/20 ethernet: netronome: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_net_common.c +3 -4
@@ -2287,9 +2287,9 @@ static bool nfp_ctrl_rx(struct nfp_net_r_vector *r_vec)return budget; } -static void nfp_ctrl_poll (unsigned long arg) +static void nfp_ctrl_poll (struct tasklet_struct *t) { -struct nfp_net_r_vector *r_vec = (void *)arg; +struct nfp_net_r_vector *r_vec =from_tasklet (r_vec, t, tasklet);spin_lock (&r_vec->lock);nfp_net_tx_complete (r_vec->tx_ring,0 );
@@ -2337,8 +2337,7 @@ static void nfp_net_vecs_init(struct nfp_net *nn)__skb_queue_head_init (&r_vec->queue);spin_lock_init (&r_vec->lock); -tasklet_init (&r_vec->tasklet, nfp_ctrl_poll, - (unsigned long )r_vec); +tasklet_setup (&r_vec->tasklet, nfp_ctrl_poll);tasklet_disable (&r_vec->tasklet); }
Signature · 1 line
2.25.1
Re: [PATCH v2 16/20] ethernet: netronome: convert tasklets to use new tasklet_setup() API
Quoted 7 lines · Allen Pais
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Signed-off-by Romain Perier <[email protected]>Signed-off-by Allen Pais <[email protected]>
The correct prefix for NFP driver patches is "nfp: ", not "ethernet: netronome: ". Possibly a similar comment applies to other patches in this series.
Patches targeted at "net-next" should include "net-next" in the subject, like this: [PATCH v2 net-next 16/20] ...
The patch itself seems fine to me.
So with the above fixed feel free to add:
Quoted 33 lines
--- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)drivers/net/ethernet/netronome/nfp/nfp_net_common.c +3
-4@@ -2287,9 +2287,9 @@ static bool nfp_ctrl_rx(struct nfp_net_r_vector *r_vec)return budget; } -static void nfp_ctrl_poll (unsigned long arg) +static void nfp_ctrl_poll (struct tasklet_struct *t) { -struct nfp_net_r_vector *r_vec = (void *)arg; +struct nfp_net_r_vector *r_vec =from_tasklet (r_vec, t, tasklet);spin_lock (&r_vec->lock);nfp_net_tx_complete (r_vec->tx_ring,0 );@@ -2337,8 +2337,7 @@ static void nfp_net_vecs_init(struct nfp_net *nn)__skb_queue_head_init (&r_vec->queue);spin_lock_init (&r_vec->lock); -tasklet_init (&r_vec->tasklet, nfp_ctrl_poll, - (unsigned long )r_vec); +tasklet_setup (&r_vec->tasklet, nfp_ctrl_poll);tasklet_disable (&r_vec->tasklet); }Signature · 1 line
2.25.1
Re: [PATCH v2 16/20] ethernet: netronome: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisQuoted 7 lines · On Wed, 9 Sep 2020 14:15:06 +0530 Allen Pais wrote:
In preparation for unconditionally passing the struct
tasklet_structpointer to all tasklet callbacks, switch to using the newtasklet_setup()andfrom_tasklet()to pass the tasklet pointer explicitly.Signed-off-by Romain Perier <[email protected]>Signed-off-by Allen Pais <[email protected]>
PATCH v2 17/20 ethernet: ni: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/ni/nixge.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/ethernet/ni/nixge.c +3 -4
@@ -787,9 +787,9 @@ static irqreturn_t nixge_rx_irq(int irq, void *_ndev)return IRQ_HANDLED ; } -static void nixge_dma_err_handler (unsigned long data) +static void nixge_dma_err_handler (struct tasklet_struct *t) { -struct nixge_priv *lp = (struct nixge_priv *)data; +struct nixge_priv *lp =from_tasklet (lp, t, dma_err_tasklet);struct nixge_hw_dma_bd *cur_p;struct nixge_tx_skb *tx_skb;u32 cr, i;
@@ -879,8 +879,7 @@ static int nixge_open(struct net_device *ndev)phy_start (phy);/* Enable tasklets for Axi DMA error handling */ -tasklet_init (&priv->dma_err_tasklet, nixge_dma_err_handler, - (unsigned long )priv); +tasklet_setup (&priv->dma_err_tasklet, nixge_dma_err_handler);napi_enable (&priv->napi);
Signature · 1 line
2.25.1
PATCH v2 18/20 ethernet: qlogic: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/qlogic/qed/qed.h | 2 +- drivers/net/ethernet/qlogic/qed/qed_int.c | 27 +++------------------- drivers/net/ethernet/qlogic/qed/qed_int.h | 2 +- drivers/net/ethernet/qlogic/qed/qed_main.c | 14 +++++------ 4 files changed, 12 insertions(+), 33 deletions(-)
drivers/net/ethernet/qlogic/qed/qed.h +1 -1
@@ -572,7 +572,7 @@ struct qed_hwfn {struct qed_consq *p_consq;/* Slow-Path definitions */ -struct tasklet_struct *sp_dpc; +struct tasklet_struct sp_dpc;bool b_sp_dpc_enabled;struct qed_ptt *p_main_ptt;
drivers/net/ethernet/qlogic/qed/qed_int.c +3 -24
@@ -1216,9 +1216,9 @@ static void qed_sb_ack_attn(struct qed_hwfn *p_hwfn,barrier (); } -void qed_int_sp_dpc (unsigned long hwfn_cookie) +void qed_int_sp_dpc (struct tasklet_struct *t) { -struct qed_hwfn *p_hwfn = (struct qed_hwfn *)hwfn_cookie; +struct qed_hwfn *p_hwfn =from_tasklet (p_hwfn, t, sp_dpc);struct qed_pi_info *pi_info =NULL ;struct qed_sb_attn_info *sb_attn;struct qed_sb_info *sb_info;
@@ -2285,34 +2285,14 @@ u64 qed_int_igu_read_sisr_reg(struct qed_hwfn *p_hwfn)static void qed_int_sp_dpc_setup (struct qed_hwfn *p_hwfn) { -tasklet_init (p_hwfn->sp_dpc, - qed_int_sp_dpc, (unsigned long )p_hwfn); +tasklet_setup (&p_hwfn->sp_dpc, qed_int_sp_dpc); p_hwfn->b_sp_dpc_enabled = true; } -static int qed_int_sp_dpc_alloc (struct qed_hwfn *p_hwfn) -{ - p_hwfn->sp_dpc =kmalloc (sizeof (*p_hwfn->sp_dpc),GFP_KERNEL ); -if (!p_hwfn->sp_dpc) -return -ENOMEM ; - -return 0 ; -} - -static void qed_int_sp_dpc_free (struct qed_hwfn *p_hwfn) -{ -kfree (p_hwfn->sp_dpc); - p_hwfn->sp_dpc =NULL ; -} -int qed_int_alloc (struct qed_hwfn *p_hwfn,struct qed_ptt *p_ptt) {int rc =0 ; - rc =qed_int_sp_dpc_alloc (p_hwfn); -if (rc) -return rc; - rc =qed_int_sp_sb_alloc (p_hwfn, p_ptt);if (rc)return rc;
@@ -2326,7 +2306,6 @@ void qed_int_free(struct qed_hwfn *p_hwfn) {qed_int_sp_sb_free (p_hwfn);qed_int_sb_attn_free (p_hwfn); -qed_int_sp_dpc_free (p_hwfn); }void qed_int_setup (struct qed_hwfn *p_hwfn,struct qed_ptt *p_ptt)
drivers/net/ethernet/qlogic/qed/qed_int.h +1 -1
@@ -140,7 +140,7 @@ int qed_int_sb_release(struct qed_hwfn *p_hwfn,* @param p_hwfn - pointer to hwfn * */ -void qed_int_sp_dpc (unsigned long hwfn_cookie); +void qed_int_sp_dpc (struct tasklet_struct *t);/** * @brief qed_int_get_num_sbs - get the number of status
drivers/net/ethernet/qlogic/qed/qed_main.c +7 -7
@@ -841,7 +841,7 @@ static irqreturn_t qed_single_int(int irq, void *dev_instance)/* Slowpath interrupt */ if (unlikely (status &0x1 )) { -tasklet_schedule (hwfn->sp_dpc); +tasklet_schedule (&hwfn->sp_dpc); status &= ~0x1 ; rc =IRQ_HANDLED ; }
@@ -887,7 +887,7 @@ int qed_slowpath_irq_req(struct qed_hwfn *hwfn) id, cdev->pdev->bus->number, PCI_SLOT(cdev->pdev->devfn), hwfn->abs_pf_id); rc =request_irq (cdev->int_params.msix_table[id].vector, - qed_msix_sp_int,0 , hwfn->name, hwfn->sp_dpc); + qed_msix_sp_int,0 , hwfn->name, &hwfn->sp_dpc); }else {unsigned long flags =0 ;
@@ -919,8 +919,8 @@ static void qed_slowpath_tasklet_flush(struct qed_hwfn *p_hwfn)* enable function makes this sequence a flush-like operation. */ if (p_hwfn->b_sp_dpc_enabled) { -tasklet_disable (p_hwfn->sp_dpc); -tasklet_enable (p_hwfn->sp_dpc); +tasklet_disable (&p_hwfn->sp_dpc); +tasklet_enable (&p_hwfn->sp_dpc); } }
@@ -949,7 +949,7 @@ static void qed_slowpath_irq_free(struct qed_dev *cdev)break ;synchronize_irq (cdev->int_params.msix_table[i].vector);free_irq (cdev->int_params.msix_table[i].vector, - cdev->hwfns[i].sp_dpc); + &cdev->hwfns[i].sp_dpc); } }else {if (QED_LEADING_HWFN (cdev)->b_int_requested)
@@ -968,11 +968,11 @@ static int qed_nic_stop(struct qed_dev *cdev)struct qed_hwfn *p_hwfn = &cdev->hwfns[i];if (p_hwfn->b_sp_dpc_enabled) { -tasklet_disable (p_hwfn->sp_dpc); +tasklet_disable (&p_hwfn->sp_dpc); p_hwfn->b_sp_dpc_enabled = false;DP_VERBOSE (cdev,NETIF_MSG_IFDOWN ,"Disabled sp tasklet [hwfn %d] at %p\n" , - i, p_hwfn->sp_dpc); + i, &p_hwfn->sp_dpc); } }
Signature · 1 line
2.25.1
PATCH v2 19/20 ethernet: silan: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/silan/sc92031.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/ethernet/silan/sc92031.c +6 -5
@@ -829,10 +829,11 @@ static void _sc92031_link_tasklet(struct net_device *dev) } } -static void sc92031_tasklet (unsigned long data) +static void sc92031_tasklet (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *)data; -struct sc92031_priv *priv =netdev_priv (dev); +struct sc92031_priv *priv =from_tasklet (priv, t, tasklet); +struct net_device *dev = (struct net_device *)((char *)priv - +ALIGN (sizeof (struct net_device ),NETDEV_ALIGN ));void __iomem *port_base = priv->port_base;u32 intr_status, intr_mask;
@@ -1108,7 +1109,7 @@ static void sc92031_poll_controller(struct net_device *dev)disable_irq (irq);if (sc92031_interrupt (irq, dev) !=IRQ_NONE ) -sc92031_tasklet ((unsigned long )dev); +sc92031_tasklet (&priv->tasklet); enable_irq(irq); }#endif
@@ -1446,7 +1447,7 @@ static int sc92031_probe(struct pci_dev *pdev, const struct pci_device_id *id)spin_lock_init (&priv->lock); priv->port_base = port_base; priv->pdev = pdev; -tasklet_init (&priv->tasklet, sc92031_tasklet, (unsigned long )dev); +tasklet_setup (&priv->tasklet, sc92031_tasklet);/* Fudge tasklet count so the call to sc92031_enable_interrupts at * sc92031_open will work correctly */ tasklet_disable_nosync (&priv->tasklet);
Signature · 1 line
2.25.1
PATCH v2 20/20 ethernet: smsc: convert tasklets to use new tasklet_setup() API
In reply to Allen PaisIn 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.
--- drivers/net/ethernet/smsc/smc91x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/smsc/smc91x.c +5 -5
@@ -535,10 +535,10 @@ static inline void smc_rcv(struct net_device *dev)/* * This is called to actually send a packet to the chip. */ -static void smc_hardware_send_pkt (unsigned long data) +static void smc_hardware_send_pkt (struct tasklet_struct *t) { -struct net_device *dev = (struct net_device *)data; -struct smc_local *lp =netdev_priv (dev); +struct smc_local *lp =from_tasklet (lp, t, tx_task); +struct net_device *dev = lp->dev;void __iomem *ioaddr = lp->base;struct sk_buff *skb;unsigned int packet_no, len;
@@ -688,7 +688,7 @@ smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)* Allocation succeeded: push packet to the chip's own memory * immediately. */ -smc_hardware_send_pkt ((unsigned long )dev); +smc_hardware_send_pkt (&lp->tx_task); }return NETDEV_TX_OK ;
@@ -1965,7 +1965,7 @@ static int smc_probe(struct net_device *dev, void __iomem *ioaddr, dev->netdev_ops = &smc_netdev_ops; dev->ethtool_ops = &smc_ethtool_ops; -tasklet_init (&lp->tx_task, smc_hardware_send_pkt, (unsigned long )dev); +tasklet_setup (&lp->tx_task, smc_hardware_send_pkt);INIT_WORK (&lp->phy_configure, smc_phy_configure); lp->dev = dev; lp->mii.phy_id_mask =0x1f ;
Signature · 1 line
2.25.1