DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] net/virtio: fix repeated memory free of vq
@ 2021-08-03 23:30 Gaoxiang Liu
  2021-08-03 23:45 ` Gaoxiang Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Gaoxiang Liu @ 2021-08-03 23:30 UTC (permalink / raw)
  To: Maxime Coquelin, Chenbo Xia; +Cc: dev, liugaoxiang, Gaoxiang Liu, stable

When virtio_init_queue returns error, the memory of vq is freed.
But the value of hw->vqs[queue_idx] does not restore.
If hw->vqs[queue_idx] != NULL, the memory of vq is freed again
in virtio_free_queues.

Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
Cc: stable@dpdk.org

Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
---
 drivers/net/virtio/virtio_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 056830566..fc72d71cb 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -631,6 +631,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)
 	rte_memzone_free(mz);
 free_vq:
 	rte_free(vq);
+	hw->vqs[queue_idx] = NULL;
 
 	return ret;
 }
-- 
2.32.0



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v2] net/virtio: fix repeated memory free of vq
  2021-08-03 23:30 [dpdk-dev] [PATCH v2] net/virtio: fix repeated memory free of vq Gaoxiang Liu
@ 2021-08-03 23:45 ` Gaoxiang Liu
  2021-08-05  8:08   ` Gaoxiang Liu
  2021-08-29  8:50   ` [dpdk-dev] [PATCH v3] " Gaoxiang Liu
  0 siblings, 2 replies; 8+ messages in thread
From: Gaoxiang Liu @ 2021-08-03 23:45 UTC (permalink / raw)
  To: dev, Maxime Coquelin, Chenbo Xia; +Cc: liugaoxiang, Gaoxiang Liu, stable

When virtio_init_queue returns error, the memory of vq is freed.
But the value of hw->vqs[queue_idx] does not restore.
If hw->vqs[queue_idx] != NULL, the memory of vq is freed again
in virtio_free_queues.

Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
Cc: stable@dpdk.org

Signed-off-by: Gaoxiang Liu <gaoxiangliu0@163.com>

v2:
fix spelling warning
---
 drivers/net/virtio/virtio_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 056830566..fc72d71cb 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -631,6 +631,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)
 	rte_memzone_free(mz);
 free_vq:
 	rte_free(vq);
+	hw->vqs[queue_idx] = NULL;
 
 	return ret;
 }
-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/virtio: fix repeated memory free of vq
  2021-08-03 23:45 ` Gaoxiang Liu
@ 2021-08-05  8:08   ` Gaoxiang Liu
  2021-08-29  8:50   ` [dpdk-dev] [PATCH v3] " Gaoxiang Liu
  1 sibling, 0 replies; 8+ messages in thread
From: Gaoxiang Liu @ 2021-08-05  8:08 UTC (permalink / raw)
  To: dev, maxime.coquelin, chenbo.xia; +Cc: liugaoxiang






On 08/04/2021 07:45, Gaoxiang Liu wrote:
When virtio_init_queue returns error, the memory of vq is freed.
But the value of hw->vqs[queue_idx] does not restore.
If hw->vqs[queue_idx] != NULL, the memory of vq is freed again
in virtio_free_queues.

Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
Cc: stable@dpdk.org

Signed-off-by: Gaoxiang Liu <gaoxiangliu0@163.com>

v2:
fix spelling warning
---
drivers/net/virtio/virtio_ethdev.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 056830566..fc72d71cb 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -631,6 +631,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)
     rte_memzone_free(mz);
free_vq:
     rte_free(vq);
+     hw->vqs[queue_idx] = NULL;

     return ret;
}
--
2.32.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v3] net/virtio: fix repeated memory free of vq
  2021-08-03 23:45 ` Gaoxiang Liu
  2021-08-05  8:08   ` Gaoxiang Liu
@ 2021-08-29  8:50   ` Gaoxiang Liu
  2021-08-31 14:39     ` [dpdk-dev] [PATCH v4] " Gaoxiang Liu
  1 sibling, 1 reply; 8+ messages in thread
From: Gaoxiang Liu @ 2021-08-29  8:50 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia; +Cc: dev, liugaoxiang, Gaoxiang Liu, stable

When virtio_init_queue returns error, the memory of vq is freed.
But the value of hw->vqs[queue_idx] does not restore.
If virtio_init_queue returns error, the memory of vq is freed again
in virtio_free_queues.

Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
Cc: stable@dpdk.org

Signed-off-by: Gaoxiang Liu <gaoxiangliu0@163.com>
---

v2:
* Fix spelling warning

v3:
* Add detailed log
---
 drivers/net/virtio/virtio_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 056830566..fc72d71cb 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -631,6 +631,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)
 	rte_memzone_free(mz);
 free_vq:
 	rte_free(vq);
+	hw->vqs[queue_idx] = NULL;
 
 	return ret;
 }
-- 
2.32.0



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH v4] net/virtio: fix repeated memory free of vq
  2021-08-29  8:50   ` [dpdk-dev] [PATCH v3] " Gaoxiang Liu
@ 2021-08-31 14:39     ` Gaoxiang Liu
  2021-09-07  3:41       ` Gaoxiang Liu
                         ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Gaoxiang Liu @ 2021-08-31 14:39 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia; +Cc: dev, liugaoxiang, Gaoxiang Liu, stable

When virtio_init_queue returns error, the memory of vq is freed.
But the value of hw->vqs[queue_idx] does not restore.
If virtio_init_queue returns error, the memory of vq is freed again
in virtio_free_queues.

Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
Cc: stable@dpdk.org

Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
---

v2:
* Fix spelling warning

