[2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf

Message ID 1558005716-30083-3-git-send-email-skori@marvell.com (mailing list archive)
State Superseded, archived
Headers
Series Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Sunil Kumar Kori May 16, 2019, 11:21 a.m. UTC
  Change-Id: I616dc217a96f0bd4c77dd70959dff3c208524f84
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 examples/ip_fragmentation/main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index e90a61e..d821967 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -354,10 +354,13 @@  struct rte_lpm6_config lpm6_config = {
 
 		/* src addr */
 		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(ETHER_TYPE_IPv6);
-		else
+			m->ol_flags |= PKT_TX_IPV6;
+		} else {
 			eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv4);
+			m->ol_flags |= (PKT_TX_IPV4 | PKT_TX_IP_CKSUM);
+		}
 	}
 
 	len += len2;