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 1FF1BA0A02 for ; Wed, 24 Mar 2021 11:39:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA8F74067B; Wed, 24 Mar 2021 11:39:04 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id A29004014F for ; Wed, 24 Mar 2021 11:39:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616582342; 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=CwIM1SK9BomX5cAKZv7DYbkz8NlwaD5uaNhq+VDf76Y=; b=KftdO9u6+ZXapJKnZmtEOUTODNeoHU0dvH7/zt2u9tLhb/sbK702zZIxKAZfKRrucrJyt4 dgShdOIgsPZW1dG8pB1DnbIqz/9qBBxzOOcjrk6uX0EcP6UuqYJQtTMQKA/mRT2j7y+4Yy thLLAimLTp0uwy0Ln2U7ZWCCJZXVoeg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-487-BUtQhrmYPoucgkkkGv1VMQ-1; Wed, 24 Mar 2021 06:39:00 -0400 X-MC-Unique: BUtQhrmYPoucgkkkGv1VMQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9D706107ACCA; Wed, 24 Mar 2021 10:38:58 +0000 (UTC) Received: from [10.36.110.41] (unknown [10.36.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C0D119714; Wed, 24 Mar 2021 10:38:57 +0000 (UTC) To: Matan Azrad , dev@dpdk.org, Chenbo Xia Cc: stable@dpdk.org References: <1614595291-112120-1-git-send-email-matan@nvidia.com> From: Maxime Coquelin Message-ID: <56ac6a1a-2641-2fc1-9ae1-75deb0031c16@redhat.com> Date: Wed, 24 Mar 2021 11:38:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <1614595291-112120-1-git-send-email-matan@nvidia.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [PATCH] vdpa/mlx5: fix virtq cleaning 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 Sender: "stable" On 3/1/21 11:41 AM, Matan Azrad wrote: > The HW virtq object can be destroyed ether when the device is closed or s/ether/either/ > when the state of the virtq becomes disabled. > > Some parameters of the virtq should continue to be managed when the > virtq state is changed but all of them must be initialized when the > device is closed. > > Wrongly, the enable parameter stayed on when the device is closed what > might cause creation of invalid virtq in the next time a device is > assigned to the driver. > > Clean all the virtqs memory when the device is closed. > > Fixes: c47d6e83334e ("vdpa/mlx5: support queue update") > Cc: stable@dpdk.org > > Signed-off-by: Matan Azrad > Acked-by: Xueming Li > --- > drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c > index ef2642a..024c5c4 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c > @@ -103,13 +103,8 @@ > for (i = 0; i < priv->nr_virtqs; i++) { > virtq = &priv->virtqs[i]; > mlx5_vdpa_virtq_unset(virtq); > - if (virtq->counters) { > + if (virtq->counters) > claim_zero(mlx5_devx_cmd_destroy(virtq->counters)); > - virtq->counters = NULL; > - memset(&virtq->reset, 0, sizeof(virtq->reset)); > - } > - memset(virtq->err_time, 0, sizeof(virtq->err_time)); > - virtq->n_retry = 0; > } > for (i = 0; i < priv->num_lag_ports; i++) { > if (priv->tiss[i]) { > @@ -126,6 +121,7 @@ > priv->virtq_db_addr = NULL; > } > priv->features = 0; > + memset(priv->virtqs, 0, sizeof(*virtq) * priv->nr_virtqs); > priv->nr_virtqs = 0; > } > > With typo fixed in commit message: Reviewed-by: Maxime Coquelin No need to resubmit, we can fix the typo while applying. Thanks, Maxime