netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 net-next] net: ena: Support persistent per-NAPI config.
@ 2025-04-07 16:47 Kuniyuki Iwashima
  2025-04-07 18:09 ` Joe Damato
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kuniyuki Iwashima @ 2025-04-07 16:47 UTC (permalink / raw)
  To: Shay Agroskin, Arthur Kiyanovski, David Arinzon, Saeed Bishara,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Joe Damato, Kuniyuki Iwashima, Kuniyuki Iwashima, netdev

Let's pass the queue index to netif_napi_add_config() to preserve
per-NAPI config.

Test:

Set 100 to defer-hard-irqs (default is 0) and check the value after
link down & up.

  $ cat /sys/class/net/enp39s0/napi_defer_hard_irqs
  0

  $ ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
    --dump napi-get --json='{"ifindex": 2}'
  [{'defer-hard-irqs': 0,
    'gro-flush-timeout': 0,
    'id': 65,
    'ifindex': 2,
    'irq': 29,
    'irq-suspend-timeout': 0}]

  $ sudo ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
    --do napi-set --json='{"id": 65, "defer-hard-irqs": 100}'

  $ sudo ip link set enp39s0 down && sudo ip link set enp39s0 up

Without patch:

  $ ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
    --dump napi-get --json='{"ifindex": 2}'
  [{'defer-hard-irqs': 0,  <------------------- Reset to 0
    'gro-flush-timeout': 0,
    'id': 66,  <------------------------------- New ID
    'ifindex': 2,
    'irq': 29,
    'irq-suspend-timeout': 0}]

With patch:

  $ ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
    --dump napi-get --json='{"ifindex": 2}'
  [{'defer-hard-irqs': 100,  <--------------+-- Preserved
    'gro-flush-timeout': 0,                 |
    'id': 65,  <----------------------------'
    'ifindex': 2,
    'irq': 29,
    'irq-suspend-timeout': 0}]

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 70fa3adb4934..aa4a17edd98f 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -1777,7 +1777,7 @@ static void ena_init_napi_in_range(struct ena_adapter *adapter,
 		if (ENA_IS_XDP_INDEX(adapter, i))
 			napi_handler = ena_xdp_io_poll;
 
-		netif_napi_add(adapter->netdev, &napi->napi, napi_handler);
+		netif_napi_add_config(adapter->netdev, &napi->napi, napi_handler, i);
 
 		if (!ENA_IS_XDP_INDEX(adapter, i))
 			napi->rx_ring = rx_ring;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-08 20:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07 16:47 [PATCH v1 net-next] net: ena: Support persistent per-NAPI config Kuniyuki Iwashima
2025-04-07 18:09 ` Joe Damato
2025-04-07 20:17 ` Kiyanovski, Arthur
2025-04-08 20:08 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).