Skip to contentSkip to conversation

atl1c: move tx cleanup processing out of interrupt

PATCH Applied Gatis Peisenieks 2 participants 2 messages Apr 14, 2021 – Apr 16, 2021

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

PATCH v6 1/1 atl1c: move tx cleanup processing out of interrupt

Tx queue cleanup happens in interrupt handler on same core as rx queue processing. Both can take considerable amount of processing in high packet-per-second scenarios.

Sending big amounts of packets can stall the rx processing which is unfair and also can lead to out-of-memory condition since __dev_kfree_skb_irq queues the skbs for later kfree in softirq which is not allowed to happen with heavy load in interrupt handler.

This puts tx cleanup in its own napi and enables threaded napi to allow the rx/tx queue processing to happen on different cores.

The ability to sustain equal amounts of tx/rx traffic increased:
from 280Kpps to 1130Kpps on Threadripper 3960X with upcoming Mikrotik 10/25G NIC,
from 520Kpps to 850Kpps on Intel i3-3320 with Mikrotik RB44Ge adapter.

---
v6:
- sent with git send-email
v5:
- EXPORT_SYMBOL(dev_set_threaded) not needed, already there
v4:
- made scripts/checkpatch.pl happy
- moved the new intr_mask_lock to be besides the intr_mask it protects so they are more likely to be on same cacheline
v3:
- addressed comments from Eric Dumazet
- added EXPORT_SYMBOL for dev_set_threaded

 drivers/net/ethernet/atheros/atl1c/atl1c.h    |  2 +
 .../net/ethernet/atheros/atl1c/atl1c_main.c   | 44 ++++++++++++++-----
 2 files changed, 36 insertions(+), 10 deletions(-)
drivers/net/ethernet/atheros/atl1c/atl1c.h +2 -0
index a0562a90fb6d..28ae5c16831e 100644
@@ -367,6 +367,7 @@ struct atl1c_hw {
 	u16 phy_id1;
 	u16 phy_id2;
 
+	spinlock_t intr_mask_lock;	/* protect the intr_mask */
 	u32 intr_mask;
 
 	u8 preamble_len;
@@ -506,6 +507,7 @@ struct atl1c_adapter {
 	struct net_device   *netdev;
 	struct pci_dev      *pdev;
 	struct napi_struct  napi;
+	struct napi_struct  tx_napi;
 	struct page         *rx_page;
 	unsigned int	    rx_page_offset;
 	unsigned int	    rx_frag_size;
drivers/net/ethernet/atheros/atl1c/atl1c_main.c +34 -10

113 lines not on this page · raw message

base-commit: 5871d0c6b8ea805916c3135d0c53b095315bc674

Signature · 1 line
2.31.1
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 10 lines · On Wed, 14 Apr 2021 22:09:20 +0300 you wrote:

Tx queue cleanup happens in interrupt handler on same core as rx queue processing. Both can take considerable amount of processing in high packet-per-second scenarios.

Sending big amounts of packets can stall the rx processing which is unfair and also can lead to out-of-memory condition since __dev_kfree_skb_irq queues the skbs for later kfree in softirq which is not allowed to happen with heavy load in interrupt handler.

[...]

Here is the summary with links:
- [net-next,v6] atl1c: move tx cleanup processing out of interrupt

    https://git.kernel.org/netdev/net-next/c/a1150a04b7e8

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html