From: David Marchand <david.marchand@redhat.com>
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 <keith.wiles@intel.com>
Subject: [dpdk-dev] [PATCH 2/5] net/tap: revert changes on rte_ prefixing
Date: Wed, 29 May 2019 13:29:15 +0200 [thread overview]
Message-ID: <1559129358-2935-2-git-send-email-david.marchand@redhat.com> (raw)
In-Reply-To: <1559129358-2935-1-git-send-email-david.marchand@redhat.com>
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 <david.marchand@redhat.com>
---
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
next prev parent reply other threads:[~2019-05-29 11:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-29 11:29 [dpdk-dev] [PATCH 1/5] test/table: remove duplicate macro David Marchand
2019-05-29 11:29 ` David Marchand [this message]
2019-05-29 13:36 ` [dpdk-dev] [PATCH 2/5] net/tap: revert changes on rte_ prefixing Wiles, Keith
2019-05-29 14:26 ` Olivier Matz
2019-05-29 11:29 ` [dpdk-dev] [PATCH 3/5] replace RTE_IPv4 with uppercase RTE_IPV4 David Marchand
2019-05-29 14:26 ` Olivier Matz
2019-06-03 8:58 ` David Marchand
2019-06-03 13:30 ` Thomas Monjalon
2019-05-29 11:29 ` [dpdk-dev] [PATCH 4/5] replace RTE_ETHER_TYPE_IPv4 with uppercase RTE_ETHER_TYPE_IPV4 David Marchand
2019-05-29 14:26 ` Olivier Matz
2019-05-29 11:29 ` [dpdk-dev] [PATCH 5/5] replace RTE_ETHER_TYPE_IPv6 with uppercase RTE_ETHER_TYPE_IPV6 David Marchand
2019-05-29 14:27 ` Olivier Matz
2019-05-29 14:25 ` [dpdk-dev] [PATCH 1/5] test/table: remove duplicate macro Olivier Matz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1559129358-2935-2-git-send-email-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=keith.wiles@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=olivier.matz@6wind.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).