[v2,1/1] vhost: fix iotlb mempool single-consumer flag
diff mbox series

Message ID 20200831075922.17970-2-eperezma@redhat.com
State Accepted
Delegated to: Maxime Coquelin
Headers show
Series
  • vhost: Make iotlb mempool not single-consumer
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: errored
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Eugenio Pérez Aug. 31, 2020, 7:59 a.m. UTC
Bugzilla bug: 523

Control thread (which handles iotlb msg) and forwarding
thread both use iotlb to translate address. The former may modify the
same entry of mempool and may cause a loop in iotlb_pending_entries
list.

Fixes: d012d1f293f4 ("vhost: add IOTLB helper functions")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
 lib/librte_vhost/iotlb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Xia, Chenbo Aug. 31, 2020, 10:21 a.m. UTC | #1
> -----Original Message-----
> From: Eugenio Pérez <eperezma@redhat.com>
> Sent: Monday, August 31, 2020 3:59 PM
> To: dev@dpdk.org
> Cc: Adrian Moreno Zapata <amorenoz@redhat.com>; Xia, Chenbo
> <chenbo.xia@intel.com>; Wang, Zhihong <zhihong.wang@intel.com>; Jens
> Freimann <jfreimann@redhat.com>; stable@dpdk.org; Maxime Coquelin
> <maxime.coquelin@redhat.com>; Kevin Traynor <ktraynor@redhat.com>
> Subject: [PATCH v2 1/1] vhost: fix iotlb mempool single-consumer flag
> 
> Bugzilla bug: 523
> 
> Control thread (which handles iotlb msg) and forwarding
> thread both use iotlb to translate address. The former may modify the
> same entry of mempool and may cause a loop in iotlb_pending_entries
> list.
> 
> Fixes: d012d1f293f4 ("vhost: add IOTLB helper functions")
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
>  lib/librte_vhost/iotlb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c
> index 5b3a0c090..e0b67721b 100644
> --- a/lib/librte_vhost/iotlb.c
> +++ b/lib/librte_vhost/iotlb.c
> @@ -321,8 +321,7 @@ vhost_user_iotlb_init(struct virtio_net *dev, int
> vq_index)
>  			IOTLB_CACHE_SIZE, sizeof(struct vhost_iotlb_entry), 0,
>  			0, 0, NULL, NULL, NULL, socket,
>  			MEMPOOL_F_NO_CACHE_ALIGN |
> -			MEMPOOL_F_SP_PUT |
> -			MEMPOOL_F_SC_GET);
> +			MEMPOOL_F_SP_PUT);
>  	if (!vq->iotlb_pool) {
>  		VHOST_LOG_CONFIG(ERR,
>  				"Failed to create IOTLB cache pool (%s)\n",
> --
> 2.18.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Maxime Coquelin Sept. 18, 2020, 9:49 a.m. UTC | #2
On 8/31/20 9:59 AM, Eugenio Pérez wrote:
> Bugzilla bug: 523
> 
> Control thread (which handles iotlb msg) and forwarding
> thread both use iotlb to translate address. The former may modify the
> same entry of mempool and may cause a loop in iotlb_pending_entries
> list.

Bugzilla ID: 523

> Fixes: d012d1f293f4 ("vhost: add IOTLB helper functions")
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
>  lib/librte_vhost/iotlb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c
> index 5b3a0c090..e0b67721b 100644
> --- a/lib/librte_vhost/iotlb.c
> +++ b/lib/librte_vhost/iotlb.c
> @@ -321,8 +321,7 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index)
>  			IOTLB_CACHE_SIZE, sizeof(struct vhost_iotlb_entry), 0,
>  			0, 0, NULL, NULL, NULL, socket,
>  			MEMPOOL_F_NO_CACHE_ALIGN |
> -			MEMPOOL_F_SP_PUT |
> -			MEMPOOL_F_SC_GET);
> +			MEMPOOL_F_SP_PUT);
>  	if (!vq->iotlb_pool) {
>  		VHOST_LOG_CONFIG(ERR,
>  				"Failed to create IOTLB cache pool (%s)\n",
> 

I'll fix commit message while applying.

Thanks for your contribution:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Maxime
Maxime Coquelin Sept. 18, 2020, 12:29 p.m. UTC | #3
On 8/31/20 9:59 AM, Eugenio Pérez wrote:
> Bugzilla bug: 523
> 
> Control thread (which handles iotlb msg) and forwarding
> thread both use iotlb to translate address. The former may modify the
> same entry of mempool and may cause a loop in iotlb_pending_entries
> list.
> 
> Fixes: d012d1f293f4 ("vhost: add IOTLB helper functions")
> Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
> ---
>  lib/librte_vhost/iotlb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime

Patch
diff mbox series

diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c
index 5b3a0c090..e0b67721b 100644
--- a/lib/librte_vhost/iotlb.c
+++ b/lib/librte_vhost/iotlb.c
@@ -321,8 +321,7 @@  vhost_user_iotlb_init(struct virtio_net *dev, int vq_index)
 			IOTLB_CACHE_SIZE, sizeof(struct vhost_iotlb_entry), 0,
 			0, 0, NULL, NULL, NULL, socket,
 			MEMPOOL_F_NO_CACHE_ALIGN |
-			MEMPOOL_F_SP_PUT |
-			MEMPOOL_F_SC_GET);
+			MEMPOOL_F_SP_PUT);
 	if (!vq->iotlb_pool) {
 		VHOST_LOG_CONFIG(ERR,
 				"Failed to create IOTLB cache pool (%s)\n",