summaryrefslogtreecommitdiff
path: root/app/test/packet_burst_generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/test/packet_burst_generator.c')
-rw-r--r--app/test/packet_burst_generator.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index 06762c6..28d9e25 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -59,7 +59,7 @@ copy_buf_to_pkt_segs(void *buf, unsigned len, struct rte_mbuf *pkt,
seg = seg->next;
}
copy_len = seg->data_len - offset;
- seg_buf = rte_pktmbuf_mtod(seg, char *) + offset;
+ seg_buf = rte_pktmbuf_mtod_offset(seg, char *, offset);
while (len > copy_len) {
rte_memcpy(seg_buf, buf, (size_t) copy_len);
len -= copy_len;
@@ -74,7 +74,8 @@ static inline void
copy_buf_to_pkt(void *buf, unsigned len, struct rte_mbuf *pkt, unsigned offset)
{
if (offset + len <= pkt->data_len) {
- rte_memcpy(rte_pktmbuf_mtod(pkt, char *) + offset, buf, (size_t) len);
+ rte_memcpy(rte_pktmbuf_mtod_offset(pkt, char *, offset), buf,
+ (size_t) len);
return;
}
copy_buf_to_pkt_segs(buf, len, pkt, offset);