Checksum insertion has pktio interface level configuration
options. Per packet override is needed for example when
L4 checksumming is enabled and application forwards packets.
Forwarded packets need to maintain original, end-to-end checksum
value.

Signed-off-by: Petri Savolainen <[email protected]>
---
 include/odp/api/spec/packet.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index 92c35ae..42ef51f 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -1366,6 +1366,25 @@ uint32_t odp_packet_l4_offset(odp_packet_t pkt);
 int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset);
 
 /**
+ * Force checksum insertion
+ *
+ * Override checksum insertion configuration per packet.
+ *
+ * @param pkt     Packet handle
+ * @param l3       0: do not insert L3 checksum
+ *                 1: insert L3 checksum
+ *                -1: use default L3 checksum configuration
+ *
+ * @param l4       0: do not insert L4 checksum
+ *                 1: insert L4 checksum
+ *                -1: use default L4 checksum configuration
+ *
+ * @retval  0 on success
+ * @retval <0 on failure
+ */
+int odp_packet_chksum_force(odp_packet_t pkt, int l3, int l4);
+
+/**
  * Packet flow hash value
  *
  * Returns the hash generated from the packet header. Use
-- 
2.8.1

Reply via email to