Skip to contentSkip to conversation

net/i40e: remove VF interrupt handler

PATCH In review Qi Zhang 2 participants 3 messages Jun 27, 2018 – Jun 29, 2018 Network drivers

lore
Share & tools
lore

Qi Zhang

author
#0 lore raw

PATCH v3 1/1 net/i40e: remove VF interrupt handler

For i40evf, internal rx interrupt and adminq interrupt share the same source, that cause a lot cpu cycles be wasted on interrupt handler on rx path. This is complained by customers which require low latency (when set I40E_ITR_INTERVAL to small value), but have to be sufferred by tremendous interrupts handling that eat significant CPU resources.

The patch disable pci interrupt and remove the interrupt handler, replace it with a low frequency (50ms) interrupt polling daemon which is implemented by registering a alarm callback periodly, this save CPU time significently: On a typical x86 server with 2.1GHz CPU, with low latency configure (32us) we saw CPU usage from top commmand reduced from 20% to 0% on management core in testpmd).

Also with the new method we can remove compile option: I40E_ITR_INTERVAL which is used to balance between low latency and low CPU usage previously. Now we don't need it since we can reach both at same time.

---

v3:
- update doc
- update comment in i40evf_dev_start.

v2:
- update doc

 config/common_base                |  2 --
 doc/guides/nics/i40e.rst          | 15 -------------
 drivers/net/i40e/i40e_ethdev.c    |  3 +--
 drivers/net/i40e/i40e_ethdev.h    | 22 ++++++++++----------
 drivers/net/i40e/i40e_ethdev_vf.c | 44 +++++++++++++--------------------------
 5 files changed, 27 insertions(+), 59 deletions(-)
config/common_base +0 -2
index fcf3a1f6f..d3f91dfe0 100644
@@ -264,8 +264,6 @@ CONFIG_RTE_LIBRTE_I40E_INC_VECTOR=y
 CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n
 CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_PF=64
 CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM=4
-# interval up to 8160 us, aligned to 2 (or default value)
-CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1
 
 #
 # Compile burst-oriented FM10K PMD
doc/guides/nics/i40e.rst +0 -15
index 18549bf5a..d5b02c95f 100644
@@ -96,11 +96,6 @@ Please note that enabling debugging options may affect system performance.
 
   Number of queues reserved for each VMDQ Pool.
 
-- ``CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL`` (default ``-1``)
-
-  Interrupt Throttling interval.
-
-
 Runtime Config Options
 ~~~~~~~~~~~~~~~~~~~~~~
 
@@ -595,16 +590,6 @@ Use 16 Bytes RX Descriptor Size
 As i40e PMD supports both 16 and 32 bytes RX descriptor sizes, and 16 bytes size can provide helps to high performance of small packets.
 Configuration of ``CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC`` in config files can be changed to use 16 bytes size RX descriptors.
 
-High Performance and per Packet Latency Tradeoff
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Due to the hardware design, the interrupt signal inside NIC is needed for per
-packet descriptor write-back. The minimum interval of interrupts could be set
-at compile time by ``CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL`` in configuration files.
-Though there is a default configuration, the interval could be tuned by the
-users with that configuration item depends on what the user cares about more,
-performance or per packet latency.
-
 Example of getting best performance with l3fwd example
 ------------------------------------------------------
 
