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 6CC7AA04BC for ; Thu, 8 Oct 2020 23:07:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 610F754AE; Thu, 8 Oct 2020 23:07:55 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 7013954AE for ; Thu, 8 Oct 2020 23:07:52 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201008210740euoutp021356f5efc1c8d85bb5af35c47441d9e4~8IHaNx0-t0467204672euoutp02k for ; Thu, 8 Oct 2020 21:07:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201008210740euoutp021356f5efc1c8d85bb5af35c47441d9e4~8IHaNx0-t0467204672euoutp02k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1602191261; bh=tfvSANzPnYWIVIYGsaLXm5jOxh7IdRpax8NiPbhlEJ0=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=EtgOpMXXSPsQJiZD/ZkZaTvZhGxyAPKSEiHq+Svp1ziXIw20oYbBMhEDgbfH4yjXF O5LN/Dqbxh89R3JnkKV/2O5VgXEvN44ElWh8U5r90k7YK06OOyMv5dSi2DAbkggYsW LMKhED/mr+Grva2reym+yqd86BCtMrOfN7R21cKU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201008210739eucas1p1120b8f52fb0bb4ad19d7e3eaaab94d20~8IHYoOate0685606856eucas1p1X; Thu, 8 Oct 2020 21:07:39 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id DB.E8.06456.B9F7F7F5; Thu, 8 Oct 2020 22:07:39 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201008210738eucas1p1c17588816a169ab4d62d5a8df90d55bf~8IHYPD0nk0697206972eucas1p1Y; Thu, 8 Oct 2020 21:07:38 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201008210738eusmtrp21dca9c2c1a8490a09a3d1ced523e19b2~8IHYOfCdQ2026720267eusmtrp2r; Thu, 8 Oct 2020 21:07:38 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-87-5f7f7f9b2823 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id DE.CE.06017.A9F7F7F5; Thu, 8 Oct 2020 22:07:38 +0100 (BST) Received: from [106.210.88.70] (unknown [106.210.88.70]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201008210738eusmtip1349917b3902133a6a9969ae7aea14998~8IHXwowSB2888428884eusmtip1S; Thu, 8 Oct 2020 21:07:38 +0000 (GMT) To: David Hunt , Bruce Richardson Cc: dev@dpdk.org, stable@dpdk.org, "\"'Lukasz Wojciechowski'\"," From: Lukasz Wojciechowski Message-ID: <43b64806-aa26-68a2-5757-d5a6ec7a8174@partner.samsung.com> Date: Thu, 8 Oct 2020 23:07:36 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <6acff92e-213d-4565-d2ea-4cb71ba97172@intel.com> Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGKsWRmVeSWpSXmKPExsWy7djPc7qz6+vjDU5+47G4screom/SRyaL d5+2M1k861nHaPGv4w+7A6vHrwVLWT0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eGSAESNsMSfa11QNa8ZJZZMuMwMkhAWCJRY efEfmC0iECZx/et9dhCbWSBV4lnHWWaIhiNMEhs6f7KAJNgEbCWOzPzKCmLzCrhJrHmzHMxm EVCReNY4HaxZVCBO4sfEXjaIGkGJkzOfgPVyAvXe6NrOCrHATGLe5ofMELa8RPPW2VC2uMSt J/OZJjAKzULSPgtJyywkLbOQtCxgZFnFKJJaWpybnltspFecmFtcmpeul5yfu4kRGE3bjv3c soOx613wIUYBDkYlHt4V/PXxQqyJZcWVuYcYJTiYlUR4nc6ejhPiTUmsrEotyo8vKs1JLT7E aAr03ERmKdHkfGCk55XEG5oamltYGpobmxubWSiJ83YIHIwREkhPLEnNTk0tSC2C6WPi4JRq YIxM9Psh4nzSTsT8TX5N7HFtr6nHJfcoN77reBLiLHD60obD0s7bbqfbRzOo/XQM74p/mHf3 3Mf19xl3HpTXSYj8J1C5Irg06Gr+/ugPM/5Pndx2sk7d4d+JzR3aEZd0f4jN+b/aetHc2Okr p+v+D9y+7pNZ2unZu60PeR27fi1KZlXzCpWcj1OVWIozEg21mIuKEwEnZnlYvAIAAA== X-CMS-MailID: 20201008210738eucas1p1c17588816a169ab4d62d5a8df90d55bf X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20201008052339eucas1p15697f457b8b96809d04f737e041af08a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201008052339eucas1p15697f457b8b96809d04f737e041af08a References: <20200925224209.12173-1-l.wojciechow@partner.samsung.com> <20201008052323.11547-1-l.wojciechow@partner.samsung.com> <20201008052323.11547-5-l.wojciechow@partner.samsung.com> <6acff92e-213d-4565-d2ea-4cb71ba97172@intel.com> Subject: Re: [dpdk-stable] [PATCH v5 04/15] distributor: handle worker shutdown in burst mode 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" W dniu 08.10.2020 o 16:26, David Hunt pisze: > > On 8/10/2020 6:23 AM, Lukasz Wojciechowski wrote: >> The burst version of distributor implementation was missing proper >> handling of worker shutdown. A worker processing packets received >> from distributor can call rte_distributor_return_pkt() function >> informing distributor that it want no more packets. Further calls to >> rte_distributor_request_pkt() or rte_distributor_get_pkt() however >> should inform distributor that new packets are requested again. >> >> Lack of the proper implementation has caused that even after worker >> informed about returning last packets, new packets were still sent >> from distributor causing deadlocks as no one could get them on worker >> side. >> >> This patch adds handling shutdown of the worker in following way: >> 1) It fixes usage of RTE_DISTRIB_VALID_BUF handshake flag. This flag >> was formerly unused in burst implementation and now it is used >> for marking valid packets in retptr64 replacing invalid use >> of RTE_DISTRIB_RETURN_BUF flag. >> 2) Uses RTE_DISTRIB_RETURN_BUF as a worker to distributor handshake >> in retptr64 to indicate that worker has shutdown. >> 3) Worker that shuts down blocks also bufptr for itself with >> RTE_DISTRIB_RETURN_BUF flag allowing distributor to retrieve any >> in flight packets. >> 4) When distributor receives information about shutdown of a worker, >> it: marks worker as not active; retrieves any in flight and backlog >> packets and process them to different workers; unlocks bufptr64 >> by clearing RTE_DISTRIB_RETURN_BUF flag and allowing use in >> the future if worker requests any new packages. >> 5) Do not allow to: send or add to backlog any packets for not >> active workers. Such workers are also ignored if matched. >> 6) Adjust calls to handle_returns() and tags matching procedure >> to react for possible activation deactivation of workers. >> >> Fixes: 775003ad2f96 ("distributor: add new burst-capable library") >> Cc: david.hunt@intel.com >> Cc: stable@dpdk.org >> >> Signed-off-by: Lukasz Wojciechowski >> --- > > > Hi Lukasz, Hi David, Many thanks for your review. > >    I spent the most amount of time going through this particular > patch, and it looks good to me (even the bit where > rte_distributor_process is called recursively) :) That's the same trick that was used in the legacy single version. :) > > I'll try and get some time to run through some more testing, but for now: > > Acked-by: David Hunt Thanks and if you'll run the test, please take a look at the performance. I think it has dropped because of these additional synchronizations and actions on activation/deactivation. However the quality has increased much. With v5 version , I ran tests over 100000 times and didn't get a single failure! Let me know about your results. Best regards Lukasz > > > > > -- Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 l.wojciechow@partner.samsung.com