| 3034 | } |
| 3035 | |
| 3036 | int |
| 3037 | start_port(portid_t pid) |
| 3038 | { |
| 3039 | int diag; |
| 3040 | portid_t pi; |
| 3041 | portid_t p_pi = RTE_MAX_ETHPORTS; |
| 3042 | portid_t pl[RTE_MAX_ETHPORTS]; |
| 3043 | portid_t peer_pl[RTE_MAX_ETHPORTS]; |
| 3044 | uint16_t cnt_pi = 0; |
| 3045 | uint16_t cfg_pi = 0; |
| 3046 | int peer_pi; |
| 3047 | queueid_t qi; |
| 3048 | struct rte_port *port; |
| 3049 | struct rte_eth_hairpin_cap cap; |
| 3050 | bool at_least_one_port_exist = false; |
| 3051 | bool all_ports_already_started = true; |
| 3052 | bool at_least_one_port_successfully_started = false; |
| 3053 | |
| 3054 | if (port_id_is_invalid(pid, ENABLED_WARN)) |
| 3055 | return 0; |
| 3056 | |
| 3057 | RTE_ETH_FOREACH_DEV(pi) { |
| 3058 | if (pid != pi && pid != (portid_t)RTE_PORT_ALL) |
| 3059 | continue; |
| 3060 | |
| 3061 | if (port_is_bonding_member(pi)) { |
| 3062 | fprintf(stderr, |
| 3063 | "Please remove port %d from bonding device.\n", |
| 3064 | pi); |
| 3065 | continue; |
| 3066 | } |
| 3067 | |
| 3068 | at_least_one_port_exist = true; |
| 3069 | |
| 3070 | port = &ports[pi]; |
| 3071 | if (port->port_status == RTE_PORT_STOPPED) { |
| 3072 | port->port_status = RTE_PORT_HANDLING; |
| 3073 | all_ports_already_started = false; |
| 3074 | } else { |
| 3075 | fprintf(stderr, "Port %d is now not stopped\n", pi); |
| 3076 | continue; |
| 3077 | } |
| 3078 | |
| 3079 | if (port->need_reconfig > 0) { |
| 3080 | struct rte_eth_conf dev_conf; |
| 3081 | int k; |
| 3082 | |
| 3083 | port->need_reconfig = 0; |
| 3084 | |
| 3085 | if (flow_isolate_all) { |
| 3086 | int ret = port_flow_isolate(pi, 1); |
| 3087 | if (ret) { |
| 3088 | fprintf(stderr, |
| 3089 | "Failed to apply isolated mode on port %d\n", |
| 3090 | pi); |
| 3091 | return -1; |
| 3092 | } |
| 3093 | } |
no test coverage detected