| 319 | } |
| 320 | |
| 321 | static int |
| 322 | ethdev_mtu_config(const char *name, uint32_t mtu) |
| 323 | { |
| 324 | struct ethdev *eth_hdl; |
| 325 | uint16_t portid = 0; |
| 326 | int rc; |
| 327 | |
| 328 | rc = rte_eth_dev_get_port_by_name(name, &portid); |
| 329 | if (rc < 0) |
| 330 | return rc; |
| 331 | |
| 332 | eth_hdl = ethdev_port_by_id(portid); |
| 333 | |
| 334 | if (eth_hdl) { |
| 335 | rc = rte_eth_dev_set_mtu(portid, mtu); |
| 336 | if (rc < 0) |
| 337 | return rc; |
| 338 | |
| 339 | eth_hdl->config.mtu = mtu; |
| 340 | return 0; |
| 341 | } |
| 342 | |
| 343 | rc = -EINVAL; |
| 344 | return rc; |
| 345 | } |
| 346 | |
| 347 | |
| 348 | static int |
no test coverage detected