netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, netdev@vger.kernel.org
Cc: Joe Damato <jdamato@fastly.com>,
	anthony.l.nguyen@intel.com, Simon Horman <horms@kernel.org>
Subject: [PATCH net-next 12/12] e1000: Link NAPI instances to queues and IRQs
Date: Tue,  8 Oct 2024 16:34:38 -0700	[thread overview]
Message-ID: <20241008233441.928802-13-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20241008233441.928802-1-anthony.l.nguyen@intel.com>

From: Joe Damato <jdamato@fastly.com>

Add support for netdev-genl, allowing users to query IRQ, NAPI, and queue
information.

After this patch is applied, note the IRQ assigned to my NIC:

$ cat /proc/interrupts | grep enp0s8 | cut -f1 --delimiter=':'
 18

Note the output from the cli:

$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
                         --dump napi-get --json='{"ifindex": 2}'
[{'id': 513, 'ifindex': 2, 'irq': 18}]

This device supports only 1 rx and 1 tx queue, so querying that:

$ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
                         --dump queue-get --json='{"ifindex": 2}'
[{'id': 0, 'ifindex': 2, 'napi-id': 513, 'type': 'rx'},
 {'id': 0, 'ifindex': 2, 'napi-id': 513, 'type': 'tx'}]

Signed-off-by: Joe Damato <jdamato@fastly.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/e1000/e1000_main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index ab7ae418d294..4de9b156b2be 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -513,6 +513,8 @@ void e1000_down(struct e1000_adapter *adapter)
 	 */
 	netif_carrier_off(netdev);
 
+	netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, NULL);
+	netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, NULL);
 	napi_disable(&adapter->napi);
 
 	e1000_irq_disable(adapter);
@@ -1392,7 +1394,10 @@ int e1000_open(struct net_device *netdev)
 	/* From here on the code is the same as e1000_up() */
 	clear_bit(__E1000_DOWN, &adapter->flags);
 
+	netif_napi_set_irq(&adapter->napi, adapter->pdev->irq);
 	napi_enable(&adapter->napi);
+	netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, &adapter->napi);
+	netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, &adapter->napi);
 
 	e1000_irq_enable(adapter);
 
-- 
2.42.0


  parent reply	other threads:[~2024-10-08 23:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 23:34 [PATCH net-next 00/12][pull request] Intel Wired LAN Driver Updates 2024-10-08 (ice, iavf, igb, e1000e, e1000) Tony Nguyen
2024-10-08 23:34 ` [PATCH net-next 01/12] ice: Implement ethtool reset support Tony Nguyen
2024-10-08 23:34 ` [PATCH net-next 02/12] ice: add E830 HW VF mailbox message limit support Tony Nguyen
2024-10-08 23:34 ` [PATCH net-next 03/12] ice: consistently use q_idx in ice_vc_cfg_qs_msg() Tony Nguyen
2024-10-08 23:34 ` [PATCH net-next 04/12] ice: store max_frame and rx_buf_len only in ice_rx_ring Tony Nguyen
2024-10-08 23:34 ` [PATCH net-next 05/12] ice: Make use of assign_bit() API Tony Nguyen
2024-10-08 23:34 ` [PATCH net-next 06/12] ice: Use common error handling code in two functions Tony Nguyen
2024-10-09  2:23   ` Kalesh Anakkur Purayil
2024-10-08 23:34 ` [PATCH net-next 07/12] ice: Cleanup unused declarations Tony Nguyen
2024-10-09  2:22   ` Kalesh Anakkur Purayil
2024-10-08 23:34 ` [PATCH net-next 08/12] iavf: Remove " Tony Nguyen
2024-10-09  2:23   ` Kalesh Anakkur Purayil
2024-10-08 23:34 ` [PATCH net-next 09/12] igb: Cleanup " Tony Nguyen
2024-10-09  2:22   ` Kalesh Anakkur Purayil
2024-10-08 23:34 ` [PATCH net-next 10/12] e1000e: Remove duplicated writel() in e1000_configure_tx/rx() Tony Nguyen
2024-10-08 23:34 ` [PATCH net-next 11/12] e1000e: Link NAPI instances to queues and IRQs Tony Nguyen
2024-10-08 23:34 ` Tony Nguyen [this message]
2024-10-10  3:10 ` [PATCH net-next 00/12][pull request] Intel Wired LAN Driver Updates 2024-10-08 (ice, iavf, igb, e1000e, e1000) patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241008233441.928802-13-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).