aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/pktio
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2021-07-20 16:26:29 +0300
committerPetri Savolainen <petri.savolainen@nokia.com>2021-08-16 13:51:25 +0300
commit76761fa33bd112d1fccf197941a23768d7d20c58 (patch)
tree24bc4eab8b06d044226b4f3cb67de8f8f2500194 /platform/linux-generic/pktio
parent2718517ea83baf8cbe8a6fb85e86e378dd76ce89 (diff)
linux-gen: dpdk: fix invalid mbuf data offset
Fix the check in mbuf_update() which detects if mbuf data offset needs to be updated. The previous check didn't detect a scenario where data offset was not at default value (caused by e.g. odp_packet_push_head()). Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com> Reported-and-tested-by: Christian Hong <guochun.hgc@alibaba-inc.com>
Diffstat (limited to 'platform/linux-generic/pktio')
-rw-r--r--platform/linux-generic/pktio/dpdk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c
index a98324ee4..9abba6292 100644
--- a/platform/linux-generic/pktio/dpdk.c
+++ b/platform/linux-generic/pktio/dpdk.c
@@ -288,7 +288,7 @@ static inline void mbuf_update(struct rte_mbuf *mbuf, odp_packet_hdr_t *pkt_hdr,
mbuf->refcnt = 1;
mbuf->ol_flags = 0;
- if (odp_unlikely(pkt_hdr->buf_hdr.base_data != pkt_hdr->seg_data))
+ if (odp_unlikely(((uint8_t *)mbuf->buf_addr + mbuf->data_off) != pkt_hdr->seg_data))
mbuf->data_off = mbuf_data_off(mbuf, pkt_hdr);
}