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 3CACAA04BC; Thu, 8 Oct 2020 07:24:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 080201B6A3; Thu, 8 Oct 2020 07:23:43 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 2B7285F13 for ; Thu, 8 Oct 2020 07:23:38 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201008052337euoutp027c53b42b2e23ca130efe6175ca59cc2b~77PIiT1W40408404084euoutp02j for ; Thu, 8 Oct 2020 05:23:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201008052337euoutp027c53b42b2e23ca130efe6175ca59cc2b~77PIiT1W40408404084euoutp02j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1602134617; bh=LttLRb70REzWDiW9VGXcwnPTFqqmp0S+jGME1Q0rmUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A9j/YSR08Qyox4r0GR6iTUTTmyO2DB7T49p9PYsYdxDfJwkLuNFb41Fcq4Z7WKXV7 8FNpEVfY4Usjh5W8SUAAn+myUIjLwRqE8FcWnDoR7smVM5OCfNRQ8qcyceZdSXrXGk ILdTw1EXe2ktZoMO21TmC+STeIPVVvq3YlAnWzhc= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201008052336eucas1p25d3b702a09e71eecbacbab63c1c15616~77PIUImez2348123481eucas1p23; Thu, 8 Oct 2020 05:23:36 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 21.01.05997.852AE7F5; Thu, 8 Oct 2020 06:23:36 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201008052336eucas1p16b5b1600683e33ddba30479b7fd62ce6~77PH8FmnM3077830778eucas1p1O; Thu, 8 Oct 2020 05:23:36 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201008052336eusmtrp16803feb6a500f975a68f417cdbfb8e20~77PH7kBWH2941529415eusmtrp1M; Thu, 8 Oct 2020 05:23:36 +0000 (GMT) X-AuditID: cbfec7f4-65dff7000000176d-5f-5f7ea258fb93 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FA.F0.06017.852AE7F5; Thu, 8 Oct 2020 06:23:36 +0100 (BST) Received: from Padamandas.fritz.box (unknown [106.210.88.70]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201008052336eusmtip151655cfcc611e350ebb8fb71dbf69b54~77PHfb7rz2784127841eusmtip14; Thu, 8 Oct 2020 05:23:35 +0000 (GMT) From: Lukasz Wojciechowski To: Cc: dev@dpdk.org, l.wojciechow@partner.samsung.com Date: Thu, 8 Oct 2020 07:23:08 +0200 Message-Id: <20201008052323.11547-1-l.wojciechow@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200925224209.12173-1-l.wojciechow@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCIsWRmVeSWpSXmKPExsWy7djP87oRi+riDe4tNrN492k7k8WznnWM DkwevxYsZfU4+G4PUwBTFJdNSmpOZllqkb5dAldG56wmloINIhVNr0+yNDAuEehi5OSQEDCR uHRzAUsXIxeHkMAKRon+3x1MEM4XRonGnY/ZQKqEBD4zSrz9WgzT0XT5MSNE0XKg+JMP7BDO J0aJy9MbwDrYBGwljsz8ygpiiw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al6yXn525iBAbYtmM/t+xg7HoXfIhRgINR iYfX4GhtvBBrYllxZe4hRgkOZiURXqezp+OEeFMSK6tSi/Lji0pzUosPMZoCHTWRWUo0OR8Y /Hkl8YamhuYWlobmxubGZhZK4rwdAgdjhATSE0tSs1NTC1KLYPqYODilGhjzuppcTVfN3/ft fTBr45Rbp3eW+ti9m6jzZnv71r/mGmxHFda7NW0Ryqss/CEq/cbfYt2b2Syeqz7UH2C+s7qr 27X46cqrSqs/3fMUEnr103blyr1tzIJlT48cFMv1t+/6pufEMpev4e6DPa3bVnf9KxY6t55n n9fKp5nhwbcqJQ51JJya3KeqxFKckWioxVxUnAgAXL8I8kYCAAA= X-CMS-MailID: 20201008052336eucas1p16b5b1600683e33ddba30479b7fd62ce6 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20201008052336eucas1p16b5b1600683e33ddba30479b7fd62ce6 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201008052336eucas1p16b5b1600683e33ddba30479b7fd62ce6 References: <20200925224209.12173-1-l.wojciechow@partner.samsung.com> Subject: [dpdk-dev] [PATCH v5 00/15] 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. --- 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 (15): 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 app/test/test_distributor.c | 321 ++++++++++++++---- 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, 447 insertions(+), 123 deletions(-) -- 2.17.1