From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3B355A0093 for ; Thu, 28 May 2020 18:26:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 31D9A1DC1D; Thu, 28 May 2020 18:26:04 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 0A0F31DC23 for ; Thu, 28 May 2020 18:26:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590683161; 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=ZBGO8te/0kzkYSvXf+G0GRFHGS6X11BVbD++dqKYiEI=; b=JgsubvfwF/6wHFS+vCOlvXbHTVavNj1X3uCXFhnZzn0pnw8lingZZMantp3a5MKMxD0/06 AX/3qIbnufqk53/7DdAa8u8j9YSkiTXfaJhD5CtjuBwIErvTUa3qkqC8m8xM9th+VuGAIV vQlLXs60XxcVmkwDhCIiTVFojk/s+y0= 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-504-AwNwz_cbMMulZ0YbLS2nlA-1; Thu, 28 May 2020 12:25:58 -0400 X-MC-Unique: AwNwz_cbMMulZ0YbLS2nlA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 572D118FE863; Thu, 28 May 2020 16:25:57 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7003960C05; Thu, 28 May 2020 16:25:56 +0000 (UTC) From: Kevin Traynor To: Itsuro Oda Cc: Maxime Coquelin , dpdk stable Date: Thu, 28 May 2020 17:23:03 +0100 Message-Id: <20200528162322.7863-76-ktraynor@redhat.com> In-Reply-To: <20200528162322.7863-1-ktraynor@redhat.com> References: <20200528162322.7863-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: make IOTLB cache name unique among processes' has been queued to LTS release 18.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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" Hi, FYI, your patch has been queued to LTS release 18.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/03/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/15b8c1bb8f7bae668d3053eb76d81bf0ee0be458 Thanks. Kevin. --- >From 15b8c1bb8f7bae668d3053eb76d81bf0ee0be458 Mon Sep 17 00:00:00 2001 From: Itsuro Oda Date: Thu, 12 Mar 2020 08:19:18 +0900 Subject: [PATCH] vhost: make IOTLB cache name unique among processes [ upstream commit 7470f845c17ac27ce08b22f3c024169e51ade990 ] Currently, iotlb cache name is comprised of vid and virtqueue index. For example, "iotlb_cache_0_0". Because vid is assigned per process, iotlb cache name is not unique among multi processes. For example a secondary process uses a vhost (ex. eth_vhost0,iface=/tmp/sock0) and another secondary process uses a vhost (ex. eth_vhost1,iface=/tmp/sock1), iotlb cache name of both vhost ("iotlb_cache_0_0") are same and as a result iotlb cache is broken. This patch makes iotlb cache name unique among milti processes by adding process id to the iotlb cache name. The prefix of the name is shortened to "iotlb_" since the maximum length of pool name is 25 bytes (RTE_MEMPOOL_NAMESIZE is 26). Note that it is just 25 characters in maximum at the moment. Here, * pid_t == int: max 10 digits. * vid < MAX_VHOST_DECICE(1024): max 4 digits. * vq_index < VHOST_MAX_VRING(256): max 3 digits. Fixes: d012d1f293f4 ("vhost: add IOTLB helper functions") Signed-off-by: Itsuro Oda Reviewed-by: Maxime Coquelin --- lib/librte_vhost/iotlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c index c6354fef7e..3dfde94e80 100644 --- a/lib/librte_vhost/iotlb.c +++ b/lib/librte_vhost/iotlb.c @@ -337,6 +337,7 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index) TAILQ_INIT(&vq->iotlb_pending_list); - snprintf(pool_name, sizeof(pool_name), "iotlb_cache_%d_%d", - dev->vid, vq_index); + snprintf(pool_name, sizeof(pool_name), "iotlb_%u_%d_%d", + getpid(), dev->vid, vq_index); + RTE_LOG(DEBUG, VHOST_CONFIG, "IOTLB cache name: %s\n", pool_name); /* If already created, free it and recreate */ -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-28 17:13:03.048819691 +0100 +++ 0076-vhost-make-IOTLB-cache-name-unique-among-processes.patch 2020-05-28 17:12:59.159555088 +0100 @@ -1 +1 @@ -From 7470f845c17ac27ce08b22f3c024169e51ade990 Mon Sep 17 00:00:00 2001 +From 15b8c1bb8f7bae668d3053eb76d81bf0ee0be458 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7470f845c17ac27ce08b22f3c024169e51ade990 ] + @@ -27 +28,0 @@ -Cc: stable@dpdk.org @@ -36 +37 @@ -index bc17585288..5b3a0c090c 100644 +index c6354fef7e..3dfde94e80 100644 @@ -39 +40 @@ -@@ -309,6 +309,7 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index) +@@ -337,6 +337,7 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index) @@ -46 +47 @@ -+ VHOST_LOG_CONFIG(DEBUG, "IOTLB cache name: %s\n", pool_name); ++ RTE_LOG(DEBUG, VHOST_CONFIG, "IOTLB cache name: %s\n", pool_name);