examples/ip_frag: fix Tx un-fragmented packets
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Thu, 18 Jul 2019 10:11:12 +0000 (11:11 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 18 Jul 2019 21:05:36 +0000 (23:05 +0200)
commitb869cbc955382d67aa2cc5318933a579099869b9
tree9fc5bdb00826b4e83d45387b43af6fb98c7e3c09
parent6b7780bfebe4de743c5edbe7a3c7f9fa817789ad
examples/ip_frag: fix Tx un-fragmented packets

With latest changes l3fwd_simple_forward() blindly set
(PKT_TX_IPV4 | PKT_TX_IP_CKSUM) ol_flags for all IPv4 packets.
Though for un-fragmented packets we also do have to set l3_len
to make HW IP cksum offload to work properly.
That causes HW/PMD to drop or generate invalid packets.
Though for un-fragmented packets we don't need to regenerate
IPv4 cksum, as L3 header is not modified.
Fix by setting ol_flags only when required.

Fixes: 16863bbb4a41 ("examples/ip_fragmentation: enable IP checksum offload")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
examples/ip_fragmentation/main.c