Reset the DPDK HWOL checksum bad flags on dp_packet_init_.
This is an RFC as these flags should be managed by DPDK.

Signed-off-by: Darrell Ball <dlu...@gmail.com>
---
 lib/dp-packet.c |  1 +
 lib/dp-packet.h | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/lib/dp-packet.c b/lib/dp-packet.c
index 67aa406..3620b81 100644
--- a/lib/dp-packet.c
+++ b/lib/dp-packet.c
@@ -31,6 +31,7 @@ dp_packet_init__(struct dp_packet *b, size_t allocated, enum 
dp_packet_source so
     dp_packet_reset_offsets(b);
     pkt_metadata_init(&b->md, 0);
     dp_packet_rss_invalidate(b);
+    dp_packet_bad_checksum_reset(b);
     dp_packet_reset_cutlen(b);
     /* By default assume the packet type to be Ethernet. */
     b->packet_type = htonl(PT_ETH);
diff --git a/lib/dp-packet.h b/lib/dp-packet.h
index 9dbb611..c94c67b 100644
--- a/lib/dp-packet.h
+++ b/lib/dp-packet.h
@@ -625,6 +625,19 @@ dp_packet_ip_checksum_valid(struct dp_packet *p)
 #endif
 }
 
+static inline void
+dp_packet_bad_checksum_reset(struct dp_packet *p)
+{
+#ifdef DPDK_NETDEV
+    p->mbuf.ol_flags &= ~PKT_RX_IP_CKSUM_BAD;
+    p->mbuf.ol_flags &= ~PKT_RX_L4_CKSUM_BAD;
+#else
+    if (p) {
+       ;
+    }
+#endif
+}
+
 static inline bool
 dp_packet_ip_checksum_bad(struct dp_packet *p)
 {
-- 
1.9.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to