Skip to content

Commit 5abc37b

Browse files
shailend-gdavem330
authored andcommitted
gve: Make gve_turn(up|down) ignore stopped queues
Currently the queues are either all live or all dead, toggling from one state to the other via the ndo open and stop hooks. The future addition of single-queue ndo hooks changes this, and thus gve_turnup and gve_turndown should evolve to account for a state where some queues are live and some aren't. Tested-by: Mina Almasry <almasrymina@google.com> Reviewed-by: Praveen Kaligineedi <pkaligineedi@google.com> Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com> Signed-off-by: Shailend Chand <shailend@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 242f30f commit 5abc37b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,12 +1937,16 @@ static void gve_turndown(struct gve_priv *priv)
19371937
int ntfy_idx = gve_tx_idx_to_ntfy(priv, idx);
19381938
struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx];
19391939

1940+
if (!gve_tx_was_added_to_block(priv, idx))
1941+
continue;
19401942
napi_disable(&block->napi);
19411943
}
19421944
for (idx = 0; idx < priv->rx_cfg.num_queues; idx++) {
19431945
int ntfy_idx = gve_rx_idx_to_ntfy(priv, idx);
19441946
struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx];
19451947

1948+
if (!gve_rx_was_added_to_block(priv, idx))
1949+
continue;
19461950
napi_disable(&block->napi);
19471951
}
19481952

@@ -1965,6 +1969,9 @@ static void gve_turnup(struct gve_priv *priv)
19651969
int ntfy_idx = gve_tx_idx_to_ntfy(priv, idx);
19661970
struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx];
19671971

1972+
if (!gve_tx_was_added_to_block(priv, idx))
1973+
continue;
1974+
19681975
napi_enable(&block->napi);
19691976
if (gve_is_gqi(priv)) {
19701977
iowrite32be(0, gve_irq_doorbell(priv, block));
@@ -1977,6 +1984,9 @@ static void gve_turnup(struct gve_priv *priv)
19771984
int ntfy_idx = gve_rx_idx_to_ntfy(priv, idx);
19781985
struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx];
19791986

1987+
if (!gve_rx_was_added_to_block(priv, idx))
1988+
continue;
1989+
19801990
napi_enable(&block->napi);
19811991
if (gve_is_gqi(priv)) {
19821992
iowrite32be(0, gve_irq_doorbell(priv, block));

0 commit comments

Comments
 (0)