From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Hunt, David" Subject: Re: [PATCH] app/test: fix reorder test failure Date: Thu, 3 May 2018 17:03:29 +0100 Message-ID: References: <1525362123-22326-1-git-send-email-reshma.pattan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: stable@dpdk.org To: Reshma Pattan , dev@dpdk.org Return-path: In-Reply-To: <1525362123-22326-1-git-send-email-reshma.pattan@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 3/5/2018 4:42 PM, Reshma Pattan wrote: > Inside test_reorder_insert() > rte_mempool_get_bulk() and rte_mempool_put_bulk() are used > to allocate and free the mbufs and then rte_reorder_free() > is called which again freeing the mbufs using rte_pktmbuf_free(). > > The mixed use of rte_mempool_put_bulk() and rte_pktmbuf_free() > causing duplicate mbufs to be created when rte_mempool_get_bulk() > is called next in test_reorder_drain(). > > Since reorder library is taking care of freeing the mbufs > using rte_pktmbuf_free() change UT to allocate mbufs using > rte_pktmbuf_alloc(). > > Do not mix and match the bulk get/put APIs with > alloc/free APIs which can cause undefined behavior. > > Fixes: d0c9b58d71 ("app/test: new reorder unit test") > --snip-- Could I also suggest the following text for the commit message: app/test: fix reorder test failure mbufs are being freed twice in error, once in rte_mempool_put_bulk() and then in rte_reorder_free(). Refactor the code so that we use rte_reorder_free() to free mbufs in the reorder buffer, and use rte_pktmbuf_free() to free any unused or drained mbufs. Rgds, Dave.