aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/spec/packet.h
diff options
context:
space:
mode:
authorNithin Dabilpuram <ndabilpuram@marvell.com>2020-10-14 16:01:20 +0530
committerMatias Elo <matias.elo@nokia.com>2020-11-02 13:31:11 +0200
commit486b362a60d925f3f7e077776cae929d0709fdb5 (patch)
tree95c883414cf6afe11b59fdf91150b32b72047ced /include/odp/api/spec/packet.h
parent2115d54e86df65baf3b383be22399b4a21fe6e87 (diff)
api: pktio: change Tx checksum insertion API semantics
Existing API spec requires application to just provide L3 offset and and L4 offset and expects platform either in SW or HW parse the packet in Tx and identify L3 and L4 protocols and then generate checksum if requested. Since not all platforms have support for packet parsing in HW in Tx, they depend on software to provide L3 and L4 types in addition to existing L3 and L4 protocol offsets. Doing the parsing in platform SW for such cases brings down performance and is counter productive. Since similar to L3 and L4 offsets, even L3 and L4 proto types are provided by HW parser in packet ingress, making use of the same information in Tx is benefitial for performance. So this patch changes Tx checksum insertion semantics by mandating that application should have valid packet metadata for L3 and L4 type along with existing requirement of L3 and L4 offsets, and platform will make use of the same information for checksum calculation and insertion. Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
Diffstat (limited to 'include/odp/api/spec/packet.h')
-rw-r--r--include/odp/api/spec/packet.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index b2dcf28f2..924658e34 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -1830,9 +1830,14 @@ odp_packet_chksum_status_t odp_packet_l4_chksum_status(odp_packet_t pkt);
* inserted if the packet is output through a pktio that does not have
* the relevant checksum insertion enabled.
*
+ * L3 type and L3 offset in packet metadata should provide valid protocol
+ * and header offset for checksum insertion purposes.
+ *
* @param pkt Packet handle
* @param insert 0: do not insert L3 checksum
* 1: insert L3 checksum
+ *
+ * @see odp_packet_l3_offset(), odp_packet_has_ipv4(), odp_packet_has_ipv6()
*/
void odp_packet_l3_chksum_insert(odp_packet_t pkt, int insert);
@@ -1847,9 +1852,16 @@ void odp_packet_l3_chksum_insert(odp_packet_t pkt, int insert);
* inserted if the packet is output through a pktio that does not have
* the relevant checksum insertion enabled.
*
+ * L3 type, L4 type, L3 offset and L4 offset in packet metadata should provide
+ * valid protocols and header offsets for checksum insertion purposes.
+ *
* @param pkt Packet handle
* @param insert 0: do not insert L4 checksum
* 1: insert L4 checksum
+ *
+ * @see odp_packet_l3_offset(), odp_packet_has_ipv4(), odp_packet_has_ipv6()
+ * @see odp_packet_l4_offset(), odp_packet_has_tcp(), odp_packet_has_udp()
+ * @see odp_packet_has_sctp()
*/
void odp_packet_l4_chksum_insert(odp_packet_t pkt, int insert);