Skip to content

Commit

Permalink
validation: dma: fix data comparison with segmented packets
Browse files Browse the repository at this point in the history
If for some reason, implementation reports longer packet segment length
that application requested, test ends up comparing uninitialized data.
Fix this by always comparing just the DMA transferred amount.

Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
  • Loading branch information
TuomasTaipale committed Oct 11, 2023
1 parent fc9e9ca commit efb4be0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/validation/api/dma/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,7 @@ static void test_dma_pkt_segs_to_addr_sync(void)
odp_packet_seg_t pkt_seg = odp_packet_first_seg(pkt);
uint8_t *src = odp_packet_data(pkt);
uint32_t seg_len = odp_packet_seg_len(pkt);
seg_len = MIN(len, seg_len);

src += OFFSET;
seg_len -= OFFSET;
Expand Down

0 comments on commit efb4be0

Please sign in to comment.