From patchwork Fri Sep 4 20:53:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 514761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id E25C514029C for ; Sat, 5 Sep 2015 06:53:48 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 605F410C4D; Fri, 4 Sep 2015 13:53:35 -0700 (PDT) X-Original-To: dev@openvswitch.com Delivered-To: dev@openvswitch.com Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by archives.nicira.com (Postfix) with ESMTPS id 39CC810895 for ; Fri, 4 Sep 2015 13:53:34 -0700 (PDT) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id DEE0F2B81CA for ; Fri, 4 Sep 2015 20:53:33 +0000 (UTC) Received: from aconole.bos.com (vpn-63-96.rdu2.redhat.com [10.10.63.96]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t84KrVlK001959 for ; Fri, 4 Sep 2015 16:53:33 -0400 From: Aaron Conole To: dev@openvswitch.com Date: Fri, 4 Sep 2015 16:53:30 -0400 Message-Id: <1441400010-15363-4-git-send-email-aconole@redhat.com> In-Reply-To: <1441400010-15363-1-git-send-email-aconole@redhat.com> References: <1441400010-15363-1-git-send-email-aconole@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Subject: [ovs-dev] [PATCH 3/3] The netdev-dpdk uses the struct ether_addr rather than struct eth_addr internal ovs datatype. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 --- 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(ð_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_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