This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, api-next has been updated via f91cde2bb770eefcfe791ce49c67ce3b1f5bf6d2 (commit) via 3e03317f3663abc76708141233b18d6225b2482b (commit) via cc6d4562f16e134299e21ca3e545999c97549ad0 (commit) via 80321bd9880b03929056483be9bc9d8861636b33 (commit) via e1c46f8e296a730ed27141a33189185bb7dfd1b1 (commit) via 054306373ed6aa7a65a160d11ca339b24cf9c662 (commit) via a38ea82cf1ae45b7c807164dde5783d099efd39d (commit) from 8c5516bba62ee7250cbf64d1f4b89ee4f0b12824 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit f91cde2bb770eefcfe791ce49c67ce3b1f5bf6d2 Author: Petri Savolainen petri.savolainen@linaro.org Date: Tue Sep 5 16:01:55 2017 +0300
api: packet_io: refine rules for checksum calculation
An implementation must be able to check checksum for normal IP packets. It's implementation defined if options or extension headers are supported.
Parsing configuration must match the layers of checksum check configuration.
Checksum insertion on packet output can expect well formed packet headers from the application. Checksum calculation ignores possible extra data in the packet.
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
diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h index 7085bc0d..0b36b864 100644 --- a/include/odp/api/spec/ipsec.h +++ b/include/odp/api/spec/ipsec.h @@ -156,7 +156,9 @@ typedef struct odp_ipsec_inbound_config_t { odp_ipsec_proto_layer_t parse;
/** Flags to control IPSEC payload data checks up to the selected parse - * level. */ + * level. Checksum checking status can be queried for each packet with + * odp_packet_l3_chksum_status() and odp_packet_l4_chksum_status(). + */ union { /** Mapping for individual bits */ struct { @@ -191,10 +193,12 @@ typedef struct odp_ipsec_inbound_config_t { */ typedef struct odp_ipsec_outbound_config_t { /** Flags to control L3/L4 checksum insertion as part of outbound - * packet processing. Packet must have set with valid L3/L4 offsets. - * Checksum configuration is ignored for packets that checksum cannot - * be computed for (e.g. IPv4 fragments). Application may use a packet - * metadata flag to disable checksum insertion per packet bases. + * packet processing. These flags control checksum insertion (for the + * payload packet) in the same way as the checksum flags in + * odp_pktout_config_opt_t control checksum insertion when sending + * packets out through a pktio interface. Also packet checksum override + * functions (e.g. odp_packet_l4_chksum_insert()) can be used in + * the same way. */ union { /** Mapping for individual bits */ diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index b3e1449f..c498e2e2 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -1428,6 +1428,10 @@ odp_packet_chksum_status_t odp_packet_l4_chksum_status(odp_packet_t pkt); * overrides a higher level configuration for checksum insertion into a L3 * header during packet output processing. * + * Calling this function is always allowed but the checksum will not be + * inserted if the packet is output through a pktio that does not have + * the relevant pktout chksum bit set in the pktio capability. + * * @param pkt Packet handle * @param l3 0: do not insert L3 checksum * 1: insert L3 checksum @@ -1441,6 +1445,10 @@ void odp_packet_l3_chksum_insert(odp_packet_t pkt, int l3); * overrides a higher level configuration for checksum insertion into a L4 * header during packet output processing. * + * Calling this function is always allowed but the checksum will not be + * inserted if the packet is output through a pktio that does not have + * the relevant pktout chksum bit set in the pktio capability. + * * @param pkt Packet handle * @param l4 0: do not insert L4 checksum * 1: insert L4 checksum diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index 6040a831..b56a5205 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -256,11 +256,27 @@ typedef struct odp_pktio_param_t { * belong to time synchronization protocol (PTP). * * Packet input checksum checking may be enabled or disabled. When it is - * enabled, implementation will verify checksum correctness on incoming packets - * and depending on drop configuration either deliver erroneous packets with - * appropriate flags set (e.g. odp_packet_has_l3_error()) or drop those. - * When packet dropping is enabled, application will never receive a packet - * with the specified error and may avoid to check the error flag. + * enabled, implementation will attempt to verify checksum correctness on + * incoming packets and depending on drop configuration either deliver erroneous + * packets with appropriate flags set (e.g. odp_packet_has_l3_error(), + * odp_packet_l3_chksum_status()) or drop those. When packet dropping is + * enabled, application will never receive a packet with the specified error + * and may avoid to check the error flag. + * + * If checksum checking is enabled, IPv4 header checksum checking is always + * done for packets that do not have IP options and L4 checksum checking + * is done for unfragmented packets that do not have IPv4 options or IPv6 + * extension headers. In other cases checksum checking may or may not + * be done. For example, L4 checksum of fragmented packets is typically + * not checked. + * + * IPv4 checksum checking may be enabled only when parsing level is + * ODP_PKTIO_PARSER_LAYER_L3 or higher. Similarly, L4 level checksum checking + * may be enabled only with parsing level ODP_PKTIO_PARSER_LAYER_L4 or higher. + * + * Whether checksum checking was done and whether a checksum was correct + * can be queried for each received packet with odp_packet_l3_chksum_status() + * and odp_packet_l4_chksum_status(). */ typedef union odp_pktin_config_opt_t { /** Option flags */ @@ -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. + * + * Result of checksum insertion at packet output is undefined if the protocol + * headers required for checksum calculation are not well formed. Packet must + * contain at least as many data bytes after L3/L4 offsets as the headers + * indicate. Other data bytes of the packet are ignored for the checksum + * insertion. */ typedef union odp_pktout_config_opt_t { /** Option flags */
commit 3e03317f3663abc76708141233b18d6225b2482b Author: Petri Savolainen petri.savolainen@linaro.org Date: Tue Sep 5 15:36:04 2017 +0300
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
diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 95f5349b..b3e1449f 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
commit cc6d4562f16e134299e21ca3e545999c97549ad0 Author: Petri Savolainen petri.savolainen@linaro.org Date: Tue Sep 5 13:46:58 2017 +0300
api: packet_io: refine packet format on output
Define explicitly that (by default) packet output does not need any extra metadata to be set. Also (Ethernet) padding and CRC are added by default.
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
diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h index d42cebf0..6040a831 100644 --- a/include/odp/api/spec/packet_io.h +++ b/include/odp/api/spec/packet_io.h @@ -889,6 +889,11 @@ uint64_t odp_pktin_wait_time(uint64_t nsec); * is less than 'num', the remaining packets at the end of packets[] array * are not consumed, and the caller has to take care of them. * + * Entire packet data is sent out (odp_packet_len() bytes of data, starting from + * odp_packet_data()). All other packet metadata is ignored unless otherwise + * specified e.g. for protocol offload purposes. Link protocol specific frame + * checksum and padding are added to frames before transmission. + * * @param queue Packet output queue handle for sending packets * @param packets[] Array of packets to send * @param num Number of packets to send
commit 80321bd9880b03929056483be9bc9d8861636b33 Merge: 8c5516bb e1c46f8e Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Fri Sep 15 18:39:04 2017 +0300
Merge branch 'master' into api-next
diff --cc platform/linux-generic/include/odp_internal.h index ab935ff8,e0cc6dd4..a3516ded --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@@ -133,9 -130,8 +133,10 @@@ int _odp_ishm_init_local(void) int _odp_ishm_term_global(void); int _odp_ishm_term_local(void);
+int _odp_modules_init_global(void); + int cpuinfo_parser(FILE *file, system_info_t *sysinfo); + uint64_t odp_cpufreq_id(const char *filename, int id); uint64_t odp_cpu_hz_current(int id); void sys_info_print_arch(void);
-----------------------------------------------------------------------
Summary of changes: helper/include/odp/helper/ip.h | 11 ++++ helper/include/odph_list_internal.h | 22 +++++++- include/odp/api/spec/ipsec.h | 14 +++-- include/odp/api/spec/packet.h | 52 +++++++++++++++++++ include/odp/api/spec/packet_io.h | 59 +++++++++++++++++----- .../linux-generic/arch/arm/odp_sysinfo_parse.c | 5 -- .../linux-generic/arch/default/odp_sysinfo_parse.c | 5 -- .../linux-generic/arch/mips64/odp_sysinfo_parse.c | 5 -- .../linux-generic/arch/powerpc/odp_sysinfo_parse.c | 5 -- .../linux-generic/arch/x86/odp_sysinfo_parse.c | 36 ------------- platform/linux-generic/include/odp_internal.h | 1 + platform/linux-generic/odp_system_info.c | 37 ++++++++++++++ 12 files changed, 177 insertions(+), 75 deletions(-)
hooks/post-receive