ionic: increment num-vfs before configure
authorShannon Nelson <snelson@pensando.io>
Tue, 27 Jul 2021 17:43:30 +0000 (10:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jul 2021 19:15:21 +0000 (20:15 +0100)
Add the new VF to our internal count before we start configuring it.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c

index 505f605..7e296fa 100644 (file)
@@ -165,10 +165,10 @@ static int ionic_vf_alloc(struct ionic *ionic, int num_vfs)
                        goto out;
                }
 
+               ionic->num_vfs++;
                /* ignore failures from older FW, we just won't get stats */
                (void)ionic_set_vf_config(ionic, i, IONIC_VF_ATTR_STATSADDR,
                                          (u8 *)&v->stats_pa);
-               ionic->num_vfs++;
        }
 
 out: