From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 384D72C13 for ; Wed, 28 Jun 2017 14:25:49 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from vasilyf@mellanox.com) with ESMTPS (AES256-SHA encrypted); 28 Jun 2017 15:25:25 +0300 Received: from hpchead.mtr.labs.mlnx. (hpchead.mtr.labs.mlnx [10.209.44.59]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v5SCPPWh001341; Wed, 28 Jun 2017 15:25:25 +0300 Received: from hpchead.mtr.labs.mlnx. (localhost.localdomain [127.0.0.1]) by hpchead.mtr.labs.mlnx. (8.14.7/8.14.7) with ESMTP id v5SCPPFo032615; Wed, 28 Jun 2017 15:25:25 +0300 Received: (from vasilyf@localhost) by hpchead.mtr.labs.mlnx. (8.14.7/8.14.7/Submit) id v5SCPPt6032483; Wed, 28 Jun 2017 15:25:25 +0300 From: Vasily Philipov To: olivier.matz@6wind.com Cc: Vasily Philipov , dev@dpdk.org, stable@dpdk.org Date: Wed, 28 Jun 2017 15:25:12 +0300 Message-Id: <90afb772790da3a10d3ada97dd843ccd94a8c3f8.1498652244.git.vasilyf@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [PATCH] mbuf: fix debug checks for headroom and tailroom X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2017 12:25:49 -0000 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 --- lib/librte_mbuf/rte_mbuf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index fe605c7..fbe8203 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); } -- 1.8.3.1