Skip to content

Commit f8cde5a

Browse files
committed
e1000e: Link NAPI instances to queues and IRQs
Author: 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 IRQs assigned to my NIC: $ cat /proc/interrupts | grep ens | cut -f1 --delimiter=':' 50 51 52 While e1000e allocates 3 IRQs (RX, TX, and other), it looks like e1000e only has a single NAPI, so I've associated the NAPI with the RX IRQ (50 on my system, seen above). Note the output from the cli: $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \ --dump napi-get --json='{"ifindex": 2}' [{'id': 145, 'ifindex': 2, 'irq': 50}] 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': 145, 'type': 'rx'}, {'id': 0, 'ifindex': 2, 'napi-id': 145, 'type': 'tx'}] Signed-off-by: Joe Damato <jdamato@fastly.com> Reviewed-by: Simon Horman <horms@kernel.org> Acked-by: Vitaly Lifshits <vitaly.lifshits@intel.com> Tested-by: Avigail Dahan <avigailx.dahan@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> (cherry picked from commit c6b8cd6) JIRA: https://issues.redhat.com/browse/RHEL-99399 Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
1 parent ca2741b commit f8cde5a

File tree

1 file changed

+11
-0
lines changed
  • drivers/net/ethernet/intel/e1000e

1 file changed

+11
-0
lines changed

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4607,6 +4607,7 @@ int e1000e_open(struct net_device *netdev)
46074607
struct e1000_hw *hw = &adapter->hw;
46084608
struct pci_dev *pdev = adapter->pdev;
46094609
int err;
4610+
int irq;
46104611

46114612
/* disallow open during test */
46124613
if (test_bit(__E1000_TESTING, &adapter->state))
@@ -4670,7 +4671,15 @@ int e1000e_open(struct net_device *netdev)
46704671
/* From here on the code is the same as e1000e_up() */
46714672
clear_bit(__E1000_DOWN, &adapter->state);
46724673

4674+
if (adapter->int_mode == E1000E_INT_MODE_MSIX)
4675+
irq = adapter->msix_entries[0].vector;
4676+
else
4677+
irq = adapter->pdev->irq;
4678+
4679+
netif_napi_set_irq(&adapter->napi, irq);
46734680
napi_enable(&adapter->napi);
4681+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, &adapter->napi);
4682+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, &adapter->napi);
46744683

46754684
e1000_irq_enable(adapter);
46764685

@@ -4729,6 +4738,8 @@ int e1000e_close(struct net_device *netdev)
47294738
netdev_info(netdev, "NIC Link is Down\n");
47304739
}
47314740

4741+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, NULL);
4742+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, NULL);
47324743
napi_disable(&adapter->napi);
47334744

47344745
e1000e_free_tx_resources(adapter->tx_ring);

0 commit comments

Comments
 (0)