aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2016-07-29 13:52:58 +0100
committerKonstantin Ananyev <konstantin.ananyev@intel.com>2016-07-29 13:52:58 +0100
commit2e45b7a3cb16d2b4fdb8c2ad50c1a5a2361d19fa (patch)
treed5293e3bddca2e9785e4e0ac88de7e8a2523fb98 /examples
parent9c7aa95efd1120b3bbe3a214afd9ffb03afa7a6d (diff)
udpfwd: avoid loads blocked by stores while updating mbuf tx_offload
Change-Id: Id0b6e2cf176493188f6628f92700a3095ab6af85 Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/udpfwd/pkt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/examples/udpfwd/pkt.c b/examples/udpfwd/pkt.c
index 860d9a3..af87b08 100644
--- a/examples/udpfwd/pkt.c
+++ b/examples/udpfwd/pkt.c
@@ -16,12 +16,18 @@
#include "netbe.h"
#include <netinet/ip6.h>
+static inline uint64_t
+_mbuf_tx_offload(uint64_t il2, uint64_t il3, uint64_t il4, uint64_t tso,
+ uint64_t ol3, uint64_t ol2)
+{
+ return il2 | il3 << 7 | il4 << 16 | tso << 24 | ol3 << 40 | ol2 << 49;
+}
+
+
static inline void
fill_pkt_hdr_len(struct rte_mbuf *m, uint32_t l2, uint32_t l3, uint32_t l4)
{
- m->l2_len = l2;
- m->l3_len = l3;
- m->l4_len = l4;
+ m->tx_offload = _mbuf_tx_offload(l2, l3, l4, 0, 0, 0);
}
static inline int