- printf("done: ");
- rte_eth_link_get(pi, &link);
- if (link.link_status) {
- printf(" Link Up - speed %u Mbps - %s\n",
- (unsigned) link.link_speed,
- (link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
- ("full-duplex") : ("half-duplex\n"));
- } else {
- printf(" Link Down\n");
+
+ port->rx_conf.rx_thresh = rx_thresh;
+ port->rx_conf.rx_free_thresh = rx_free_thresh;
+ port->rx_conf.rx_drop_en = rx_drop_en;
+ port->tx_conf.tx_thresh = tx_thresh;
+ port->tx_conf.tx_rs_thresh = tx_rs_thresh;
+ port->tx_conf.tx_free_thresh = tx_free_thresh;
+ port->tx_conf.txq_flags = txq_flags;
+
+ rte_eth_macaddr_get(pid, &port->eth_addr);
+
+ map_port_queue_stats_mapping_registers(pid, port);
+#ifdef RTE_NIC_BYPASS
+ rte_eth_dev_bypass_init(pid);
+#endif
+ }
+}
+
+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
+};
+
+static int
+get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf)
+{
+ uint8_t i;
+
+ /*
+ * Builds up the correct configuration for dcb+vt based on the vlan tags array
+ * given above, and the number of traffic classes available for use.
+ */
+ if (dcb_conf->dcb_mode == DCB_VT_ENABLED) {
+ struct rte_eth_vmdq_dcb_conf vmdq_rx_conf;
+ struct rte_eth_vmdq_dcb_tx_conf vmdq_tx_conf;
+
+ /* VMDQ+DCB RX and TX configrations */
+ vmdq_rx_conf.enable_default_pool = 0;
+ vmdq_rx_conf.default_pool = 0;
+ vmdq_rx_conf.nb_queue_pools =
+ (dcb_conf->num_tcs == ETH_4_TCS ? ETH_32_POOLS : ETH_16_POOLS);
+ vmdq_tx_conf.nb_queue_pools =
+ (dcb_conf->num_tcs == ETH_4_TCS ? ETH_32_POOLS : ETH_16_POOLS);
+
+ vmdq_rx_conf.nb_pool_maps = sizeof( vlan_tags )/sizeof( vlan_tags[ 0 ]);
+ for (i = 0; i < vmdq_rx_conf.nb_pool_maps; i++) {
+ vmdq_rx_conf.pool_map[i].vlan_id = vlan_tags[ i ];
+ vmdq_rx_conf.pool_map[i].pools = 1 << (i % vmdq_rx_conf.nb_queue_pools);