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

Function ethdev_ip4_addr_add

dpdk/app/graph/ethdev.c:245–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245static int
246ethdev_ip4_addr_add(const char *name, struct ipv4_addr_config *config)
247{
248 struct ethdev *eth_hdl;
249 uint16_t portid = 0;
250 int rc;
251
252 rc = rte_eth_dev_get_port_by_name(name, &portid);
253 if (rc < 0)
254 return rc;
255
256 eth_hdl = ethdev_port_by_id(portid);
257
258 if (eth_hdl) {
259 eth_hdl->ip4_addr.ip = config->ip;
260 eth_hdl->ip4_addr.mask = config->mask;
261 return 0;
262 }
263
264 rc = -EINVAL;
265 return rc;
266}
267
268static int
269ethdev_ip6_addr_add(const char *name, struct ipv6_addr_config *config)

Callers 1

cli_ip4_addrFunction · 0.85

Calls 2

ethdev_port_by_idFunction · 0.85

Tested by

no test coverage detected