Skip to content

Commit 8f7ff18

Browse files
jdamato-fslyanguy11
authored andcommitted
e1000: Link NAPI instances to queues and IRQs
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>
1 parent c6b8cd6 commit 8f7ff18

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/intel/e1000/e1000_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,8 @@ void e1000_down(struct e1000_adapter *adapter)
513513
*/
514514
netif_carrier_off(netdev);
515515

516+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, NULL);
517+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, NULL);
516518
napi_disable(&adapter->napi);
517519

518520
e1000_irq_disable(adapter);
@@ -1392,7 +1394,10 @@ int e1000_open(struct net_device *netdev)
13921394
/* From here on the code is the same as e1000_up() */
13931395
clear_bit(__E1000_DOWN, &adapter->flags);
13941396

1397+
netif_napi_set_irq(&adapter->napi, adapter->pdev->irq);
13951398
napi_enable(&adapter->napi);
1399+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, &adapter->napi);
1400+
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, &adapter->napi);
13961401

13971402
e1000_irq_enable(adapter);
13981403

0 commit comments

Comments
 (0)