Skip to content

Commit 864616d

Browse files
shailend-gdavem330
authored andcommitted
gve: Make gve_turnup work for nonempty queues
gVNIC has a requirement that all queues have to be quiesced before any queue is operated on (created or destroyed). To enable the implementation of future ndo hooks that work on a single queue, we need to evolve gve_turnup to account for queues already having some unprocessed descriptors in the ring. Say rxq 4 is being stopped and started via the queue api. Due to gve's requirement of quiescence, queues 0 through 3 are not processing their rings while queue 4 is being toggled. Once they are made live, these queues need to be poked to cause them to check their rings for descriptors that were written during their brief period of quiescence. 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 5abc37b commit 864616d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,13 @@ static void gve_turnup(struct gve_priv *priv)
19791979
gve_set_itr_coalesce_usecs_dqo(priv, block,
19801980
priv->tx_coalesce_usecs);
19811981
}
1982+
1983+
/* Any descs written by the NIC before this barrier will be
1984+
* handled by the one-off napi schedule below. Whereas any
1985+
* descs after the barrier will generate interrupts.
1986+
*/
1987+
mb();
1988+
napi_schedule(&block->napi);
19821989
}
19831990
for (idx = 0; idx < priv->rx_cfg.num_queues; idx++) {
19841991
int ntfy_idx = gve_rx_idx_to_ntfy(priv, idx);
@@ -1994,6 +2001,13 @@ static void gve_turnup(struct gve_priv *priv)
19942001
gve_set_itr_coalesce_usecs_dqo(priv, block,
19952002
priv->rx_coalesce_usecs);
19962003
}
2004+
2005+
/* Any descs written by the NIC before this barrier will be
2006+
* handled by the one-off napi schedule below. Whereas any
2007+
* descs after the barrier will generate interrupts.
2008+
*/
2009+
mb();
2010+
napi_schedule(&block->napi);
19972011
}
19982012

19992013
gve_set_napi_enabled(priv);

0 commit comments

Comments
 (0)