Skip to content

Commit

Permalink
validation: pktio: lso: check that custom segments are of maximum length
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Matias Elo <[email protected]>
Reviewed-by: Nithin Dabilpuram <[email protected]>
  • Loading branch information
JannePeltonen committed Dec 17, 2024
1 parent de76ba1 commit 18700d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/validation/api/pktio/lso.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &param);
CU_ASSERT_FATAL(profile != ODP_LSO_PROFILE_INVALID);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 18700d6

Please sign in to comment.