summaryrefslogtreecommitdiff
path: root/examples/ip_fragmentation
diff options
context:
space:
mode:
authorSunil Kumar Kori <skori@marvell.com>2019-07-08 10:02:59 +0530
committerThomas Monjalon <thomas@monjalon.net>2019-07-08 11:04:01 +0200
commit16863bbb4a418bcc6ff420a6501b19c8b4b30481 (patch)
treec933b308baa83c8c3ebda53579755fe8b9ee8613 /examples/ip_fragmentation
parente29fc44370c23e3018af3eaae476568410cd6fd0 (diff)
downloaddpdk-16863bbb4a418bcc6ff420a6501b19c8b4b30481.zip
dpdk-16863bbb4a418bcc6ff420a6501b19c8b4b30481.tar.gz
dpdk-16863bbb4a418bcc6ff420a6501b19c8b4b30481.tar.xz
examples/ip_fragmentation: enable IP checksum offload
As per the documentation to use any IP offload features, application must set required offload flags into mbuf->ol_flags. Signed-off-by: Sunil Kumar Kori <skori@marvell.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'examples/ip_fragmentation')
-rw-r--r--examples/ip_fragmentation/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 85c0100..ccaf23f 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -357,12 +357,14 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
/* src addr */
rte_ether_addr_copy(&ports_eth_addr[port_out],
&eth_hdr->s_addr);
- if (ipv6)
+ if (ipv6) {
eth_hdr->ether_type =
rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV6);
- else
+ } else {
eth_hdr->ether_type =
rte_be_to_cpu_16(RTE_ETHER_TYPE_IPV4);
+ m->ol_flags |= (PKT_TX_IPV4 | PKT_TX_IP_CKSUM);
+ }
}
len += len2;