Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page:

include/odp/api/spec/packet.h
line 10
@@ -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,


Comment:
Then perhaps the 0 enum should be `ODP_PACKET_CHECKSUM_NORMAL` where "normal" 
is interpreted as OK if checksum offload was requested and "unknown" if it was 
not requested. The enum is then simply either NORMAL or BAD. The point is the 
only thing the application really wants to know is whether the checksum is bad 
or not. If it's disabled checksumming for whatever reason then presumably it 
doesn't care. 

If we reduce the enum to only two values, then it can simply collapse into a 
"bad" bit that's set if we know the checksum is incorrect and left as 0 
otherwise. The 0 means it's OK if we are checking checksums and unknown if we 
don't care about them.

https://github.com/Linaro/odp/pull/167#discussion_r137663579
updated_at 2017-09-07 21:48:36

Reply via email to