+ if (vnic->rx_queue_cnt) {
+ if (vnic->start_grp_id != act_q->index) {
+ PMD_DRV_LOG(ERR,
+ "VNIC already in use\n");
+ rte_flow_error_set(error,
+ EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ act,
+ "VNIC already in use");
+ rc = -rte_errno;
+ goto ret;
+ }
+ goto use_vnic;
+ }
+
+ rxq = bp->rx_queues[act_q->index];
+
+ if (!(dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS) && rxq)
+ goto use_vnic;
+
+ if (!rxq ||
+ bp->vnic_info[0].fw_grp_ids[act_q->index] !=
+ INVALID_HW_RING_ID ||
+ !rxq->rx_deferred_start) {
+ PMD_DRV_LOG(ERR,
+ "Queue invalid or used with other VNIC\n");
+ rte_flow_error_set(error,
+ EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ act,
+ "Queue invalid queue or in use");
+ rc = -rte_errno;
+ goto ret;
+ }
+
+use_vnic:
+ rxq->vnic = vnic;
+ vnic->rx_queue_cnt++;
+ vnic->start_grp_id = act_q->index;
+ vnic->end_grp_id = act_q->index;
+ vnic->func_default = 0; //This is not a default VNIC.
+
+ PMD_DRV_LOG(DEBUG, "VNIC found\n");
+
+ rc = bnxt_vnic_prep(bp, vnic);
+ if (rc)
+ goto ret;
+
+ PMD_DRV_LOG(DEBUG,
+ "vnic[%d] = %p vnic->fw_grp_ids = %p\n",
+ act_q->index, vnic, vnic->fw_grp_ids);