[ovs-dev] [PATCH 3/3] The netdev-dpdk uses the struct ether_addr rather than struct eth_addr internal ovs datatype.

Ben Pfaff blp at nicira.com
Fri Sep 4 23:32:11 UTC 2015


Would one of you mind reviewing this?

Thanks,

Ben.

On Fri, Sep 04, 2015 at 04:53:30PM -0400, Aaron Conole wrote:
> 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 at redhat.com>
> ---
>  lib/netdev-dpdk.c | 4 ++--
>  lib/packets.h     | 4 +++-
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 4ce0a1e..de8256e 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -524,9 +524,9 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) OVS_REQUIRES(dpdk_mutex)
>      memset(&eth_addr, 0x0, sizeof(eth_addr));
>      rte_eth_macaddr_get(dev->port_id, &eth_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_ARG(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);
> diff --git a/lib/packets.h b/lib/packets.h
> index a4f6383..b700e4b 100644
> --- a/lib/packets.h
> +++ b/lib/packets.h
> @@ -324,7 +324,9 @@ ovs_be32 set_mpls_lse_values(uint8_t ttl, uint8_t tc, uint8_t bos,
>  #define ETH_ADDR_SCAN_FMT "%"SCNx8":%"SCNx8":%"SCNx8":%"SCNx8":%"SCNx8":%"SCNx8
>  #define ETH_ADDR_SCAN_ARGS(EA) \
>      &(EA).ea[0], &(EA).ea[1], &(EA).ea[2], &(EA).ea[3], &(EA).ea[4], &(EA).ea[5]
> -
> +#define ETH_ADDR_BYTES_ARG(EAB) \
> +         EAB[0],     EAB[1],     EAB[2],     EAB[3],     EAB[4],     EAB[5]
> +    
>  #define ETH_TYPE_IP            0x0800
>  #define ETH_TYPE_ARP           0x0806
>  #define ETH_TYPE_TEB           0x6558
> -- 
> 1.8.3.1
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list