From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id BD9CBA0465 for ; Wed, 29 May 2019 13:30:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2B7141B95C; Wed, 29 May 2019 13:29:57 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 56DB2378B for ; Wed, 29 May 2019 13:29:53 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D2D681134; Wed, 29 May 2019 11:29:44 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-214.brq.redhat.com [10.40.204.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id D13ED277B8; Wed, 29 May 2019 11:29:37 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: ferruh.yigit@intel.com, thomas@monjalon.net, olivier.matz@6wind.com, maxime.coquelin@redhat.com, stephen@networkplumber.org, Keith Wiles Date: Wed, 29 May 2019 13:29:15 +0200 Message-Id: <1559129358-2935-2-git-send-email-david.marchand@redhat.com> In-Reply-To: <1559129358-2935-1-git-send-email-david.marchand@redhat.com> References: <1559129358-2935-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 29 May 2019 11:29:45 +0000 (UTC) Subject: [dpdk-dev] [PATCH 2/5] net/tap: revert changes on rte_ prefixing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This source is compiled as a bpf program out of dpdk. Revert to structures/macros coming from libc. Fixes: 6d13ea8e8e49 ("net: add rte prefix to ether structures") Fixes: 24ac604ef746 ("net: add rte prefix to IP defines") Signed-off-by: David Marchand --- drivers/net/tap/tap_bpf_program.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/tap/tap_bpf_program.c b/drivers/net/tap/tap_bpf_program.c index 531569b..532e883 100644 --- a/drivers/net/tap/tap_bpf_program.c +++ b/drivers/net/tap/tap_bpf_program.c @@ -19,7 +19,7 @@ #include "tap_rss.h" /** Create IPv4 address */ -#define RTE_IPv4(a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \ +#define IPv4(a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \ (((b) & 0xff) << 16) | \ (((c) & 0xff) << 8) | \ ((d) & 0xff)) @@ -37,7 +37,7 @@ #define KEY_IDX 0 #define BPF_MAP_ID_KEY 1 -struct rte_vlan_hdr { +struct vlan_hdr { __be16 proto; __be16 tci; }; @@ -141,12 +141,12 @@ static int __attribute__((always_inline)) /* Get correct proto for 802.1ad */ if (skb->vlan_present && skb->vlan_proto == htons(ETH_P_8021AD)) { - if (data + ETH_ALEN * 2 + sizeof(struct rte_vlan_hdr) + + if (data + ETH_ALEN * 2 + sizeof(struct vlan_hdr) + sizeof(proto) > data_end) return TC_ACT_OK; proto = *(__u16 *)(data + ETH_ALEN * 2 + - sizeof(struct rte_vlan_hdr)); - off += sizeof(struct rte_vlan_hdr); + sizeof(struct vlan_hdr)); + off += sizeof(struct vlan_hdr); } if (proto == htons(ETH_P_IP)) { @@ -157,11 +157,11 @@ static int __attribute__((always_inline)) __u8 *src_dst_addr = data + off + offsetof(struct iphdr, saddr); __u8 *src_dst_port = data + off + sizeof(struct iphdr); struct ipv4_l3_l4_tuple v4_tuple = { - .src_addr = RTE_IPv4(*(src_dst_addr + 0), + .src_addr = IPv4(*(src_dst_addr + 0), *(src_dst_addr + 1), *(src_dst_addr + 2), *(src_dst_addr + 3)), - .dst_addr = RTE_IPv4(*(src_dst_addr + 4), + .dst_addr = IPv4(*(src_dst_addr + 4), *(src_dst_addr + 5), *(src_dst_addr + 6), *(src_dst_addr + 7)), -- 1.8.3.1