From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A390EA04BC for ; Thu, 8 Oct 2020 07:24:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 80DB11BAC7; Thu, 8 Oct 2020 07:24:03 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 89B311B6F6 for ; Thu, 8 Oct 2020 07:23:44 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201008052344euoutp01d79df3f20d6514c048a12b53ee18ae7a~77PPQN2Bw2347823478euoutp01_ for ; Thu, 8 Oct 2020 05:23:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201008052344euoutp01d79df3f20d6514c048a12b53ee18ae7a~77PPQN2Bw2347823478euoutp01_ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1602134624; bh=Mf1tYMpRrpiHimFKfjMxNVXK98BWt+Vs7ADSETF/S1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kQoFCd0AHmgntxbEkTlDrHgV4hBoSQaYn0dP6viH74V3t/yUyCDZAsHhiG5NcQoRW 7PiYilsl9JHKso5jtAaVldyelQ4Q+jeFjCO3HE0f4mvMtyd9bwcOztJwrokjIBBGpy /JTWh2hzR3r2zD8T8XubnClSOJPirfWwf2SmIfCY= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201008052343eucas1p20225096822953452417112fcc8e15111~77POugu432933529335eucas1p2e; Thu, 8 Oct 2020 05:23:43 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 90.AD.06318.F52AE7F5; Thu, 8 Oct 2020 06:23:43 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201008052343eucas1p1649655353d6c76cdf6320a04e8d43f32~77POcFZJn1098510985eucas1p1Z; Thu, 8 Oct 2020 05:23:43 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201008052343eusmtrp1490f570bffee265c6af7327d4d490e73~77PObgqH92941629416eusmtrp1W; Thu, 8 Oct 2020 05:23:43 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-b2-5f7ea25f85fc Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 29.89.06314.F52AE7F5; Thu, 8 Oct 2020 06:23:43 +0100 (BST) Received: from Padamandas.fritz.box (unknown [106.210.88.70]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201008052342eusmtip1374f2316f2e9ce555996538734639b0f~77PN6UYgC2786627866eusmtip1c; Thu, 8 Oct 2020 05:23:42 +0000 (GMT) From: Lukasz Wojciechowski To: David Hunt , Bruce Richardson Cc: dev@dpdk.org, l.wojciechow@partner.samsung.com, stable@dpdk.org Date: Thu, 8 Oct 2020 07:23:17 +0200 Message-Id: <20201008052323.11547-10-l.wojciechow@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201008052323.11547-1-l.wojciechow@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOIsWRmVeSWpSXmKPExsWy7djPc7rxi+riDVbO17G4screom/SRyaL d5+2M1k861nHaPGv4w+7A6vHrwVLWT0W73nJ5HHw3R6mAOYoLpuU1JzMstQifbsEroy3rSvY Cl7wVFx48oKlgfEVVxcjJ4eEgInEpCur2LsYuTiEBFYwStztXs8CkhAS+MIocfmEAUTiM6PE hiWTWWA6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BYPSdQ/Oz/u6wQuxoZJW6en8k2gZFvASPDKkaR1NLi3PTcYkO94sTc4tK8dL3k /NxNjMBQ3Hbs5+YdjJc2Bh9iFOBgVOLhNThaGy/EmlhWXJl7iFGCg1lJhNfp7Ok4Id6UxMqq 1KL8+KLSnNTiQ4ymQFdNZJYSTc4HxkleSbyhqaG5haWhubG5sZmFkjhvh8DBGCGB9MSS1OzU 1ILUIpg+Jg5OqQZGEaGUuNV1/ZnMq498tNr3tmWaxIQ5TqtertnNEtxo5OjPWP7ze5VHlUGn v7JtifKW5Zsiu3/qvV1pXxt3dvblg1+lDyZtSfvrdUO5Mtux/stuPbOHGjX/uLZeVsxaLxOv 0nsn69Pky7M13rzYefSyrRbHvR+ZKVa1fYc41xr6fZnomxvO1SWixFKckWioxVxUnAgAM1Gu A1sCAAA= X-CMS-MailID: 20201008052343eucas1p1649655353d6c76cdf6320a04e8d43f32 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20201008052343eucas1p1649655353d6c76cdf6320a04e8d43f32 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201008052343eucas1p1649655353d6c76cdf6320a04e8d43f32 References: <20200925224209.12173-1-l.wojciechow@partner.samsung.com> <20201008052323.11547-1-l.wojciechow@partner.samsung.com> Subject: [dpdk-stable] [PATCH v5 09/15] test/distributor: collect return mbufs 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" During quit_workers function distributor's main core processes some packets to wake up pending worker cores so they can quit. As quit_workers acts also as a cleanup procedure for next test case it should also collect these packages returned by workers' handlers, so the cyclic buffer with returned packets in distributor remains empty. Fixes: c3eabff124e6 ("distributor: add unit tests") Cc: bruce.richardson@intel.com Fixes: c0de0eb82e40 ("distributor: switch over to new API") Cc: david.hunt@intel.com Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski Acked-by: David Hunt --- app/test/test_distributor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c index d7f780acc..838a67515 100644 --- a/app/test/test_distributor.c +++ b/app/test/test_distributor.c @@ -590,6 +590,7 @@ quit_workers(struct worker_params *wp, struct rte_mempool *p) const unsigned num_workers = rte_lcore_count() - 1; unsigned i; struct rte_mbuf *bufs[RTE_MAX_LCORE]; + struct rte_mbuf *returns[RTE_MAX_LCORE]; if (rte_mempool_get_bulk(p, (void *)bufs, num_workers) != 0) { printf("line %d: Error getting mbufs from pool\n", __LINE__); return; @@ -605,6 +606,10 @@ quit_workers(struct worker_params *wp, struct rte_mempool *p) rte_distributor_flush(d); rte_eal_mp_wait_lcore(); + while (rte_distributor_returned_pkts(d, returns, RTE_MAX_LCORE)) + ; + + rte_distributor_clear_returns(d); rte_mempool_put_bulk(p, (void *)bufs, num_workers); quit = 0; -- 2.17.1