| 637 | /* The validation of the rss_info should be done before calling this function*/ |
| 638 | |
| 639 | static struct bnxt_vnic_info * |
| 640 | bnxt_vnic_rss_create(struct bnxt *bp, |
| 641 | struct bnxt_vnic_rss_info *rss_info, |
| 642 | uint16_t vnic_id) |
| 643 | { |
| 644 | uint8_t *rx_queue_state = bp->eth_dev->data->rx_queue_state; |
| 645 | struct bnxt_vnic_info *vnic; |
| 646 | struct bnxt_rx_queue *rxq = NULL; |
| 647 | uint32_t idx, nr_ctxs, config_rss = 0; |
| 648 | uint16_t saved_mru = 0; |
| 649 | uint16_t active_q_cnt = 0; |
| 650 | int16_t first_q = -1; |
| 651 | int16_t end_q = -1; |
| 652 | int32_t rc = 0; |
| 653 | |
| 654 | /* Assign the vnic to be used for this rss configuration */ |
| 655 | vnic = &bp->vnic_info[vnic_id]; |
| 656 | |
| 657 | /* Update the vnic details for all the rx queues */ |
| 658 | for (idx = 0; idx < BNXT_VNIC_MAX_QUEUE_SIZE; idx++) { |
| 659 | if (BNXT_VNIC_BITMAP_GET(rss_info->queue_list, idx)) { |
| 660 | rxq = bp->rx_queues[idx]; |
| 661 | if (rx_queue_state[idx] == |
| 662 | RTE_ETH_QUEUE_STATE_STOPPED) { |
| 663 | rxq->rx_started = 0; |
| 664 | } else { |
| 665 | rxq->rx_started = 1; |
| 666 | active_q_cnt++; |
| 667 | } |
| 668 | vnic->rx_queue_cnt++; |
| 669 | |
| 670 | /* Update the queue list */ |
| 671 | BNXT_VNIC_BITMAP_SET(vnic->queue_bitmap, idx); |
| 672 | if (first_q == -1) |
| 673 | first_q = idx; |
| 674 | end_q = idx; |
| 675 | } |
| 676 | } |
| 677 | vnic->start_grp_id = first_q; |
| 678 | vnic->end_grp_id = end_q + 1; |
| 679 | vnic->func_default = 0; /* This is not a default VNIC. */ |
| 680 | bp->nr_vnics++; |
| 681 | |
| 682 | /* Allocate vnic group for p4 platform */ |
| 683 | rc = bnxt_vnic_grp_alloc(bp, vnic); |
| 684 | if (rc) { |
| 685 | PMD_DRV_LOG(ERR, "Failed to allocate vnic groups\n"); |
| 686 | goto fail_cleanup; |
| 687 | } |
| 688 | |
| 689 | /* populate the fw group table */ |
| 690 | bnxt_vnic_ring_grp_populate(bp, vnic); |
| 691 | bnxt_vnic_rules_init(vnic); |
| 692 | |
| 693 | /* Allocate the vnic in the firmware */ |
| 694 | rc = bnxt_hwrm_vnic_alloc(bp, vnic); |
| 695 | if (rc) { |
| 696 | PMD_DRV_LOG(ERR, "Failed to allocate vnic %d\n", idx); |
no test coverage detected