Message ID | 1534537189-26763-1-git-send-email-nitin.katiyar@ericsson.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Delegated to: | Maxime Coquelin |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C883BFEB; Fri, 17 Aug 2018 14:18:03 +0200 (CEST) Received: from sessmg22.ericsson.net (sessmg22.ericsson.net [193.180.251.58]) by dpdk.org (Postfix) with ESMTP id 4BAFB2C5 for <dev@dpdk.org>; Fri, 17 Aug 2018 14:18:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1534508282; h=From:Sender:Reply-To:Subject:Date:Message-Id:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=S4SGIyQRlYRmclG4s8vFXLIHifoLBmqn505Vrj9B+DY=; b=FeQ8+xYvQjY0BdJyEnDd+d8sGkVSXoFC5zhht3jAyLQM6BkcPtfg/iwnp7VkVyMt zWuEk31Qa9Arnn9AdwgeKHMbHLDpPTP+UNfRZ3odFBa6br94BdvJX8FLhZ+xPdws opAsPuct1jKVoUzUwFOl4AAgYYvAsjAldxEi5dUCdHc=; X-AuditID: c1b4fb3a-baf5f9c00000680b-2f-5b76bcfae03c Received: from ESESBMB503.ericsson.se (Unknown_Domain [153.88.183.116]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id DF.F6.26635.AFCB67B5; Fri, 17 Aug 2018 14:18:02 +0200 (CEST) Received: from ESESBMR502.ericsson.se (153.88.183.134) by ESESBMB503.ericsson.se (153.88.183.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 17 Aug 2018 14:18:02 +0200 Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESBMR502.ericsson.se (153.88.183.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 17 Aug 2018 14:18:01 +0200 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB503.ericsson.se (153.88.183.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Fri, 17 Aug 2018 14:18:01 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tkK7ZMvh/9j40MXUAiWIT1NapqO4hbKeVf91ELne4xY=; b=eNOAiLarPCWHkJo+PDQpr7/lQRHIVgo39XmekSvvV9Q6H+ilc7NU73AlFOwfydM3GJDGMGDJVZT+j3DSUw6gNxZcI/kSv/RXiQzbLyGuccKHjmP6sEP5g5GXSrwoM2CSMTuQrcGh+560cl7rb4uhQ71c0QeY0YrE8ZI0VTv88Vg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nitin.katiyar@ericsson.com; Received: from localhost.localdomain (125.16.128.122) by VI1PR0702MB3629.eurprd07.prod.outlook.com (2603:10a6:803:3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.20; Fri, 17 Aug 2018 12:18:00 +0000 From: Nitin Katiyar <nitin.katiyar@ericsson.com> To: <dev@dpdk.org> CC: Nitin Katiyar <nitin.katiyar@ericsson.com> Date: Sat, 18 Aug 2018 01:49:49 +0530 Message-Id: <1534537189-26763-1-git-send-email-nitin.katiyar@ericsson.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [125.16.128.122] X-ClientProxiedBy: BM1PR0101CA0018.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::28) To VI1PR0702MB3629.eurprd07.prod.outlook.com (2603:10a6:803:3::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9ed96c7-7c90-48eb-9cfa-08d6043b79a8 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:VI1PR0702MB3629; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0702MB3629; 3:GPU2jgiYi4JTpuY1q8hqTabFKEtMdEqG0MEfEp46G6kDlshJ/sjjmeWPL3gA0Qlq+99aLhNV2ybgQNdjcF1BwIpeyqkRtwBZYlxBGUXJUUVyb1WtVj8RTdJQfKX/xz4fLhEnTfHypl77hsUym9vqgk02Y1Mb+64E71w9RmU2xQ6Jt9yQMcJgVNG693FohYGEHxA69CYNu9lo+T4xmi9YCncGviu9S+8pOz5ThNATgMa/ma207k+jKGuIsqSW9Bxz; 25:pjCgqDQYO2dcZvRfmWzTSmCAEvNvghWIN6mJFwASb8z5DsWDeyinWx52HKzoYQrjlgR+hzibtfgf7SqqeEMNW1MgZklEpIL4B1xVxqzt/O+rZDK8hf5CN+mH3tR3iwZ52Hg2QeVWYDpELdwz0utaGHW8P4K4Oq35xGmVokQn5xsKY4xczKorQhwxTG9m04eLA6vr+1sWxJY0HrIiYz/9LASmVvdrlmtyAlaymnBqXE8OBBZEswb9twFBSMZjL15c+LRC0RMu0jSz/2QDPraSryFPCf1SEOtJb8tBJdW/SeNHy0HSUPytgB/vpemCU8T5DKxp7DZ9UNzUD4qxgNG6Zw==; 31:gQFkin8zw+sGn0lHh6UrglTh/u2VI4/ocUGWa1Noa0iEWKA9WB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DL3DBn7sK9M0RMM7DZTo1kju2w5sArt7++bIkG88zz1v71276QnTKr7L7oaub7YAkH X-Microsoft-Antispam-PRVS: <VI1PR0702MB3629CB5A8E7B8B47E207BF8B8E3D0@VI1PR0702MB3629.eurprd07.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(37575265505322)(278428928389397)(248295561703944); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699016); SRVR:VI1PR0702MB3629; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0702MB3629; X-Forefront-PRVS: 076777155F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(136003)(376002)(366004)(39860400002)(396003)(346002)(199004)(189003)(68736007)(6666003)(478600001)(53936002)(25786009)(50466002)(107886003)(48376002)(6486002)(50226002)(6512007)(14444005)(6916009)(2906002)(4326008)(66066001)(86362001)(47776003)(44832011)(956004)(16586007)(476003)(486006)(7736002)(97736004)(316002)(2616005)(106356001)(16526019)(36756003)(2351001)(2361001)(305945005)(51416003)(55236004)(3846002)(6116002)(186003)(386003)(8676002)(81156014)(81166006)(52116002)(6506007)(1857600001)(105586002)(5660300001)(8936002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0702MB3629; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0702MB3629; 23:WcFr2HUk7ymBuewA+5MWjBbfwTAmE+WGlPRpBzD?= zdnVnYzfTgURmV8+fxAPzTXk8kcyVM5A883ZaOj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lK1LKRggDhLK8+N1gCPhERyCTsLlyAkSgsx/VtlPdVTt5BaOeDVNSHcQE/ps4SepW+nPlHBar+GT+6+4OlfjfrC7QYCArsBnj33rJzyULtano=; 7:E9dfBshHJSslV9Ow0DgwH6oI2Guwo9C2R9HhcdZZnvcCUvhtUHVc+tZ2LbSTP6LESbXv9+qISmq9tNo1NacplUVWa9c6GHsalIBan2OfPA8i6qfp4wCAI6vLPJSkdXJ3KX6I4jKFEhZoFqTRcj65I1ivbyQ5PVIkuaGPqWETfmWad0jEVoSkB7enbQ4kXJe/SekH3iQDGMBpsIpT3CuZoIjPhDLJHt6kWBJVz2VByxFfNc1zmVQmPeRE56FFbrRd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2018 12:18:00.4254 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b9ed96c7-7c90-48eb-9cfa-08d6043b79a8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0702MB3629 X-OriginatorOrg: ericsson.com X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCIsWRmVeSWpSXmKPExsUyM2J7ie6vPWXRBruf61m8+7SdyYHR49eC pawBjFFcNimpOZllqUX6dglcGXdvnWEpaOCrmHDrMGsD407uLkZODgkBE4m/e/6zdDFycQgJ HGWUWPBjNSuE841R4siP82xwzvm7WxkhnCVMEh+XXAHLsAhMYJY4cu8FC8gwRoFYiXNd95kh qnqYJN6eu8MMkmATMJDYfnESO4gtIiAksfTjZSCbg4NZQE9iwV5WkLCwQKjEobPNYOUsAqoS 19pWgdm8Al4S7/9+YIc4Vk7i5LHJrBBxQYmTM5+A7WUWkJA4+OIFM0SNksSuzRA3SAjMYpT4 /PEdE0hCSEBd4smjbiaIIlmJo2fnsEDYvhINrZvZIOxLjBJH78tD2E3sEpOnmIHcKSGgIzGr qR4ivItd4v2uGAg7X+J+41Oo22IkLl2fxwhz56nec0wQN+xklvhy8wYrREJG4tkPSMhJCJxl ldjzbS77BEadWUgemoXkoQWMTKsYRYtTi4tz042M9FKLMpOLi/Pz9PJSSzYxAuP+4JbfVjsY Dz53PMQowMGoxMPLv6EsWog1say4MvcQowQHs5IIb+RyoBBvSmJlVWpRfnxRaU5q8SFGaQ4W JXFepzSLKCGB9MSS1OzU1ILUIpgsEwenVAPjgnfbhE4+UXpQmjMhYn8uT5dD/vI7hoXpLLsv +LKyf6oweicb+jOd2WD306MPa8qkGpIcn5QcFzjc2Hag+qGzsd2vK1yWKkarJq1UW5rWZ7X1 2/qty3Q6GwMDQnxyVfac4D9eoFLfZqG2ZUqsf6HXunMci2t9tRvU9y3W+PqruMT94rnTD6Yr sRRnJBpqMRcVJwIAIWDZ5vcCAAA= Subject: [dpdk-dev] [PATCH] vhost: initializing iotlb memory only when IOMMU feature is enabled. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
vhost: initializing iotlb memory only when IOMMU feature is enabled.
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/Intel-compilation | success | Compilation OK |
Commit Message
Nitin Katiyar
Aug. 17, 2018, 8:19 p.m. UTC
DPDK 17.11 introduced the IOMMU feature which caused additional
DPDK memory requirement per vhostuser device as part of
iotlb_init(). Today this is done unconditionally (from DPDK
17.11 onwards) i.e. irrespective of IOMMU feature being
enabled on the vhostuser device, iotlb is initialized. This
breaks the backward compatibility for applications like OVS
due to increase in the DPDK memory footprint and causes upgrade
failures.
This patch is to do iotlb_init only if IOMMU feature is
enabled on device.
Signed-off-by: Nitin Katiyar <nitin.katiyar@ericsson.com>
---
lib/librte_vhost/iotlb.c | 7 +++++++
lib/librte_vhost/vhost_user.c | 6 ++++++
2 files changed, 13 insertions(+)
Comments
On 17.08.2018 23:19, Nitin Katiyar wrote: > DPDK 17.11 introduced the IOMMU feature which caused additional > DPDK memory requirement per vhostuser device as part of > iotlb_init(). Today this is done unconditionally (from DPDK > 17.11 onwards) i.e. irrespective of IOMMU feature being > enabled on the vhostuser device, iotlb is initialized. This > breaks the backward compatibility for applications like OVS > due to increase in the DPDK memory footprint and causes upgrade > failures. >> This patch is to do iotlb_init only if IOMMU feature is > enabled on device. I guess, "Fixes" line should be here? > > Signed-off-by: Nitin Katiyar <nitin.katiyar@ericsson.com> > --- > lib/librte_vhost/iotlb.c | 7 +++++++ > lib/librte_vhost/vhost_user.c | 6 ++++++ > 2 files changed, 13 insertions(+) > > diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c > index c6354fe..befa2d3 100644 > --- a/lib/librte_vhost/iotlb.c > +++ b/lib/librte_vhost/iotlb.c > @@ -317,6 +317,13 @@ struct vhost_iotlb_entry { > struct vhost_virtqueue *vq = dev->virtqueue[vq_index]; > int socket = 0; > > + if (!(dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) { vhost_user_iotlb_init() is called on the virtqueue allocation stage, most likely while processing VHOST_USER_SET_VRING_CALL. QEMU usually sends VHOST_USER_SET_FEATURES after the VHOST_USER_SET_VRING_CALL. This means that 'dev->features' are not yet initialized here. Have you tested that IOMMU feature works with this patch applied? > + RTE_LOG(INFO, VHOST_CONFIG, > + "IOMMU feature is not enabled for this dev(%s)\n", > + dev->ifname); > + return 0; > + } > + > if (vq->iotlb_pool) { > /* > * The cache has already been initialized, > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index a2d4c9f..7553a03 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -1366,6 +1366,12 @@ > uint16_t i; > uint64_t vva, len; > > + if (!(dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) { > + RTE_LOG(ERR, VHOST_CONFIG, > + "IOMMU feature is not enabled for this dev(%s)\n", > + dev->ifname); > + return -1; > + } > switch (imsg->type) { > case VHOST_IOTLB_UPDATE: > len = imsg->size; >
Hi Ilya, Thanks for your comments. I haven't tested with IOMMU enabled. I covered more of memory utilization by testing OVS with DPDK. I will test out by enabling IOMMU and send the updated patch. Regards, Nitin -----Original Message----- From: Ilya Maximets [mailto:i.maximets@samsung.com] Sent: Friday, August 17, 2018 7:36 PM To: Nitin Katiyar <nitin.katiyar@ericsson.com>; dev@dpdk.org Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Bie, Tiwei <tiwei.bie@intel.com>; Zhihong Wang <zhihong.wang@intel.com> Subject: Re: vhost: initializing iotlb memory only when IOMMU feature is enabled. On 17.08.2018 23:19, Nitin Katiyar wrote: > DPDK 17.11 introduced the IOMMU feature which caused additional DPDK > memory requirement per vhostuser device as part of iotlb_init(). Today > this is done unconditionally (from DPDK > 17.11 onwards) i.e. irrespective of IOMMU feature being enabled on the > vhostuser device, iotlb is initialized. This breaks the backward > compatibility for applications like OVS due to increase in the DPDK > memory footprint and causes upgrade failures. >> This patch is to do iotlb_init only if IOMMU feature is > enabled on device. I guess, "Fixes" line should be here? > > Signed-off-by: Nitin Katiyar <nitin.katiyar@ericsson.com> > --- > lib/librte_vhost/iotlb.c | 7 +++++++ > lib/librte_vhost/vhost_user.c | 6 ++++++ > 2 files changed, 13 insertions(+) > > diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c index > c6354fe..befa2d3 100644 > --- a/lib/librte_vhost/iotlb.c > +++ b/lib/librte_vhost/iotlb.c > @@ -317,6 +317,13 @@ struct vhost_iotlb_entry { > struct vhost_virtqueue *vq = dev->virtqueue[vq_index]; > int socket = 0; > > + if (!(dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) { vhost_user_iotlb_init() is called on the virtqueue allocation stage, most likely while processing VHOST_USER_SET_VRING_CALL. QEMU usually sends VHOST_USER_SET_FEATURES after the VHOST_USER_SET_VRING_CALL. This means that 'dev->features' are not yet initialized here. Have you tested that IOMMU feature works with this patch applied? > + RTE_LOG(INFO, VHOST_CONFIG, > + "IOMMU feature is not enabled for this dev(%s)\n", > + dev->ifname); > + return 0; > + } > + > if (vq->iotlb_pool) { > /* > * The cache has already been initialized, diff --git > a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index > a2d4c9f..7553a03 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -1366,6 +1366,12 @@ > uint16_t i; > uint64_t vva, len; > > + if (!(dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) { > + RTE_LOG(ERR, VHOST_CONFIG, > + "IOMMU feature is not enabled for this dev(%s)\n", > + dev->ifname); > + return -1; > + } > switch (imsg->type) { > case VHOST_IOTLB_UPDATE: > len = imsg->size; >
diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c index c6354fe..befa2d3 100644 --- a/lib/librte_vhost/iotlb.c +++ b/lib/librte_vhost/iotlb.c @@ -317,6 +317,13 @@ struct vhost_iotlb_entry { struct vhost_virtqueue *vq = dev->virtqueue[vq_index]; int socket = 0; + if (!(dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) { + RTE_LOG(INFO, VHOST_CONFIG, + "IOMMU feature is not enabled for this dev(%s)\n", + dev->ifname); + return 0; + } + if (vq->iotlb_pool) { /* * The cache has already been initialized, diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index a2d4c9f..7553a03 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1366,6 +1366,12 @@ uint16_t i; uint64_t vva, len; + if (!(dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) { + RTE_LOG(ERR, VHOST_CONFIG, + "IOMMU feature is not enabled for this dev(%s)\n", + dev->ifname); + return -1; + } switch (imsg->type) { case VHOST_IOTLB_UPDATE: len = imsg->size;