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 A2707A04B1; Sat, 10 Oct 2020 18:05:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AFEC41D8FC; Sat, 10 Oct 2020 18:05:31 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 083ED1D8F0 for ; Sat, 10 Oct 2020 18:05:30 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201010160519euoutp022dcca4ef921a15f864aa78fb75aa60d9~8rR_8iQUM2850728507euoutp02X for ; Sat, 10 Oct 2020 16:05:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201010160519euoutp022dcca4ef921a15f864aa78fb75aa60d9~8rR_8iQUM2850728507euoutp02X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1602345919; bh=g/MRGUc0+qZ9uoRMSodl/6VtA2Zp/OeN5/Tl9zRRsw4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LsYPRkskYPQwnVSLt2n25HVaLl8tpxmJ3K+G28NMYzEnE6kpN2aDWa1GtbSVlRhwO jIQwnCsWUhoe8/CT7CDJh3QOSFgByior7t73UGMQ/3fJQdu5YqQjiHQAjmm2zTVi0C NZ+F2Pas9J1DFK2grrgZHzzQY4HGqxZfYIIx6m5M= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201010160513eucas1p196ee886ad77410afd5d23eb684d14aa5~8rR5_hQoQ2418924189eucas1p1s; Sat, 10 Oct 2020 16:05:13 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id E4.58.05997.9BBD18F5; Sat, 10 Oct 2020 17:05:13 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201010160513eucas1p1fbacf1f82c40d65aef40634f245c4206~8rR5oBWKZ2308623086eucas1p1p; Sat, 10 Oct 2020 16:05:13 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201010160513eusmtrp26fbe59d00837f0c057c1552946d8918a~8rR5ndVDe1692616926eusmtrp2C; Sat, 10 Oct 2020 16:05:13 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-53-5f81dbb9e33b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 83.5A.06314.9BBD18F5; Sat, 10 Oct 2020 17:05:13 +0100 (BST) Received: from Padamandas.fritz.box (unknown [106.210.88.70]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201010160512eusmtip1eac3c7a308df070df17a3ffbdee07585~8rR5DdYVW2442224422eusmtip1u; Sat, 10 Oct 2020 16:05:12 +0000 (GMT) From: Lukasz Wojciechowski To: Cc: dev@dpdk.org, l.wojciechow@partner.samsung.com Date: Sat, 10 Oct 2020 18:04:51 +0200 Message-Id: <20201010160508.19709-1-l.wojciechow@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201009220202.20834-1-l.wojciechow@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMIsWRmVeSWpSXmKPExsWy7djPc7o7bzfGGyzda2jx7tN2JotnPesY HZg8fi1Yyupx8N0epgCmKC6blNSczLLUIn27BK6Ma5+/sRdcFau4cmUrcwNjp1AXIyeHhICJ xMOpTcxdjFwcQgIrGCWedsyGcr4wSpzbe4QJwvnMKHHs6RJWmJaj/9YygthCAssZJY7P94aw PzFKbP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pecn7uJERhk24793LyD8dLG4EOMAhyM Sjy8Eqca44VYE8uKK3MPMUpwMCuJ8DqdPR0nxJuSWFmVWpQfX1Sak1p8iNEU6KiJzFKiyfnA CMgriTc0NTS3sDQ0NzY3NrNQEuftEDgYIySQnliSmp2aWpBaBNPHxMEp1cDI1i1mOKendu0O 2yU5mb/unKuSmtckvX7n20fnvt3LeJFYfX2nYaPJ78M3RNe6xHzzDz+VPWGSzcbNUX57j245 Xj4xLvLtKq4MkwRDk4uG89cmuqX8ZVbuLH3EVKFftrX0Vdh8G6dIPcnoVxUKQQUl3cob0ua2 eFszVzsaiD7YrSXJIu39XV2JpTgj0VCLuag4EQBliRV9SAIAAA== X-CMS-MailID: 20201010160513eucas1p1fbacf1f82c40d65aef40634f245c4206 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20201010160513eucas1p1fbacf1f82c40d65aef40634f245c4206 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201010160513eucas1p1fbacf1f82c40d65aef40634f245c4206 References: <20201009220202.20834-1-l.wojciechow@partner.samsung.com> Subject: [dpdk-dev] [PATCH v7 00/16] fix distributor synchronization issues 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" During review and verification of the patch created by Sarosh Arif: "test_distributor: prevent memory leakages from the pool" I found out that running distributor unit tests multiple times in a row causes fails. So I investigated all the issues I found. There are few synchronization issues that might cause deadlocks or corrupted data. They are fixed with this set of patches for both tests and librte_distributor library. --- v7: * add patch 16 ensuring that tests will try sending packets until workers are started and requested for packets v6: * fix comments indentation * fix stats atomic operations memory mode from ACQUIRE/RELEASE to RELAXED v5: * implement missing functionality in burst mode - worker shutdown * fix shutdown test to always shutdown busy worker * use atomic stores instead of barrier in tests clear_packet_count() * reorder patches * new patch 7: fix call to return_pkt in single mode * new patch 11: replacing delays with spinlock on atomics in tests * new patch 12: fix scalar matching algorithm * new patch 13: new test with marking and checking every packet * new patch 14: flush also in flight packets * new patch 15: fix clearing returns buffer * minor fixes in other patches v4: * adjust commit name prefixes app/test -> test/distributor: * reorder patches * use NULL oldpkt in rte_distributor_get_pkt() calls in tests v3: * add missing acked and tested by statements from v1 v2: * assign NULL to freed mbufs in distributor test * fix handshake check on legacy single distributor rte_distributor_return_pkt_single() * add patch 7 passing NULL to legacy API calls if no bufs are returned * add patch 8 fixing API documentation Lukasz Wojciechowski (16): distributor: fix missing handshake synchronization distributor: fix handshake deadlock distributor: do not use oldpkt when not needed distributor: handle worker shutdown in burst mode test/distributor: fix shutdown of busy worker test/distributor: synchronize lcores statistics distributor: fix return pkt calls in single mode test/distributor: fix freeing mbufs test/distributor: collect return mbufs distributor: align API documentation with code test/distributor: replace delays with spin locks distributor: fix scalar matching test/distributor: add test with packets marking distributor: fix flushing in flight packets distributor: fix clearing returns buffer test/distributor: ensure all packets are delivered app/test/test_distributor.c | 347 ++++++++++++++---- lib/librte_distributor/distributor_private.h | 3 + lib/librte_distributor/rte_distributor.c | 219 ++++++++--- lib/librte_distributor/rte_distributor.h | 23 +- .../rte_distributor_single.c | 4 + 5 files changed, 471 insertions(+), 125 deletions(-) -- 2.17.1