+ uint16_t queues_per_pool;
+ uint32_t max_nb_pools;
+ struct rte_eth_txconf txq_conf;
+ uint64_t rss_hf_tmp;
+
+ /*
+ * The max pool number from dev_info will be used to validate the pool
+ * number specified in cmd line
+ */
+ retval = rte_eth_dev_info_get(port, &dev_info);
+ if (retval != 0) {
+ printf("Error during getting device (port %u) info: %s\n",
+ port, strerror(-retval));
+
+ return retval;
+ }
+
+ max_nb_pools = (uint32_t)dev_info.max_vmdq_pools;
+ /*
+ * We allow to process part of VMDQ pools specified by num_pools in
+ * command line.
+ */
+ if (num_pools > max_nb_pools) {
+ printf("num_pools %d >max_nb_pools %d\n",
+ num_pools, max_nb_pools);
+ return -1;
+ }
+
+ /*
+ * NIC queues are divided into pf queues and vmdq queues.
+ * There is assumption here all ports have the same configuration!
+ */
+ vmdq_queue_base = dev_info.vmdq_queue_base;
+ vmdq_pool_base = dev_info.vmdq_pool_base;
+ printf("vmdq queue base: %d pool base %d\n",
+ vmdq_queue_base, vmdq_pool_base);
+ if (vmdq_pool_base == 0) {
+ num_vmdq_queues = dev_info.max_rx_queues;
+ num_queues = dev_info.max_rx_queues;
+ if (num_tcs != num_vmdq_queues / num_pools) {
+ printf("nb_tcs %d is invalid considering with"
+ " nb_pools %d, nb_tcs * nb_pools should = %d\n",
+ num_tcs, num_pools, num_vmdq_queues);
+ return -1;
+ }
+ } else {
+ queues_per_pool = dev_info.vmdq_queue_num /
+ dev_info.max_vmdq_pools;
+ if (num_tcs > queues_per_pool) {
+ printf("num_tcs %d > num of queues per pool %d\n",
+ num_tcs, queues_per_pool);
+ return -1;
+ }
+ num_vmdq_queues = num_pools * queues_per_pool;
+ num_queues = vmdq_queue_base + num_vmdq_queues;
+ printf("Configured vmdq pool num: %u,"
+ " each vmdq pool has %u queues\n",
+ num_pools, queues_per_pool);
+ }