[v4,2/3] examples/ip_fragmentation: enable IP checksum offload

Message ID 20190708043300.44295-2-jerinj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series None |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail apply issues

Commit Message

Jerin Jacob Kollanukkaran July 8, 2019, 4:32 a.m. UTC
  From: Sunil Kumar Kori <skori@marvell.com>

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>
---
v4:
- Rebased to top of tree
- Fix check-gitlog.sh issues
---
 examples/ip_fragmentation/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 85c0100f7..ccaf23ff0 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;