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

Function eth_pcap_update_mac

dpdk/drivers/net/pcap/pcap_ethdev.c:1265–1283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1263}
1264
1265static int
1266eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev,
1267 const unsigned int numa_node)
1268{
1269 void *mac_addrs;
1270 struct rte_ether_addr mac;
1271
1272 if (osdep_iface_mac_get(if_name, &mac) < 0)
1273 return -1;
1274
1275 mac_addrs = rte_zmalloc_socket(NULL, RTE_ETHER_ADDR_LEN, 0, numa_node);
1276 if (mac_addrs == NULL)
1277 return -1;
1278
1279 PMD_LOG(INFO, "Setting phy MAC for %s", if_name);
1280 rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
1281 eth_dev->data->mac_addrs = mac_addrs;
1282 return 0;
1283}
1284
1285static int
1286eth_from_pcaps_common(struct rte_vdev_device *vdev,

Callers 1

eth_from_pcapsFunction · 0.85

Calls 3

rte_zmalloc_socketFunction · 0.85
osdep_iface_mac_getFunction · 0.70
rte_memcpyFunction · 0.50

Tested by

no test coverage detected