From: Vasily Philipov Date: Wed, 28 Jun 2017 12:25:12 +0000 (+0300) Subject: mbuf: fix debug checks for headroom and tailroom X-Git-Tag: spdx-start~2925 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=814baffdb6910c1a949bd7c5ce3c6807f703c799;p=dpdk.git mbuf: fix debug checks for headroom and tailroom rte_pktmbuf_headroom() and rte_pktmbuf_tailroom() should be usable with any segment, not only with headered ones, so is_header should be 0 when we call for sanity check inside them. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Vasily Philipov Acked-by: Olivier Matz --- diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index fe605c7a48..fbe8203de7 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1452,7 +1452,7 @@ static inline void rte_pktmbuf_refcnt_update(struct rte_mbuf *m, int16_t v) */ static inline uint16_t rte_pktmbuf_headroom(const struct rte_mbuf *m) { - __rte_mbuf_sanity_check(m, 1); + __rte_mbuf_sanity_check(m, 0); return m->data_off; } @@ -1466,7 +1466,7 @@ static inline uint16_t rte_pktmbuf_headroom(const struct rte_mbuf *m) */ static inline uint16_t rte_pktmbuf_tailroom(const struct rte_mbuf *m) { - __rte_mbuf_sanity_check(m, 1); + __rte_mbuf_sanity_check(m, 0); return (uint16_t)(m->buf_len - rte_pktmbuf_headroom(m) - m->data_len); }