/* current configuration is in DCB or not,0 means it is not in DCB mode */
uint8_t dcb_config = 0;
-/* Whether the dcb is in testing status */
-uint8_t dcb_test = 0;
-
/*
* Configurable number of RX/TX queues.
*/
*/
enum rte_eth_rx_mq_mode rx_mq_mode = ETH_MQ_RX_VMDQ_DCB_RSS;
+/*
+ * Used to set forced link speed
+ */
+uint32_t eth_link_speed;
+
/* Forward function declarations */
static void setup_attached_port(portid_t pi);
static void check_all_ports_link_status(uint32_t port_mask);
port->tx_conf[k].offloads =
port->dev_conf.txmode.offloads;
+ if (eth_link_speed)
+ port->dev_conf.link_speeds = eth_link_speed;
+
/* set flag to initialize port/queue */
port->need_reconfig = 1;
port->need_reconfig_queues = 1;
fwd_lcores[lc_id]->gso_ctx.flag = 0;
}
- /* Configuration of packet forwarding streams. */
- if (init_fwd_streams() < 0)
- rte_exit(EXIT_FAILURE, "FAIL from init_fwd_streams()\n");
-
fwd_config_setup();
/* create a gro context for each lcore */
{
port_fwd_begin_t port_fwd_begin;
port_fwd_end_t port_fwd_end;
- struct rte_port *port;
unsigned int i;
- portid_t pt_id;
if (strcmp(cur_fwd_eng->fwd_mode_name, "rxonly") == 0 && !nb_rxq)
rte_exit(EXIT_FAILURE, "rxq are 0, cannot use rxonly fwd mode\n");
printf("Packet forwarding already started\n");
return;
}
-
-
- if(dcb_test) {
- for (i = 0; i < nb_fwd_ports; i++) {
- pt_id = fwd_ports_ids[i];
- port = &ports[pt_id];
- if (!port->dcb_flag) {
- printf("In DCB mode, all forwarding ports must "
- "be configured in this mode.\n");
- return;
- }
- }
- if (nb_fwd_lcores == 1) {
- printf("In DCB mode,the nb forwarding cores "
- "should be larger than 1.\n");
- return;
- }
- }
test_done = 0;
fwd_config_setup();
if (port_id_is_invalid(pid, ENABLED_WARN))
return 0;
- if(dcb_config)
- dcb_test = 1;
RTE_ETH_FOREACH_DEV(pi) {
if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
continue;
cnt_pi++;
/* start port */
- if (rte_eth_dev_start(pi) < 0) {
- printf("Fail to start port %d\n", pi);
+ diag = rte_eth_dev_start(pi);
+ if (diag < 0) {
+ printf("Fail to start port %d: %s\n", pi,
+ rte_strerror(-diag));
/* Fail to setup rx queue, return */
if (rte_atomic16_cmpset(&(port->port_status),
portid_t peer_pl[RTE_MAX_ETHPORTS];
int peer_pi;
- if (dcb_test) {
- dcb_test = 0;
- dcb_config = 0;
- }
-
if (port_id_is_invalid(pid, ENABLED_WARN))
return;
memset(&da, 0, sizeof(da));
if (rte_devargs_parsef(&da, "%s", identifier)) {
printf("cannot parse identifier\n");
- if (da.args)
- free(da.args);
return;
}
if (ports[port_id].port_status != RTE_PORT_STOPPED) {
printf("Port %u not stopped\n", port_id);
rte_eth_iterator_cleanup(&iterator);
+ rte_devargs_reset(&da);
return;
}
port_flow_flush(port_id);
if (rte_eal_hotplug_remove(da.bus->name, da.name) != 0) {
TESTPMD_LOG(ERR, "Failed to detach device %s(%s)\n",
da.name, da.bus->name);
+ rte_devargs_reset(&da);
return;
}
printf("Device %s is detached\n", identifier);
printf("Now total ports is %d\n", nb_ports);
printf("Done\n");
+ rte_devargs_reset(&da);
}
void
rte_port = &ports[pid];
memset(&port_conf, 0, sizeof(struct rte_eth_conf));
- /* Enter DCB configuration status */
- dcb_config = 1;
port_conf.rxmode = rte_port->dev_conf.rxmode;
port_conf.txmode = rte_port->dev_conf.txmode;
rte_port->dcb_flag = 1;
+ /* Enter DCB configuration status */
+ dcb_config = 1;
+
return 0;
}