| 208 | } |
| 209 | |
| 210 | int |
| 211 | tmgr_pipe_config(const char *port_name, |
| 212 | uint32_t subport_id, |
| 213 | uint32_t pipe_id_first, |
| 214 | uint32_t pipe_id_last, |
| 215 | uint32_t pipe_profile_id) |
| 216 | { |
| 217 | struct tmgr_port *port; |
| 218 | uint32_t i; |
| 219 | |
| 220 | /* Check input params */ |
| 221 | if (port_name == NULL) |
| 222 | return -1; |
| 223 | |
| 224 | port = tmgr_port_find(port_name); |
| 225 | if ((port == NULL) || |
| 226 | (subport_id >= port->n_subports_per_port) || |
| 227 | (pipe_id_first >= port->n_pipes_per_subport) || |
| 228 | (pipe_id_last >= port->n_pipes_per_subport) || |
| 229 | (pipe_id_first > pipe_id_last) || |
| 230 | (pipe_profile_id >= n_pipe_profiles)) |
| 231 | return -1; |
| 232 | |
| 233 | /* Resource config */ |
| 234 | for (i = pipe_id_first; i <= pipe_id_last; i++) { |
| 235 | int status; |
| 236 | |
| 237 | status = rte_sched_pipe_config( |
| 238 | port->s, |
| 239 | subport_id, |
| 240 | i, |
| 241 | (int) pipe_profile_id); |
| 242 | |
| 243 | if (status) |
| 244 | return status; |
| 245 | } |
| 246 | |
| 247 | return 0; |
| 248 | } |
no test coverage detected