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 73C01A04BC for ; Thu, 8 Oct 2020 16:26:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 50AB81C195; Thu, 8 Oct 2020 16:26:43 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 5855B1C131; Thu, 8 Oct 2020 16:26:39 +0200 (CEST) IronPort-SDR: cgI4P08Art9SPfj7/MKiU9/CmhA3VpBSZ4ERMLdHipXe7pqYiwcOxZcYGaslo3XQhGaBxX+rcX 9UHKAjOU+QhQ== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="165402344" X-IronPort-AV: E=Sophos;i="5.77,351,1596524400"; d="scan'208";a="165402344" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2020 07:26:37 -0700 IronPort-SDR: +Rtz1JoH++QPgQa+FWE4vlKgDW1P/B+zTVhYbq/dPF1ui9yLrJBPu+jCVRCQ+nrKi+wV+eSIW2 VUo9Ty7xlcaQ== X-IronPort-AV: E=Sophos;i="5.77,351,1596524400"; d="scan'208";a="528511868" Received: from dhunt5-mobl5.ger.corp.intel.com (HELO [10.252.33.45]) ([10.252.33.45]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2020 07:26:35 -0700 To: Lukasz Wojciechowski , Bruce Richardson Cc: dev@dpdk.org, stable@dpdk.org 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> From: David Hunt Message-ID: <6acff92e-213d-4565-d2ea-4cb71ba97172@intel.com> Date: Thu, 8 Oct 2020 15:26:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20201008052323.11547-5-l.wojciechow@partner.samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB 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" 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,    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) :) I'll try and get some time to run through some more testing, but for now: Acked-by: David Hunt