MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ethdev_prom_mode_config

Function ethdev_prom_mode_config

dpdk/app/graph/ethdev.c:292–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292static int
293ethdev_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
321static int
322ethdev_mtu_config(const char *name, uint32_t mtu)

Callers 1

cli_ethdev_prom_modeFunction · 0.85

Calls 4

ethdev_port_by_idFunction · 0.85

Tested by

no test coverage detected