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 89FF4A0093 for ; Tue, 19 May 2020 15:09:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 826021D6A4; Tue, 19 May 2020 15:09:41 +0200 (CEST) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by dpdk.org (Postfix) with ESMTP id 159B81D6C4 for ; Tue, 19 May 2020 15:09:41 +0200 (CEST) Received: by mail-wm1-f43.google.com with SMTP id u1so2219388wmn.3 for ; Tue, 19 May 2020 06:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lVu+JqT2Qg+IJ4PGUgVYUJeSrvFITCFUrzFRrHPFveE=; b=Bw99n2+2hFhkBBm1mKB2p90ftNwmUl2YcZUt99Os4LfBbmu5QTmm6ZcXcxWfGRtPJ1 zylOwzbaMqhecmk3TQhu2HdjmDB7HZABbo+0pfbHOB3RDSQ1V9pWfiZpJjlNFn7eisbw PNzfJ2PzYkhcouGd6MNYmYiEX5noEgivbSj37tpEgYYNiXo3g6ba9yp6VWoWQ9uB7TPB GljXCHzcxwgFq9Z6lIggdhWpm3LySrJdZRmiBAXLiNRNbTRn9UujeI72dHj+mg/eqfef Wh0PXvQAzFnlY2B7+G9mcpXuX6zXU729qTn65Jc6eKPlQLyjnM2TRh6WYZUDqghCjUlP I0vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lVu+JqT2Qg+IJ4PGUgVYUJeSrvFITCFUrzFRrHPFveE=; b=Twv7cdXpT8qzhJgSpmZFIAr6rPJ2RugWwRvbPFmeFV905SKFckWhvBJ/9lOIKsWe23 M1LZ6w/7tAtlfKBejEMhflJOyiGM3MHlThBGBfa8Rt1C4bi0WNl4Qp9emuu95xBPk23c IGYzZghG12QvxXQuvEEthl+MFUTfaM5WoGKIMifNFI4mz6HC20l2FTAXjwTMni71Uz+D li3p5WEKkn/1smtAgVLzbSSOQGZHDCYcsFi8fkxpwMQ0x61d6up/In03wkugB7g3yonb 0tMEpr+zsXxrZMBARxtRCjokJFNMf881mu+S8fiLRH0eifNIYqhF7lzPlbGzdJuJWake RWeA== X-Gm-Message-State: AOAM531wZbytQzEJCGs67aNqqZcfKDz74AZHX0E9h87LOdMH/esAyIfC lksNJx7jDLfePrtrnTsMB2g= X-Google-Smtp-Source: ABdhPJxu2mZNM/tleVHxDVUNpJ0HWrA+ZZSFUBlIAgas4IBihadl/DOTsCkoxh/dijCkJ1c8uT85CA== X-Received: by 2002:a1c:307:: with SMTP id 7mr5449840wmd.104.1589893779908; Tue, 19 May 2020 06:09:39 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 1sm4110417wmz.13.2020.05.19.06.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:09:39 -0700 (PDT) From: luca.boccassi@gmail.com To: Itsuro Oda Cc: Maxime Coquelin , dpdk stable Date: Tue, 19 May 2020 14:03:28 +0100 Message-Id: <20200519130549.112823-73-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: make IOTLB cache name unique among processes' has been queued to stable release 19.11.3 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 stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/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. Thanks. Luca Boccassi --- >From 1ff55a18be5ed03478749327009793522ed88424 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 4a1d8c1253..07443a94bc 100644 --- a/lib/librte_vhost/iotlb.c +++ b/lib/librte_vhost/iotlb.c @@ -308,8 +308,9 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index) TAILQ_INIT(&vq->iotlb_list); 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 */ vq->iotlb_pool = rte_mempool_lookup(pool_name); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:47.446189585 +0100 +++ 0073-vhost-make-IOTLB-cache-name-unique-among-processes.patch 2020-05-19 14:04:44.232648662 +0100 @@ -1,8 +1,10 @@ -From 7470f845c17ac27ce08b22f3c024169e51ade990 Mon Sep 17 00:00:00 2001 +From 1ff55a18be5ed03478749327009793522ed88424 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. @@ -24,7 +26,6 @@ * vq_index < VHOST_MAX_VRING(256): max 3 digits. Fixes: d012d1f293f4 ("vhost: add IOTLB helper functions") -Cc: stable@dpdk.org Signed-off-by: Itsuro Oda Reviewed-by: Maxime Coquelin @@ -33,7 +34,7 @@ 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c -index bc17585288..5b3a0c090c 100644 +index 4a1d8c1253..07443a94bc 100644 --- a/lib/librte_vhost/iotlb.c +++ b/lib/librte_vhost/iotlb.c @@ -308,8 +308,9 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index) @@ -44,7 +45,7 @@ - dev->vid, vq_index); + snprintf(pool_name, sizeof(pool_name), "iotlb_%u_%d_%d", + getpid(), dev->vid, vq_index); -+ VHOST_LOG_CONFIG(DEBUG, "IOTLB cache name: %s\n", pool_name); ++ RTE_LOG(DEBUG, VHOST_CONFIG, "IOTLB cache name: %s\n", pool_name); /* If already created, free it and recreate */ vq->iotlb_pool = rte_mempool_lookup(pool_name);