diff mbox

[API-NEXT,1/5] linux-generic: packet: correct tail trunc logic

Message ID 1461546799-18112-2-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer April 25, 2016, 1:13 a.m. UTC
Correct the calculation of number of segmnets to
trim on odp_packet_trunc_tail() calls.

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 platform/linux-generic/include/odp_packet_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
index 43607b0..9ea95c3 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -257,7 +257,7 @@  static inline int push_tail_seg(odp_packet_hdr_t *pkt_hdr, size_t len)
 
 static inline void pull_tail_seg(odp_packet_hdr_t *pkt_hdr)
 {
-	uint32_t extrasegs = (pkt_hdr->tailroom - 1) / pkt_hdr->buf_hdr.segsize;
+	uint32_t extrasegs = pkt_hdr->tailroom / pkt_hdr->buf_hdr.segsize;
 
 	seg_free_tail(&pkt_hdr->buf_hdr, extrasegs);
 	pkt_hdr->tailroom -= extrasegs * pkt_hdr->buf_hdr.segsize;