From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 31EB3A00BE for ; Wed, 20 Apr 2022 12:33:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 121F440687; Wed, 20 Apr 2022 12:33:25 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 7FDA940687 for ; Wed, 20 Apr 2022 12:33:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650450801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kn1ovWQs2VD16N4PNFGVZcmW3uQfyTfCZExwC280934=; b=Q5cHMCMfoRpodF5nGLZ85pZj8G0B8f7xzuxTVmskMYmTJQ9Jx3pWW9fMaHn5TQYJn64R8l Oe9IfFxkB+9o3RliyOFxbZgAhyB7n7Hk/V+HtKxbndfn0/eGj6SouA8ZHLfVF01zanV1NK DfgeTCraiY5ekkq22q9fbFEaYssuaLM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-433-RMHJcu0nMs-KYRNKXdcMqw-1; Wed, 20 Apr 2022 06:33:21 -0400 X-MC-Unique: RMHJcu0nMs-KYRNKXdcMqw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D63C381A82D; Wed, 20 Apr 2022 10:33:20 +0000 (UTC) Received: from [10.39.208.35] (unknown [10.39.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6EE08145B97F; Wed, 20 Apr 2022 10:33:19 +0000 (UTC) Message-ID: <7dc4f877-9da1-052f-fca0-5ad120ac4282@redhat.com> Date: Wed, 20 Apr 2022 12:33:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2 2/7] vdpa/mlx5: fix dead loop when process interrupted To: Xueming Li , dev@dpdk.org Cc: stable@dpdk.org, Matan Azrad , Viacheslav Ovsiienko References: <20220224132820.1939650-1-xuemingl@nvidia.com> <20220224155101.1991626-1-xuemingl@nvidia.com> <20220224155101.1991626-3-xuemingl@nvidia.com> From: Maxime Coquelin In-Reply-To: <20220224155101.1991626-3-xuemingl@nvidia.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 On 2/24/22 16:50, Xueming Li wrote: > In Ctrl+C handling, sometimes kick handling thread gets endless EGAIN > error and fall into dead lock. > > Kick happens frequently in real system due to busy traffic or retry > mechanism. This patch simplifies kick firmware anyway and skip setting > hardware notifier due to potential device error, notifier could be set > in next successful kick request. > > Fixes: 62c813706e41 ("vdpa/mlx5: map doorbell") > Cc: stable@dpdk.org > > Signed-off-by: Xueming Li > --- > drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c > index de324506cb9..e1e05924a40 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c > @@ -23,11 +23,11 @@ mlx5_vdpa_virtq_kick_handler(void *cb_arg) > struct mlx5_vdpa_priv *priv = virtq->priv; > uint64_t buf; > int nbytes; > + int retry; > > if (rte_intr_fd_get(virtq->intr_handle) < 0) > return; > - > - do { > + for (retry = 0; retry < 3; ++retry) { > nbytes = read(rte_intr_fd_get(virtq->intr_handle), &buf, > 8); > if (nbytes < 0) { > @@ -39,7 +39,9 @@ mlx5_vdpa_virtq_kick_handler(void *cb_arg) > virtq->index, strerror(errno)); > } > break; > - } while (1); > + } > + if (nbytes < 0) > + return; > rte_write32(virtq->index, priv->virtq_db_addr); > if (virtq->notifier_state == MLX5_VDPA_NOTIFIER_STATE_DISABLED) { > if (rte_vhost_host_notifier_ctrl(priv->vid, virtq->index, true)) Reviewed-by: Maxime Coquelin Thanks, Maxime