git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
app/crypto-perf: support lookaside IPsec
[dpdk.git]
/
lib
/
net
/
rte_ether.c
diff --git
a/lib/net/rte_ether.c
b/lib/net/rte_ether.c
index
9603a52
..
66d9a9d
100644
(file)
--- a/
lib/net/rte_ether.c
+++ b/
lib/net/rte_ether.c
@@
-10,16
+10,12
@@
void
rte_eth_random_addr(uint8_t *addr)
{
void
rte_eth_random_addr(uint8_t *addr)
{
-#ifdef RTE_EXEC_ENV_WINDOWS /* FIXME: random is not supported */
- RTE_SET_USED(addr);
-#else
uint64_t rand = rte_rand();
uint8_t *p = (uint8_t *)&rand;
rte_memcpy(addr, p, RTE_ETHER_ADDR_LEN);
addr[0] &= (uint8_t)~RTE_ETHER_GROUP_ADDR; /* clear multicast bit */
addr[0] |= RTE_ETHER_LOCAL_ADMIN_ADDR; /* set local assignment bit */
uint64_t rand = rte_rand();
uint8_t *p = (uint8_t *)&rand;
rte_memcpy(addr, p, RTE_ETHER_ADDR_LEN);
addr[0] &= (uint8_t)~RTE_ETHER_GROUP_ADDR; /* clear multicast bit */
addr[0] |= RTE_ETHER_LOCAL_ADMIN_ADDR; /* set local assignment bit */
-#endif
}
void
}
void
@@
-27,12
+23,7
@@
rte_ether_format_addr(char *buf, uint16_t size,
const struct rte_ether_addr *eth_addr)
{
snprintf(buf, size, RTE_ETHER_ADDR_PRT_FMT,
const struct rte_ether_addr *eth_addr)
{
snprintf(buf, size, RTE_ETHER_ADDR_PRT_FMT,
- eth_addr->addr_bytes[0],
- eth_addr->addr_bytes[1],
- eth_addr->addr_bytes[2],
- eth_addr->addr_bytes[3],
- eth_addr->addr_bytes[4],
- eth_addr->addr_bytes[5]);
+ RTE_ETHER_ADDR_BYTES(eth_addr));
}
static int8_t get_xdigit(char ch)
}
static int8_t get_xdigit(char ch)