mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
netdev-dpdk: Fix build failure due to new struct eth_addr.
The netdev-dpdk uses the struct ether_addr rather than struct eth_addr internal ovs datatype. To facilitate using either the .ea OR the struct ether_addr.addr_bytes argument for printing/logging, add a new ETH_ADDR_BYTES_ARG() define. Signed-off-by: Aaron Conole <aconole@redhat.com> [blp@nicira.com made stylistic changes] Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -524,9 +524,9 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) OVS_REQUIRES(dpdk_mutex)
|
||||
memset(ð_addr, 0x0, sizeof(eth_addr));
|
||||
rte_eth_macaddr_get(dev->port_id, ð_addr);
|
||||
VLOG_INFO_RL(&rl, "Port %d: "ETH_ADDR_FMT"",
|
||||
dev->port_id, ETH_ADDR_ARGS(eth_addr.addr_bytes));
|
||||
dev->port_id, ETH_ADDR_BYTES_ARGS(eth_addr.addr_bytes));
|
||||
|
||||
memcpy(dev->hwaddr, eth_addr.addr_bytes, ETH_ADDR_LEN);
|
||||
memcpy(dev->hwaddr.ea, eth_addr.addr_bytes, ETH_ADDR_LEN);
|
||||
rte_eth_link_get_nowait(dev->port_id, &dev->link);
|
||||
|
||||
mbp_priv = rte_mempool_get_priv(dev->dpdk_mp->mp);
|
||||
|
@@ -307,8 +307,9 @@ ovs_be32 set_mpls_lse_values(uint8_t ttl, uint8_t tc, uint8_t bos,
|
||||
*/
|
||||
#define ETH_ADDR_FMT \
|
||||
"%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8
|
||||
#define ETH_ADDR_ARGS(EA) \
|
||||
(EA).ea[0], (EA).ea[1], (EA).ea[2], (EA).ea[3], (EA).ea[4], (EA).ea[5]
|
||||
#define ETH_ADDR_ARGS(EA) ETH_ADDR_BYTES_ARGS((EA).ea)
|
||||
#define ETH_ADDR_BYTES_ARGS(EAB) \
|
||||
(EAB)[0], (EAB)[1], (EAB)[2], (EAB)[3], (EAB)[4], (EAB)[5]
|
||||
|
||||
/* Example:
|
||||
*
|
||||
|
Reference in New Issue
Block a user