From: Jason Wang <jasowang@redhat.com>
To: mst@redhat.com, jasowang@redhat.com
Cc: virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, elic@nvidia.com, parav@nvidia.com
Subject: [PATCH] vdpa: mandate 1.0 device
Date: Fri, 4 Jun 2021 13:02:51 +0800 [thread overview]
Message-ID: <20210604050251.57834-1-jasowang@redhat.com> (raw)
This patch mandates 1.0 for vDPA devices. The plan is never to support
transitional devices for vDPA devices in the future.
The reasons are:
- To have the semantic of normative statement in the virtio spec and
eliminate the burden of transitional device for both vDPA bus and
vDPA parent
- Eliminate the efforts for dealing with endian conversion in the
management tool
- Mandate vDPA vendor to ship modern device instead of transitional
device which is easily broken and unsafe
- Transitional device never work since the first day of vDPA
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
include/linux/vdpa.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index f311d227aa1b..11dd05b805a7 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -6,6 +6,7 @@
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/vhost_iotlb.h>
+#include <uapi/linux/virtio_config.h>
/**
* struct vdpa_calllback - vDPA callback definition.
@@ -328,6 +329,11 @@ static inline int vdpa_set_features(struct vdpa_device *vdev, u64 features)
{
const struct vdpa_config_ops *ops = vdev->config;
+ /* Mandating 1.0 to have semantics of normative statements in
+ * the spec. */
+ if (!(features & BIT_ULL(VIRTIO_F_VERSION_1)))
+ return -EINVAL;
+
vdev->features_valid = true;
return ops->set_features(vdev, features);
}
--
2.25.1
next reply other threads:[~2021-06-04 5:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 5:02 Jason Wang [this message]
2021-06-04 7:57 ` Stefano Garzarella
2021-06-06 6:31 ` Eli Cohen
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=20210604050251.57834-1-jasowang@redhat.com \
--to=jasowang@redhat.com \
--cc=elic@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=parav@nvidia.com \
--cc=virtualization@lists.linux-foundation.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
all inboxes | Powered by JetHome®