-.. code-block:: c
-
- const uint16_t vlan_tags[] = {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31
- };
-
-
- /* Builds up the correct configuration for vmdq+dcb based on the vlan tags array
- * given above, and the number of traffic classes available for use. */
-
- static inline int
- get_eth_conf(struct rte_eth_conf *eth_conf, enum rte_eth_nb_pools num_pools)
- {
- struct rte_eth_vmdq_dcb_conf conf;
- unsigned i;
-
- if (num_pools != ETH_16_POOLS && num_pools != ETH_32_POOLS ) return -1;
-
- conf.nb_queue_pools = num_pools;
- conf.enable_default_pool = 0;
- conf.default_pool = 0; /* set explicit value, even if not used */
- conf.nb_pool_maps = sizeof( vlan_tags )/sizeof( vlan_tags[ 0 ]);
-
- for (i = 0; i < conf.nb_pool_maps; i++){
- conf.pool_map[i].vlan_id = vlan_tags[ i ];
- conf.pool_map[i].pools = 1 << (i % num_pools);
- }
-
- for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++){
- conf.dcb_queue[i] = (uint8_t)(i % (NUM_QUEUES/num_pools));
- }
-
- (void) rte_memcpy(eth_conf, &vmdq_dcb_conf_default, sizeof(\*eth_conf));
- (void) rte_memcpy(ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf, sizeof(eth_conf->rx_adv_conf.vmdq_dcb_conf));