aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@linaro.org>2017-09-05 15:36:04 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-09-15 18:40:04 +0300
commit3e03317f3663abc76708141233b18d6225b2482b (patch)
tree3241e415035bd6940ef89baa5f14944c3e066525
parentcc6d4562f16e134299e21ca3e545999c97549ad0 (diff)
api: packet: add checksum status
Added functions to request L3/L4 checksum check status for a packet. Even if checksum checking is enabled on an interface, all packets may not be checked - for example L4 checksum cannot be checked for fragments (before reassembly). Also it varies how e.g. IP options affect HW checksum capability. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--include/odp/api/spec/packet.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index 95f5349b2..b3e1449ff 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -83,6 +83,22 @@ typedef struct odp_packet_data_range {
} odp_packet_data_range_t;
+/**
+ * Checksum check status in packet
+ */
+typedef enum odp_packet_chksum_status_t {
+ /** Checksum was not checked. Checksum check was not attempted or
+ * the attempt failed. */
+ ODP_PACKET_CHKSUM_UNKNOWN = 0,
+
+ /** Checksum was checked and it was not correct */
+ ODP_PACKET_CHKSUM_BAD,
+
+ /** Checksum was checked and it was correct */
+ ODP_PACKET_CHKSUM_OK
+
+} odp_packet_chksum_status_t;
+
/*
*
* Alloc and free
@@ -1378,6 +1394,34 @@ uint32_t odp_packet_l4_offset(odp_packet_t pkt);
int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset);
/**
+ * Layer 3 checksum check status
+ *
+ * Returns the result of the latest layer 3 checksum check done for the packet.
+ * The status tells if checksum check was attempted and the result of the
+ * attempt. It depends on packet input (or IPSEC) configuration, packet content
+ * and implementation capabilities if checksum check is attempted for a packet.
+ *
+ * @param pkt Packet handle
+ *
+ * @return L3 checksum check status
+ */
+odp_packet_chksum_status_t odp_packet_l3_chksum_status(odp_packet_t pkt);
+
+/**
+ * Layer 4 checksum check status
+ *
+ * Returns the result of the latest layer 4 checksum check done for the packet.
+ * The status tells if checksum check was attempted and the result of the
+ * attempt. It depends on packet input (or IPSEC) configuration, packet content
+ * and implementation capabilities if checksum check is attempted for a packet.
+ *
+ * @param pkt Packet handle
+ *
+ * @return L4 checksum check status
+ */
+odp_packet_chksum_status_t odp_packet_l4_chksum_status(odp_packet_t pkt);
+
+/**
* Layer 3 checksum insertion override
*
* Override checksum insertion configuration per packet. This per packet setting