Skip to contentSkip to conversation

use napi_schedule_irqoff()

PATCH In review Alexander Duyck 3 participants 6 messages Sep 29, 2015 – Oct 27, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover use napi_schedule_irqoff()

This patch set is meant to replace the calls to napi_schedule with napi_schedule_irqoff as this should help to reduce the interrupt overhead slightly by removing the unneeded call to local_irq_save and local_irq_restore.

---

Alexander Duyck (3):
ixgbe/ixgbevf: use napi_schedule_irqoff()
i40e/i40evf: use napi_schedule_irqoff()
fm10k: use napi_schedule_irqoff()

 drivers/net/ethernet/intel/fm10k/fm10k_pci.c      |    2 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c       |    6 ++++--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c   |    2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c     |    4 ++--
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |    2 +-
 5 files changed, 9 insertions(+), 7 deletions(-)

--

#1 lore raw

PATCH 1/3 ixgbe/ixgbevf: use napi_schedule_irqoff()

The ixgbe_intr and ixgbe/ixgbevf_msix_clean_rings functions run from hard interrupt context or with interrupts already disabled in netpoll.

They can use napi_schedule_irqoff() instead of napi_schedule()

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c     |    4 ++--
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +2 -2
index 693f2da33569..67dc916c94d6 100644
@@ -2754,7 +2754,7 @@ static irqreturn_t ixgbe_msix_clean_rings(int irq, void *data)
 	/* EIAM disabled interrupts (on this vector) for us */
 
 	if (q_vector->rx.ring || q_vector->tx.ring)
-		napi_schedule(&q_vector->napi);
+		napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
@@ -2948,7 +2948,7 @@ static irqreturn_t ixgbe_intr(int irq, void *data)
 		ixgbe_ptp_check_pps_event(adapter, eicr);
 
 	/* would disable interrupts here but EIAM disabled it */
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	/*
 	 * re-enable link(maybe) and non-queue interrupts, no flush.
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +1 -1
index 592ff237d692..f1c5f3372667 100644
@@ -1288,7 +1288,7 @@ static irqreturn_t ixgbevf_msix_clean_rings(int irq, void *data)
 
 	/* EIAM disabled interrupts (on this vector) for us */
 	if (q_vector->rx.ring || q_vector->tx.ring)
-		napi_schedule(&q_vector->napi);
+		napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
#2 lore raw

PATCH 2/3 i40e/i40evf: use napi_schedule_irqoff()

In reply to Alexander Duyck

The i40e_intr and i40e/i40evf_msix_clean_rings functions run from hard interrupt context or with interrupts already disabled in netpoll.

They can use napi_schedule_irqoff() instead of napi_schedule()

---
 drivers/net/ethernet/intel/i40e/i40e_main.c     |    6 ++++--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +4 -2
index 484226e0365d..3cc97d4f5f70 100644
@@ -3281,7 +3281,7 @@ static irqreturn_t i40e_msix_clean_rings(int irq, void *data)
 	if (!q_vector->tx.ring && !q_vector->rx.ring)
 		return IRQ_HANDLED;
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
@@ -3450,6 +3450,8 @@ static irqreturn_t i40e_intr(int irq, void *data)
 
 	/* only q0 is used in MSI/Legacy mode, and none are used in MSIX */
 	if (icr0 & I40E_PFINT_ICR0_QUEUE_0_MASK) {
+		struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
+		struct i40e_q_vector *q_vector = vsi->q_vectors[0];
 
 		/* temporarily disable queue cause for NAPI processing */
 		u32 qval = rd32(hw, I40E_QINT_RQCTL(0));
@@ -3462,7 +3464,7 @@ static irqreturn_t i40e_intr(int irq, void *data)
 		wr32(hw, I40E_QINT_TQCTL(0), qval);
 
 		if (!test_bit(__I40E_DOWN, &pf->state))
-			napi_schedule(&pf->vsi[pf->lan_vsi]->q_vectors[0]->napi);
+			napi_schedule_irqoff(&q_vector->napi);
 	}
 
 	if (icr0 & I40E_PFINT_ICR0_ADMINQ_MASK) {
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -1
index 5e1336321c2f..4b3db099f58c 100644
@@ -334,7 +334,7 @@ static irqreturn_t i40evf_msix_clean_rings(int irq, void *data)
 	if (!q_vector->tx.ring && !q_vector->rx.ring)
 		return IRQ_HANDLED;
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
#3 lore raw

PATCH 2/3 i40e/i40evf: use napi_schedule_irqoff()

Quoted 11 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Alexander Duyck
Sent: Tuesday, September 29, 2015 3:20 PM
To: netdev at vger.kernel.org; intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH 2/3] i40e/i40evf: use napi_schedule_irqoff()

The i40e_intr and i40e/i40evf_msix_clean_rings functions run from hard interrupt context or with interrupts already disabled in netpoll.

Quoted 7 lines

They can use napi_schedule_irqoff() instead of napi_schedule()

---
 drivers/net/ethernet/intel/i40e/i40e_main.c     |    6 ++++--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

Patch code changes correctly applied

#4 lore raw

PATCH 3/3 fm10k: use napi_schedule_irqoff()

In reply to Alexander Duyck

The fm10k_msix_clean_rings function runs from hard interrupt context or with interrupts already disabled in netpoll.

It can use napi_schedule_irqoff() instead of napi_schedule()

---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/fm10k/fm10k_pci.c +1 -1
index 74be792f3f1b..5fbffbaefe32 100644
@@ -846,7 +846,7 @@ static irqreturn_t fm10k_msix_clean_rings(int __always_unused irq, void *data)
 	struct fm10k_q_vector *q_vector = data;
 
 	if (q_vector->rx.count || q_vector->tx.count)
-		napi_schedule(&q_vector->napi);
+		napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
Tested-by on v1 3/3
#5 lore raw

RE: [Intel-wired-lan] [PATCH 3/3] fm10k: use napi_schedule_irqoff()

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Alexander Duyck
Sent: Tuesday, September 29, 2015 3:20 PM
To: [email protected]; intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH 3/3] fm10k: use napi_schedule_irqoff()

The fm10k_msix_clean_rings function runs from hard interrupt context or with interrupts already disabled in netpoll.

It can use napi_schedule_irqoff() instead of napi_schedule()

---