| 406 | } |
| 407 | |
| 408 | static int bnxt_setup_one_vnic(struct bnxt *bp, uint16_t vnic_id) |
| 409 | { |
| 410 | struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf; |
| 411 | struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id]; |
| 412 | uint64_t rx_offloads = dev_conf->rxmode.offloads; |
| 413 | struct bnxt_rx_queue *rxq; |
| 414 | unsigned int j; |
| 415 | int rc; |
| 416 | |
| 417 | rc = bnxt_vnic_grp_alloc(bp, vnic); |
| 418 | if (rc) |
| 419 | goto err_out; |
| 420 | |
| 421 | PMD_DRV_LOG(DEBUG, "vnic[%d] = %p vnic->fw_grp_ids = %p\n", |
| 422 | vnic_id, vnic, vnic->fw_grp_ids); |
| 423 | |
| 424 | /* populate the fw group table */ |
| 425 | bnxt_vnic_ring_grp_populate(bp, vnic); |
| 426 | bnxt_vnic_rules_init(vnic); |
| 427 | |
| 428 | rc = bnxt_hwrm_vnic_alloc(bp, vnic); |
| 429 | if (rc) |
| 430 | goto err_out; |
| 431 | |
| 432 | /* Alloc RSS context only if RSS mode is enabled */ |
| 433 | if (dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_RSS) { |
| 434 | int j, nr_ctxs = bnxt_rss_ctxts(bp); |
| 435 | |
| 436 | /* RSS table size in P5 is 512. |
| 437 | * Cap max Rx rings to same value |
| 438 | */ |
| 439 | if (bp->rx_nr_rings > BNXT_RSS_TBL_SIZE_P5) { |
| 440 | PMD_DRV_LOG(ERR, "RxQ cnt %d > reta_size %d\n", |
| 441 | bp->rx_nr_rings, BNXT_RSS_TBL_SIZE_P5); |
| 442 | goto err_out; |
| 443 | } |
| 444 | |
| 445 | rc = 0; |
| 446 | for (j = 0; j < nr_ctxs; j++) { |
| 447 | rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, j); |
| 448 | if (rc) |
| 449 | break; |
| 450 | } |
| 451 | if (rc) { |
| 452 | PMD_DRV_LOG(ERR, |
| 453 | "HWRM vnic %d ctx %d alloc failure rc: %x\n", |
| 454 | vnic_id, j, rc); |
| 455 | goto err_out; |
| 456 | } |
| 457 | vnic->num_lb_ctxts = nr_ctxs; |
| 458 | } |
| 459 | |
| 460 | /* |
| 461 | * Firmware sets pf pair in default vnic cfg. If the VLAN strip |
| 462 | * setting is not available at this time, it will not be |
| 463 | * configured correctly in the CFA. |
| 464 | */ |
| 465 | if (rx_offloads & RTE_ETH_RX_OFFLOAD_VLAN_STRIP) |
no test coverage detected