From patchwork Mon Aug 31 07:59:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eugenio Perez Martin X-Patchwork-Id: 76177 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CB693A04AB; Mon, 31 Aug 2020 09:59:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 62AC41C0AE; Mon, 31 Aug 2020 09:59:47 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 883CE1C0AD for ; Mon, 31 Aug 2020 09:59:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598860785; 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=l+4wQ0mxMeXt9qvhBHA5rHVahI43dcO9oEpZgWikYjQ=; b=cay3AAYt2ZbRQrqUGMJ/FAas1cjhzpIIkfpEoMrtPhYxsPGr150vSYecW3HU6qc+dijAwV 2dqKdATDwlC1rZaDzt4ByLAxa58TW0iih+w1ulOjVYUosbemDIjTtT2RUq/0wKj2a5NLK3 irBJ0ejx4pySHa7ZIrg9n3H0zLFftTA= 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-124-LE8F7mjGNdSGopA63B1pOg-1; Mon, 31 Aug 2020 03:59:42 -0400 X-MC-Unique: LE8F7mjGNdSGopA63B1pOg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DED65802B79; Mon, 31 Aug 2020 07:59:41 +0000 (UTC) Received: from eperezma.remote.csb (ovpn-112-229.ams2.redhat.com [10.36.112.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 328945D9D5; Mon, 31 Aug 2020 07:59:36 +0000 (UTC) From: =?utf-8?q?Eugenio_P=C3=A9rez?= To: dev@dpdk.org Cc: Adrian Moreno Zapata , Chenbo Xia , Zhihong Wang , Jens Freimann , stable@dpdk.org, Maxime Coquelin , Kevin Traynor Date: Mon, 31 Aug 2020 09:59:22 +0200 Message-Id: <20200831075922.17970-2-eperezma@redhat.com> In-Reply-To: <20200831075922.17970-1-eperezma@redhat.com> References: <20200810141103.8015-1-eperezma@redhat.com> <20200831075922.17970-1-eperezma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eperezma@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v2 1/1] vhost: fix iotlb mempool single-consumer flag X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin --- 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",