net: ethernet: ti: am65-cpsw: add sw tx/rx irq coalescing based on hrtimers
authorGrygorii Strashko <grygorii.strashko@ti.com>
Tue, 19 Dec 2023 10:58:05 +0000 (12:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Dec 2023 01:01:19 +0000 (01:01 +0000)
commite4918f9d48823ea184534848d32a61a4fc02753f
tree8349f515f59cdef643b9870681de548ad7327ac5
parent49a2eb90682469a7b171be79b2939e26091ce221
net: ethernet: ti: am65-cpsw: add sw tx/rx irq coalescing based on hrtimers

Add SW IRQ coalescing based on hrtimers for TX and RX data path which
can be enabled by ethtool commands:

- RX coalescing
  ethtool -C eth1 rx-usecs 50

- TX coalescing can be enabled per TX queue

  - by default enables coalesing for TX0
  ethtool -C eth1 tx-usecs 50
  - configure TX0
  ethtool -Q eth0 queue_mask 1 --coalesce tx-usecs 100
  - configure TX1
  ethtool -Q eth0 queue_mask 2 --coalesce tx-usecs 100
  - configure TX0 and TX1
  ethtool -Q eth0 queue_mask 3 --coalesce tx-usecs 100 --coalesce tx-usecs 100

  show configuration for TX0 and TX1:
  ethtool -Q eth0 queue_mask 3 --show-coalesce

Comparing to gro_flush_timeout and napi_defer_hard_irqs, this patch
allows to enable IRQ coalesing for RX path separately.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/am65-cpsw-ethtool.c
drivers/net/ethernet/ti/am65-cpsw-nuss.c
drivers/net/ethernet/ti/am65-cpsw-nuss.h