X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fbpf%2Ft3.c;h=9ba34638a17f7ea671e3c826f5b2749142a2586e;hb=refs%2Ftags%2Fupstream%2F18.11-rc3;hp=531b9cb8c4e115159c7855ae41e0391e77cd26e5;hpb=88fab00d4402af240c1b7cc2566133aece115488;p=deb_dpdk.git diff --git a/test/bpf/t3.c b/test/bpf/t3.c index 531b9cb8..9ba34638 100644 --- a/test/bpf/t3.c +++ b/test/bpf/t3.c @@ -6,9 +6,15 @@ * eBPF program sample. * Accepts pointer to struct rte_mbuf as an input parameter. * Dump the mbuf into stdout if it is an ARP packet (aka tcpdump 'arp'). - * To compile: - * clang -O2 -I${RTE_SDK}/${RTE_TARGET}/include \ + * + * To compile on x86: + * clang -O2 -U __GNUC__ -I${RTE_SDK}/${RTE_TARGET}/include \ * -target bpf -Wno-int-to-void-pointer-cast -c t3.c + * + * To compile on ARM: + * clang -O2 -I/usr/include/aarch64-linux-gnu \ + * -I${RTE_SDK}/${RTE_TARGET}/include -target bpf \ + * -Wno-int-to-void-pointer-cast -c t3.c */ #include @@ -17,6 +23,7 @@ #include #include #include "mbuf.h" +#include extern void rte_pktmbuf_dump(FILE *, const struct rte_mbuf *, unsigned int); @@ -29,7 +36,7 @@ entry(const void *pkt) mb = pkt; eth = rte_pktmbuf_mtod(mb, const struct ether_header *); - if (eth->ether_type == __builtin_bswap16(ETHERTYPE_ARP)) + if (eth->ether_type == htons(ETHERTYPE_ARP)) rte_pktmbuf_dump(stdout, mb, 64); return 1;