* [dpdk-stable] [PATCH] vdpa/mlx5: fix virtq cleaning
@ 2021-03-01 10:41 Matan Azrad
2021-03-24 10:38 ` Maxime Coquelin
2021-03-31 8:46 ` Xia, Chenbo
0 siblings, 2 replies; 3+ messages in thread
From: Matan Azrad @ 2021-03-01 10:41 UTC (permalink / raw)
To: dev; +Cc: Maxime Coquelin, stable
The HW virtq object can be destroyed ether when the device is closed or
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 <matan@nvidia.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
---
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;
}
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH] vdpa/mlx5: fix virtq cleaning
2021-03-01 10:41 [dpdk-stable] [PATCH] vdpa/mlx5: fix virtq cleaning Matan Azrad
@ 2021-03-24 10:38 ` Maxime Coquelin
2021-03-31 8:46 ` Xia, Chenbo
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2021-03-24 10:38 UTC (permalink / raw)
To: Matan Azrad, dev, Chenbo Xia; +Cc: 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 <matan@nvidia.com>
> Acked-by: Xueming Li <xuemingl@nvidia.com>
> ---
> 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 <maxime.coquelin@redhat.com>
No need to resubmit, we can fix the typo while applying.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH] vdpa/mlx5: fix virtq cleaning
2021-03-01 10:41 [dpdk-stable] [PATCH] vdpa/mlx5: fix virtq cleaning Matan Azrad
2021-03-24 10:38 ` Maxime Coquelin
@ 2021-03-31 8:46 ` Xia, Chenbo
1 sibling, 0 replies; 3+ messages in thread
From: Xia, Chenbo @ 2021-03-31 8:46 UTC (permalink / raw)
To: Matan Azrad, dev; +Cc: Maxime Coquelin, stable
> -----Original Message-----
> From: stable <stable-bounces@dpdk.org> On Behalf Of Matan Azrad
> Sent: Monday, March 1, 2021 6:42 PM
> To: dev@dpdk.org
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; stable@dpdk.org
> Subject: [dpdk-stable] [PATCH] vdpa/mlx5: fix virtq cleaning
>
> The HW virtq object can be destroyed ether when the device is closed or
> 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 <matan@nvidia.com>
> Acked-by: Xueming Li <xuemingl@nvidia.com>
> ---
> 1.8.3.1
With commit log fixed, patch applied to next-virtio/main. Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-31 8:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 10:41 [dpdk-stable] [PATCH] vdpa/mlx5: fix virtq cleaning Matan Azrad
2021-03-24 10:38 ` Maxime Coquelin
2021-03-31 8:46 ` Xia, Chenbo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).