From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tan, Jianfeng" Subject: Re: [PATCH] eal/ipc: stop async IPC loop on callback request Date: Tue, 10 Apr 2018 21:53:26 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit To: Anatoly Burakov , dev@dpdk.org Return-path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id C2D641B968 for ; Tue, 10 Apr 2018 15:53:28 +0200 (CEST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 4/10/2018 6:03 PM, Anatoly Burakov wrote: > EAL did not stop processing further asynchronous requests on > encountering a request that should trigger the callback. This > resulted in erasing valid requests but not triggering them. That means one wakeup could process multiple replies, and following process_async_request() will erase some valid requests? > > Fix this by stopping the loop once we have a request that we > can trigger. Also, remove unnecessary check for trigger > request being NULL. > > Fixes: f05e26051c15 ("eal: add IPC asynchronous request") > Cc: anatoly.burakov@intel.com > > Signed-off-by: Anatoly Burakov > --- > lib/librte_eal/common/eal_common_proc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c > index f98622f..1ea3b58 100644 > --- a/lib/librte_eal/common/eal_common_proc.c > +++ b/lib/librte_eal/common/eal_common_proc.c > @@ -510,11 +510,11 @@ async_reply_handle(void *arg __rte_unused) > TAILQ_REMOVE(&pending_requests.requests, > sr, next); > free(sr); > - } else if (action == ACTION_TRIGGER && > - trigger == NULL) { > + } else if (action == ACTION_TRIGGER) { > TAILQ_REMOVE(&pending_requests.requests, > sr, next); > trigger = sr; > + break; If I understand it correctly above, break here, we will trigger an async action, and then go back to sleep with some ready requests not handled? Seems that we shall unlock, process, and lock here. Right? Thanks, Jianfeng > } > } > }