drivers/net/i40e/i40e_ethdev.c +1 -2
index e06e0a20b..c47b9f5f7 100644
@@ -1833,8 +1833,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect,
 	/* Write first RX queue to Link list register as the head element */
 	if (vsi->type != I40E_VSI_SRIOV) {
 		uint16_t interval =
-			i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL, 1,
-					       pf->support_multi_driver);
+			i40e_calc_itr_interval(1, pf->support_multi_driver);
 
 		if (msix_vect == I40E_MISC_VEC_ID) {
 			I40E_WRITE_REG(hw, I40E_PFINT_LNKLST0,
drivers/net/i40e/i40e_ethdev.h +11 -11
index 79bfc67fc..cb5e5b5d8 100644
@@ -184,7 +184,7 @@ enum i40e_flxpld_layer_idx {
 #define I40E_ITR_INDEX_NONE             3
 #define I40E_QUEUE_ITR_INTERVAL_DEFAULT 32 /* 32 us */
 #define I40E_QUEUE_ITR_INTERVAL_MAX     8160 /* 8160 us */
-#define I40E_VF_QUEUE_ITR_INTERVAL_DEFAULT 8160 /* 8160 us */
+#define I40E_VF_QUEUE_ITR_INTERVAL_DEFAULT 32 /* 32 us */
 /* Special FW support this floating VEB feature */
 #define FLOATING_VEB_SUPPORTED_FW_MAJ 5
 #define FLOATING_VEB_SUPPORTED_FW_MIN 0
@@ -1318,17 +1318,17 @@ i40e_align_floor(int n)
 }
 
 static inline uint16_t
-i40e_calc_itr_interval(int16_t interval, bool is_pf, bool is_multi_drv)
+i40e_calc_itr_interval(bool is_pf, bool is_multi_drv)
 {
-	if (interval < 0 || interval > I40E_QUEUE_ITR_INTERVAL_MAX) {
-		if (is_multi_drv) {
-			interval = I40E_QUEUE_ITR_INTERVAL_MAX;
-		} else {
-			if (is_pf)
-				interval = I40E_QUEUE_ITR_INTERVAL_DEFAULT;
-			else
-				interval = I40E_VF_QUEUE_ITR_INTERVAL_DEFAULT;
-		}
+	uint16_t interval = 0;
+
+	if (is_multi_drv) {
+		interval = I40E_QUEUE_ITR_INTERVAL_MAX;
+	} else {
+		if (is_pf)
+			interval = I40E_QUEUE_ITR_INTERVAL_DEFAULT;
+		else
+			interval = I40E_VF_QUEUE_ITR_INTERVAL_DEFAULT;
 	}
 
 	/* Convert to hardware count, as writing each 1 represents 2 us */
drivers/net/i40e/i40e_ethdev_vf.c +15 -29

112 lines not on this page · raw message

Signature · 1 line
2.13.6
Acked-by on v3 1/1
#1 lore raw
Quoted 23 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Wednesday, June 27, 2018 9:15 PM
To: Xing, Beilei <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Yu, De <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Subject: [PATCH v3] net/i40e: remove VF interrupt handler

For i40evf, internal rx interrupt and adminq interrupt share the same source, that cause a lot cpu cycles be wasted on interrupt handler on rx path. This is complained by customers which require low latency (when set I40E_ITR_INTERVAL to small value), but have to be sufferred by tremendous interrupts handling that eat significant CPU resources.

The patch disable pci interrupt and remove the interrupt handler, replace it with a low frequency (50ms) interrupt polling daemon which is implemented by registering a alarm callback periodly, this save CPU time significently: On a typical x86 server with 2.1GHz CPU, with low latency configure (32us) we saw CPU usage from top commmand reduced from 20% to 0% on management core in testpmd).

Quoted 7 lines

Also with the new method we can remove compile option:
I40E_ITR_INTERVAL which is used to balance between low latency and low CPU usage previously.
Now we don't need it since we can reach both at same time.

author Applied
#2 lore raw
Quoted 38 lines

-----Original Message-----
From: Xing, Beilei
Sent: Thursday, June 28, 2018 9:46 AM
To: Zhang, Qi Z <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Yu, De <[email protected]>; [email protected]
Subject: RE: [PATCH v3] net/i40e: remove VF interrupt handler

Quoted 26 lines

-----Original Message-----
From: Zhang, Qi Z
Sent: Wednesday, June 27, 2018 9:15 PM
To: Xing, Beilei <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Yu, De <[email protected]>; [email protected]; Zhang, Qi Z <[email protected]>
Subject: [PATCH v3] net/i40e: remove VF interrupt handler

For i40evf, internal rx interrupt and adminq interrupt share the same source, that cause a lot cpu cycles be wasted on interrupt handler on rx path. This is complained by customers which require low latency (when set I40E_ITR_INTERVAL to small value), but have to be sufferred by tremendous interrupts handling that eat significant CPU resources.

The patch disable pci interrupt and remove the interrupt handler, replace it with a low frequency (50ms) interrupt polling daemon which is implemented by registering a alarm callback periodly, this save CPU time significently: On a typical x86 server with 2.1GHz CPU, with low latency configure (32us) we saw CPU usage from top commmand reduced from 20% to 0% on management core in testpmd).

Also with the new method we can remove compile option:
I40E_ITR_INTERVAL which is used to balance between low latency and low CPU usage previously.
Now we don't need it since we can reach both at same time.

Quoted 4 lines
Quoted 2 lines

Applied to dpdk-next-net-intel.

Thanks!
Qi