Skip to content

Commit b7074e4

Browse files
committed
Merge branch 'gve-link-irqs-queues-and-napi-instances'
Joe Damato says: ==================== gve: Link IRQs, queues, and NAPI instances This series uses the netdev-genl API to link IRQs and queues to NAPI IDs so that this information is queryable by user apps. This is particularly useful for epoll-based busy polling apps which rely on having access to the NAPI ID. I've tested these commits on a GCP instance with a GVE NIC configured and have included test output in the commit messages for each patch showing how to query the information. [1]: https://lore.kernel.org/netdev/[email protected]/ ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents d772cc2 + 021f9e6 commit b7074e4

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

drivers/net/ethernet/google/gve/gve_main.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,11 @@ static void gve_turndown(struct gve_priv *priv)
18751875

18761876
if (!gve_tx_was_added_to_block(priv, idx))
18771877
continue;
1878+
1879+
if (idx < priv->tx_cfg.num_queues)
1880+
netif_queue_set_napi(priv->dev, idx,
1881+
NETDEV_QUEUE_TYPE_TX, NULL);
1882+
18781883
napi_disable(&block->napi);
18791884
}
18801885
for (idx = 0; idx < priv->rx_cfg.num_queues; idx++) {
@@ -1883,6 +1888,9 @@ static void gve_turndown(struct gve_priv *priv)
18831888

18841889
if (!gve_rx_was_added_to_block(priv, idx))
18851890
continue;
1891+
1892+
netif_queue_set_napi(priv->dev, idx, NETDEV_QUEUE_TYPE_RX,
1893+
NULL);
18861894
napi_disable(&block->napi);
18871895
}
18881896

@@ -1909,6 +1917,12 @@ static void gve_turnup(struct gve_priv *priv)
19091917
continue;
19101918

19111919
napi_enable(&block->napi);
1920+
1921+
if (idx < priv->tx_cfg.num_queues)
1922+
netif_queue_set_napi(priv->dev, idx,
1923+
NETDEV_QUEUE_TYPE_TX,
1924+
&block->napi);
1925+
19121926
if (gve_is_gqi(priv)) {
19131927
iowrite32be(0, gve_irq_doorbell(priv, block));
19141928
} else {
@@ -1931,6 +1945,9 @@ static void gve_turnup(struct gve_priv *priv)
19311945
continue;
19321946

19331947
napi_enable(&block->napi);
1948+
netif_queue_set_napi(priv->dev, idx, NETDEV_QUEUE_TYPE_RX,
1949+
&block->napi);
1950+
19341951
if (gve_is_gqi(priv)) {
19351952
iowrite32be(0, gve_irq_doorbell(priv, block));
19361953
} else {

drivers/net/ethernet/google/gve/gve_utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ void gve_add_napi(struct gve_priv *priv, int ntfy_idx,
111111
struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx];
112112

113113
netif_napi_add(priv->dev, &block->napi, gve_poll);
114+
netif_napi_set_irq(&block->napi, block->irq);
114115
}
115116

116117
void gve_remove_napi(struct gve_priv *priv, int ntfy_idx)

0 commit comments

Comments
 (0)