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

Function rte_eth_random_addr

dpdk/lib/net/rte_ether.c:10–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <rte_errno.h>
9
10void
11rte_eth_random_addr(uint8_t *addr)
12{
13 uint64_t rand = rte_rand();
14 uint8_t *p = (uint8_t *)&rand;
15
16 rte_memcpy(addr, p, RTE_ETHER_ADDR_LEN);
17 addr[0] &= (uint8_t)~RTE_ETHER_GROUP_ADDR; /* clear multicast bit */
18 addr[0] |= RTE_ETHER_LOCAL_ADMIN_ADDR; /* set local assignment bit */
19}
20
21void
22rte_ether_format_addr(char *buf, uint16_t size,

Callers 15

eth_igbvf_dev_initFunction · 0.85
igb_vf_perm_addr_genFunction · 0.85
rte_pmd_memif_probeFunction · 0.85
virtio_get_hwaddrFunction · 0.85
otx_ep_eth_dev_initFunction · 0.85
eth_dev_null_createFunction · 0.85
ngbe_vf_perm_addr_genFunction · 0.85
nfp_netvf_initFunction · 0.85
nfp_net_initFunction · 0.85
nfp_flower_repr_allocFunction · 0.85
iavf_dev_initFunction · 0.85

Calls 2

rte_randFunction · 0.85
rte_memcpyFunction · 0.50

Tested by 4

mbuf1_prepareFunction · 0.68
test_ether_addrFunction · 0.68
test_format_addrFunction · 0.68
pipeline_tx_firstFunction · 0.68