From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 3FE5FDED; Thu, 3 May 2018 18:02:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2018 09:02:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,359,1520924400"; d="scan'208";a="46517645" Received: from dhunt5-mobl2.ger.corp.intel.com (HELO [10.237.221.55]) ([10.237.221.55]) by FMSMGA003.fm.intel.com with ESMTP; 03 May 2018 09:02:29 -0700 To: Reshma Pattan , dev@dpdk.org Cc: stable@dpdk.org References: <1525362123-22326-1-git-send-email-reshma.pattan@intel.com> From: "Hunt, David" Message-ID: Date: Thu, 3 May 2018 17:03:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1525362123-22326-1-git-send-email-reshma.pattan@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH] app/test: fix reorder test failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2018 16:02:31 -0000 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.