MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bnxt_setup_one_vnic

Function bnxt_setup_one_vnic

dpdk/drivers/net/bnxt/bnxt_ethdev.c:408–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408static 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)

Callers 2

bnxt_start_nicFunction · 0.85

Calls 11

bnxt_vnic_grp_allocFunction · 0.85
bnxt_vnic_rules_initFunction · 0.85
bnxt_hwrm_vnic_allocFunction · 0.85
bnxt_rss_ctxtsFunction · 0.85
bnxt_hwrm_vnic_ctx_allocFunction · 0.85
bnxt_hwrm_vnic_cfgFunction · 0.85
bnxt_vnic_rss_configureFunction · 0.85
bnxt_hwrm_vnic_tpa_cfgFunction · 0.85

Tested by

no test coverage detected