From 18700d66eb9ac6d32ca7f5770d3dc4cc9a579310 Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Tue, 10 Dec 2024 10:46:30 +0200 Subject: [PATCH] validation: pktio: lso: check that custom segments are of maximum length Check that the non-last segments of a custom LSO protocol have the maximum payload length as promised by the API. Signed-off-by: Janne Peltonen Reviewed-by: Matias Elo Reviewed-by: Nithin Dabilpuram --- test/validation/api/pktio/lso.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/validation/api/pktio/lso.c b/test/validation/api/pktio/lso.c index 13e3085c28..dcadb48fb7 100644 --- a/test/validation/api/pktio/lso.c +++ b/test/validation/api/pktio/lso.c @@ -741,6 +741,7 @@ static void lso_test(odp_lso_profile_param_t param, uint32_t max_payload, uint32_t offset, len, payload_len, payload_sum; odp_packet_t pkt_out[MAX_NUM_SEG]; uint32_t sent_payload = pkt_len - hdr_len; + const int is_custom_proto = (param.lso_proto == ODP_LSO_PROTO_CUSTOM); profile = odp_lso_profile_create(pktio_a->hdl, ¶m); CU_ASSERT_FATAL(profile != ODP_LSO_PROFILE_INVALID); @@ -795,6 +796,8 @@ static void lso_test(odp_lso_profile_param_t param, uint32_t max_payload, } CU_ASSERT(payload_len <= max_payload); + if (is_custom_proto && seg_num < num - 1) + CU_ASSERT(payload_len == max_payload); if (compare_data(seg, hdr_len, test_packet + offset, payload_len) >= 0) { ODPH_ERR(" Payload compare failed at offset %u\n", offset);