Commit dfe4e612 authored by Allen Pais's avatar Allen Pais Committed by David S. Miller
Browse files

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

Signed-off-by: default avatarRomain Perier <romain.perier@gmail.com>
Signed-off-by: default avatarAllen Pais <apais@linux.microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e7412b83
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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;
}
+1 −0
Original line number Diff line number Diff line
@@ -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
+4 −4
Original line number Diff line number Diff line
@@ -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;

+4 −6
Original line number Diff line number Diff line
@@ -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 */
+2 −2
Original line number Diff line number Diff line
@@ -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) {
Loading