v3:
* Add detailed log

v4:
* Update the email address
---
 drivers/net/virtio/virtio_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 056830566..fc72d71cb 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -631,6 +631,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)
 	rte_memzone_free(mz);
 free_vq:
 	rte_free(vq);
+	hw->vqs[queue_idx] = NULL;
 
 	return ret;
 }
-- 
2.32.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v4] net/virtio: fix repeated memory free of vq
  2021-08-31 14:39     ` [dpdk-dev] [PATCH v4] " Gaoxiang Liu
@ 2021-09-07  3:41       ` Gaoxiang Liu
  2021-09-07  5:08       ` Xia, Chenbo
  2021-09-14 11:27       ` Maxime Coquelin
  2 siblings, 0 replies; 8+ messages in thread
From: Gaoxiang Liu @ 2021-09-07  3:41 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia; +Cc: dev, liugaoxiang, stable

Hi, chenbo, maxime.
Please help to review the patch.
The patch has been proposed a month ago.


At 2021-08-31 22:39:51, "Gaoxiang Liu" <gaoxiangliu0@163.com> wrote:
>When virtio_init_queue returns error, the memory of vq is freed.
>But the value of hw->vqs[queue_idx] does not restore.
>If virtio_init_queue returns error, the memory of vq is freed again
>in virtio_free_queues.
>
>Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
>Cc: stable@dpdk.org
>
>Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
>---
>
>v2:
>* Fix spelling warning
>
>v3:
>* Add detailed log
>
>v4:
>* Update the email address
>---
> drivers/net/virtio/virtio_ethdev.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
>index 056830566..fc72d71cb 100644
>--- a/drivers/net/virtio/virtio_ethdev.c
>+++ b/drivers/net/virtio/virtio_ethdev.c
>@@ -631,6 +631,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t queue_idx)
> 	rte_memzone_free(mz);
> free_vq:
> 	rte_free(vq);
>+	hw->vqs[queue_idx] = NULL;
> 
> 	return ret;
> }
>-- 
>2.32.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v4] net/virtio: fix repeated memory free of vq
  2021-08-31 14:39     ` [dpdk-dev] [PATCH v4] " Gaoxiang Liu
  2021-09-07  3:41       ` Gaoxiang Liu
@ 2021-09-07  5:08       ` Xia, Chenbo
  2021-09-14 11:27       ` Maxime Coquelin
  2 siblings, 0 replies; 8+ messages in thread
From: Xia, Chenbo @ 2021-09-07  5:08 UTC (permalink / raw)
  To: Gaoxiang Liu, maxime.coquelin; +Cc: dev, liugaoxiang, stable

> -----Original Message-----
> From: Gaoxiang Liu <gaoxiangliu0@163.com>
> Sent: Tuesday, August 31, 2021 10:40 PM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; liugaoxiang@huawei.com; Gaoxiang Liu <gaoxiangliu0@163.com>;
> stable@dpdk.org
> Subject: [PATCH v4] net/virtio: fix repeated memory free of vq
> 
> When virtio_init_queue returns error, the memory of vq is freed.
> But the value of hw->vqs[queue_idx] does not restore.
> If virtio_init_queue returns error, the memory of vq is freed again
> in virtio_free_queues.
> 
> Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
> ---
> 
> v2:
> * Fix spelling warning
> 
> v3:
> * Add detailed log
> 
> v4:
> * Update the email address
> ---
>  drivers/net/virtio/virtio_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c
> b/drivers/net/virtio/virtio_ethdev.c
> index 056830566..fc72d71cb 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -631,6 +631,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t
> queue_idx)
>  	rte_memzone_free(mz);
>  free_vq:
>  	rte_free(vq);
> +	hw->vqs[queue_idx] = NULL;
> 
>  	return ret;
>  }
> --
> 2.32.0

Better to make the author name and SOB tag use same email when applying.

For this patch:

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH v4] net/virtio: fix repeated memory free of vq
  2021-08-31 14:39     ` [dpdk-dev] [PATCH v4] " Gaoxiang Liu
  2021-09-07  3:41       ` Gaoxiang Liu
  2021-09-07  5:08       ` Xia, Chenbo
@ 2021-09-14 11:27       ` Maxime Coquelin
  2 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2021-09-14 11:27 UTC (permalink / raw)
  To: Gaoxiang Liu, chenbo.xia; +Cc: dev, liugaoxiang, stable



On 8/31/21 4:39 PM, Gaoxiang Liu wrote:
> When virtio_init_queue returns error, the memory of vq is freed.
> But the value of hw->vqs[queue_idx] does not restore.
> If virtio_init_queue returns error, the memory of vq is freed again
> in virtio_free_queues.
> 
> Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
> ---
> 
> v2:
> * Fix spelling warning
> 
> v3:
> * Add detailed log
> 
> v4:
> * Update the email address
> ---
>  drivers/net/virtio/virtio_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 


Applied to dpdk-next-virtio/main.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-14 11:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 23:30 [dpdk-dev] [PATCH v2] net/virtio: fix repeated memory free of vq Gaoxiang Liu
2021-08-03 23:45 ` Gaoxiang Liu
2021-08-05  8:08   ` Gaoxiang Liu
2021-08-29  8:50   ` [dpdk-dev] [PATCH v3] " Gaoxiang Liu
2021-08-31 14:39     ` [dpdk-dev] [PATCH v4] " Gaoxiang Liu
2021-09-07  3:41       ` Gaoxiang Liu
2021-09-07  5:08       ` Xia, Chenbo
2021-09-14 11:27       ` Maxime Coquelin

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).