Skip to contentSkip to conversation

atl1c: move tx cleanup processing out of interrupt

PATCH Superseded Gatis Peisenieks 1 participant 1 message Apr 7, 2021

Subsystems (3)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 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.

---
Reposting for net-next as requested by David Miller,

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

Signature · 1 line
2.31.1