return err;
}
+/* This should be called after we have queried trusted VF cap */
+static int bnxt_alloc_switch_domain(struct bnxt *bp)
+{
+ int rc = 0;
+
+ if (BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp)) {
+ rc = rte_eth_switch_domain_alloc(&bp->switch_domain_id);
+ if (rc)
+ PMD_DRV_LOG(ERR,
+ "Failed to alloc switch domain: %d\n", rc);
+ else
+ PMD_DRV_LOG(INFO,
+ "Switch domain allocated %d\n",
+ bp->switch_domain_id);
+ }
+
+ return rc;
+}
+
static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev)
{
int rc = 0;
if (rc)
return rc;
+ rc = bnxt_alloc_switch_domain(bp);
+ if (rc)
+ return rc;
+
if (!reconfig_dev) {
rc = bnxt_setup_mac_addr(bp->eth_dev);
if (rc)
return ret;
}
-static int bnxt_alloc_switch_domain(struct bnxt *bp)
-{
- int rc = 0;
-
- if (BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp)) {
- rc = rte_eth_switch_domain_alloc(&bp->switch_domain_id);
- if (rc)
- PMD_DRV_LOG(ERR,
- "Failed to alloc switch domain: %d\n", rc);
- else
- PMD_DRV_LOG(INFO,
- "Switch domain allocated %d\n",
- bp->switch_domain_id);
- }
-
- return rc;
-}
-
/* Allocate and initialize various fields in bnxt struct that
* need to be allocated/destroyed only once in the lifetime of the driver
*/
if (rc)
return rc;
- rc = bnxt_alloc_switch_domain(bp);
- if (rc)
- return rc;
-
return rc;
}