Skip to content

Commit

Permalink
api: pktio: lso: add support for exact segment sizes
Browse files Browse the repository at this point in the history
Add an LSO profile flag (and a related capability flag) to request
that all non-last segments created by the custom protocol LSO have
exactly the maximum payload length and may not be shorter.

This makes it possible for an application to control the exact
segment sizes for custom protocols that may require it.

Signed-off-by: Janne Peltonen <[email protected]>
  • Loading branch information
JannePeltonen committed Nov 26, 2024
1 parent 7c742ba commit 1872a13
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions include/odp/api/spec/packet_io_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,8 @@ typedef enum odp_lso_protocol_t {
/** Custom protocol. LSO performs only custom field updates to the packet headers.
*
* All segments except the last one are of the same size for one original packet.
* The segment size may be lower than the maximum possible and can be different
* for different packets passed to LSO processing.
* If exact_payload_len is not set, the segment size may be lower than the maximum
* possible and can be different for different packets passed to LSO processing.
*/
ODP_LSO_PROTO_CUSTOM,

Expand Down Expand Up @@ -868,6 +868,10 @@ typedef struct odp_lso_capability_t {
* fields are not supported. */
uint8_t max_num_custom;

/** Support for exactly maximal payload length for all non-last segments in custom
* LSO protocol profiles. */
uint8_t exact_payload_len : 1;

/** Supported LSO protocol options */
struct {
/** ODP_LSO_PROTO_CUSTOM support */
Expand Down Expand Up @@ -1124,6 +1128,11 @@ typedef struct odp_lso_profile_param_t {
/** Number of custom fields specified. The default value is 0. */
uint8_t num_custom;

/** Configuration flags for custom protocol LSO */
struct {
/** Created segments have exactly the maximum allowed payload length. */
unsigned int exact_payload_len : 1;
} flags;
} custom;

} odp_lso_profile_param_t;
Expand Down

0 comments on commit 1872a13

Please sign in to comment.