| 290 | } |
| 291 | |
| 292 | static int |
| 293 | ethdev_prom_mode_config(const char *name, bool enable) |
| 294 | { |
| 295 | struct ethdev *eth_hdl; |
| 296 | uint16_t portid = 0; |
| 297 | int rc; |
| 298 | |
| 299 | rc = rte_eth_dev_get_port_by_name(name, &portid); |
| 300 | if (rc < 0) |
| 301 | return rc; |
| 302 | |
| 303 | eth_hdl = ethdev_port_by_id(portid); |
| 304 | |
| 305 | if (eth_hdl) { |
| 306 | if (enable) |
| 307 | rc = rte_eth_promiscuous_enable(portid); |
| 308 | else |
| 309 | rc = rte_eth_promiscuous_disable(portid); |
| 310 | if (rc < 0) |
| 311 | return rc; |
| 312 | |
| 313 | eth_hdl->config.promiscuous = enable; |
| 314 | return 0; |
| 315 | } |
| 316 | |
| 317 | rc = -EINVAL; |
| 318 | return rc; |
| 319 | } |
| 320 | |
| 321 | static int |
| 322 | ethdev_mtu_config(const char *name, uint32_t mtu) |
no test coverage detected