DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nitin Katiyar <nitin.katiyar@ericsson.com>
To: <dev@dpdk.org>
Cc: Nitin Katiyar <nitin.katiyar@ericsson.com>
Subject: [dpdk-dev] [PATCH] vhost: initializing iotlb memory only when IOMMU feature is enabled.
Date: Sat, 18 Aug 2018 01:49:49 +0530	[thread overview]
Message-ID: <1534537189-26763-1-git-send-email-nitin.katiyar@ericsson.com> (raw)

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(+)

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;
-- 
1.9.1

             reply	other threads:[~2018-08-17 12:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17 20:19 Nitin Katiyar [this message]
     [not found] ` <CGME20180817140517eucas1p24703d1c0234958581830c117fce93f14@eucas1p2.samsung.com>
2018-08-17 14:06   ` [dpdk-dev] " Ilya Maximets
2018-08-23  7:33     ` Nitin Katiyar
  -- strict thread matches above, loose matches on Subject: below --
2018-07-04 17:53 [dpdk-dev] [PATCH] " Nitin Katiyar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1534537189-26763-1-git-send-email-nitin.katiyar@ericsson.com \
    --to=nitin.katiyar@ericsson.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).