X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_mbuf%2Frte_mbuf.c;h=8a456e5e64dfcf5307a8d8969a7e01ba8f19c024;hb=97742c7b0ab3634a4d5e6215eae5f897a00d3296;hp=220eb2fb0c58d6684d5f2124cd5dd33c108df7c2;hpb=f2fc83b40f06da6a6b2476005279ba52d4ce3c44;p=dpdk.git diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 220eb2fb0c..8a456e5e64 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -191,14 +190,14 @@ __rte_pktmbuf_init_extmem(struct rte_mempool *mp, ext_mem = ctx->ext_mem + ctx->ext; RTE_ASSERT(ctx->ext < ctx->ext_num); - RTE_ASSERT(ctx->off < ext_mem->buf_len); + RTE_ASSERT(ctx->off + ext_mem->elt_size <= ext_mem->buf_len); m->buf_addr = RTE_PTR_ADD(ext_mem->buf_ptr, ctx->off); m->buf_iova = ext_mem->buf_iova == RTE_BAD_IOVA ? RTE_BAD_IOVA : (ext_mem->buf_iova + ctx->off); ctx->off += ext_mem->elt_size; - if (ctx->off >= ext_mem->buf_len) { + if (ctx->off + ext_mem->elt_size > ext_mem->buf_len) { ctx->off = 0; ++ctx->ext; }