From de76ba1c47274590cec98a99ff2f8dd8a422a5a1 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Mon, 25 Nov 2024 09:48:30 +0000 Subject: [PATCH] api: pktio: lso: promise maximum-sized segments for the custom proto Specify that all segments, except the last one, have the maximum payload length with the custom protocol. Rounding down the payload length by ODP implementations would be problematic for certain custom protocols that need to know the exact length of the segments in advance. Signed-off-by: Janne Peltonen Reviewed-by: Matias Elo Reviewed-by: Petri Savolainen Reviewed-by: Nithin Dabilpuram --- include/odp/api/spec/packet_io_types.h | 6 +++++- include/odp/api/spec/packet_types.h | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/odp/api/spec/packet_io_types.h b/include/odp/api/spec/packet_io_types.h index 9e56e087aa..b4373266d3 100644 --- a/include/odp/api/spec/packet_io_types.h +++ b/include/odp/api/spec/packet_io_types.h @@ -789,7 +789,11 @@ typedef enum odp_lso_protocol_t { /** Protocol not selected. */ ODP_LSO_PROTO_NONE = 0, - /** Custom protocol. LSO performs only custom field updates to the packet headers. */ + /** Custom protocol. LSO performs only custom field updates to the packet headers. + * + * All segments except the last one have exactly the maximum number of payload + * bytes as given by the max_payload_len parameter in odp_packet_lso_opt_t. + */ ODP_LSO_PROTO_CUSTOM, /** LSO performs IPv4 fragmentation. diff --git a/include/odp/api/spec/packet_types.h b/include/odp/api/spec/packet_types.h index b9d55abde8..33f00b8b5d 100644 --- a/include/odp/api/spec/packet_types.h +++ b/include/odp/api/spec/packet_types.h @@ -407,9 +407,10 @@ typedef struct odp_packet_lso_opt_t { /** Maximum payload length in an LSO segment * * Max_payload_len parameter defines the maximum number of payload bytes in each - * created segment. Depending on the implementation, segments with less payload may be - * created. However, this value is used typically to divide packet payload evenly over - * all segments except the last one, which contains the remaining payload bytes. + * created segment. Depending on the implementation and the LSO profile, segments + * with less payload may be created. However, this value is used typically to divide + * packet payload evenly over all segments except the last one, which contains the + * remaining payload bytes. */ uint32_t max_payload_len;