gve: Update mgmt_msix_idx if num_ntfy changes
authorDavid Awogbemila <awogbemila@google.com>
Mon, 17 May 2021 21:08:12 +0000 (14:08 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 May 2021 22:38:40 +0000 (15:38 -0700)
If we do not get the expected number of vectors from
pci_enable_msix_range, we update priv->num_ntfy_blks but not
priv->mgmt_msix_idx. This patch fixes this so that priv->mgmt_msix_idx
is updated accordingly.

Fixes: f5cedc84a30d ("gve: Add transmit and receive support")
Signed-off-by: David Awogbemila <awogbemila@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/google/gve/gve_main.c

index 7302498..6419294 100644 (file)
@@ -220,6 +220,7 @@ static int gve_alloc_notify_blocks(struct gve_priv *priv)
                int vecs_left = new_num_ntfy_blks % 2;
 
                priv->num_ntfy_blks = new_num_ntfy_blks;
+               priv->mgmt_msix_idx = priv->num_ntfy_blks;
                priv->tx_cfg.max_queues = min_t(int, priv->tx_cfg.max_queues,
                                                vecs_per_type);
                priv->rx_cfg.max_queues = min_t(int, priv->rx_cfg.max_queues,