Petri Savolainen(psavol) replied on github web page:

include/odp/api/spec/packet_io.h
line 58
@@ -314,13 +330,27 @@ typedef union odp_pktin_config_opt_t {
  * Packet output configuration options listed in a bit field structure. Packet
  * output checksum insertion may be enabled or disabled. When it is enabled,
  * implementation will calculate and insert checksum into every outgoing packet
- * by default. Application may use a packet metadata flag to disable checksum
- * insertion per packet bases. For correct operation, packet metadata must
- * provide valid offsets for the appropriate protocols. For example, UDP
- * checksum calculation needs both L3 and L4 offsets (to access IP and UDP
- * headers). When application (e.g. a switch) does not modify L3/L4 data and
- * thus checksum does not need to be updated, output checksum insertion should
- * be disabled for optimal performance.
+ * by default. Application may disable checksum insertion (e.g.
+ * odp_packet_l4_chksum_insert()) on per packet basis. For correct operation,
+ * packet metadata must provide valid offsets for the appropriate protocols.
+ * For example, UDP checksum calculation needs both L3 and L4 offsets (to 
access
+ * IP and UDP headers). When application (e.g. a switch) does not modify L3/L4
+ * data and thus checksum does not need to be updated, output checksum 
insertion
+ * should be disabled for optimal performance.
+ *
+ * Packet flags (odp_packet_has_*()) are ignored for the purpose of checksum
+ * insertion in packet output.
+ *
+ * UDP, TCP and SCTP checksum insertion must not be requested for IP fragments.
+ * Use checksum override function (odp_packet_l4_chksum_insert()) to disable
+ * checksumming when sending a fragment through a packet IO interface that has
+ * the relevant L4 checksum insertion enabled.


Comment:
This talks **application** passing fragments to ODP for L4 checksum insertion. 
When ODP IPsec inline creates fragments, application does not have control on 
those (no need for API spec) and obviously implementation must not trick itself 
(it's an implementation internal bug to create a fragment and ask output HW to 
insert L4 checksum for those).

Application passes full packet to IPSEC with fragmentation and L4 checksum 
offload requests - implementation inserts L4 checksum, does fragmentation if 
needed, passes new packets back to user or directly to output (in case of 
inline).

https://github.com/Linaro/odp/pull/167#discussion_r137726540
updated_at 2017-09-08 07:36:09

Reply via email to