git: f9a4dd60b0cf - main - virtio: Add feature bit definitions up to VirtIO v1.3
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 15 Jul 2026 06:57:43 UTC
The branch main has been updated by ngie:
URL: https://cgit.FreeBSD.org/src/commit/?id=f9a4dd60b0cf4ce920a83b125f81ee401fc471ce
commit f9a4dd60b0cf4ce920a83b125f81ee401fc471ce
Author: Faraz Vahedi <kfv@kfv.io>
AuthorDate: 2026-07-09 20:00:07 +0000
Commit: Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2026-07-15 06:57:40 +0000
virtio: Add feature bit definitions up to VirtIO v1.3
Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2319
---
sys/dev/virtio/virtio.c | 8 ++++++++
sys/dev/virtio/virtio_config.h | 28 ++++++++++++++++++++++++++--
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/sys/dev/virtio/virtio.c b/sys/dev/virtio/virtio.c
index be5edcafa7ff..a032bfc20499 100644
--- a/sys/dev/virtio/virtio.c
+++ b/sys/dev/virtio/virtio.c
@@ -87,6 +87,14 @@ static struct virtio_feature_desc virtio_common_feature_desc[] = {
{ VIRTIO_F_BAD_FEATURE, "BadFeature" }, /* Legacy */
{ VIRTIO_F_VERSION_1, "Version1" },
{ VIRTIO_F_IOMMU_PLATFORM, "IOMMUPlatform" },
+ { VIRTIO_F_RING_PACKED, "RingPacked" },
+ { VIRTIO_F_IN_ORDER, "InOrder" },
+ { VIRTIO_F_ORDER_PLATFORM, "OrderPlatform" },
+ { VIRTIO_F_SR_IOV, "SRIOV" },
+ { VIRTIO_F_NOTIFICATION_DATA, "NotificationData" },
+ { VIRTIO_F_NOTIF_CONFIG_DATA, "NotifConfigData" },
+ { VIRTIO_F_RING_RESET, "RingReset" },
+ { VIRTIO_F_ADMIN_VQ, "AdminVq" },
{ 0, NULL }
};
diff --git a/sys/dev/virtio/virtio_config.h b/sys/dev/virtio/virtio_config.h
index 02765490ed27..ce6e96a223d4 100644
--- a/sys/dev/virtio/virtio_config.h
+++ b/sys/dev/virtio/virtio_config.h
@@ -63,10 +63,10 @@
* The guest should never negotiate this feature; it
* is used to detect faulty drivers.
*/
-#define VIRTIO_F_BAD_FEATURE (1UL << 30)
+#define VIRTIO_F_BAD_FEATURE (1UL << 30)
/* v1.0 compliant. */
-#define VIRTIO_F_VERSION_1 (1ULL << 32)
+#define VIRTIO_F_VERSION_1 (1ULL << 32)
/*
* If clear - device has the IOMMU bypass quirk feature.
@@ -77,6 +77,30 @@
*/
#define VIRTIO_F_IOMMU_PLATFORM (1ULL << 33)
+/* Support for packed virtqueues. */
+#define VIRTIO_F_RING_PACKED (1ULL << 34)
+
+/* Device may behave as if IN_ORDER was negotiated. */
+#define VIRTIO_F_IN_ORDER (1ULL << 35)
+
+/* Memory accesses are ordered by the platform. */
+#define VIRTIO_F_ORDER_PLATFORM (1ULL << 36)
+
+/* Device supports Single Root I/O Virtualization. */
+#define VIRTIO_F_SR_IOV (1ULL << 37)
+
+/* Driver passes extra data in device notifications. */
+#define VIRTIO_F_NOTIFICATION_DATA (1ULL << 38)
+
+/* Driver uses the data provided by the device as a virtqueue identifier. */
+#define VIRTIO_F_NOTIF_CONFIG_DATA (1ULL << 39)
+
+/* Driver can reset a queue individually. */
+#define VIRTIO_F_RING_RESET (1ULL << 40)
+
+/* Device supports an administration virtqueue. */
+#define VIRTIO_F_ADMIN_VQ (1ULL << 41)
+
/*
* Some VirtIO feature bits (currently bits 28 through 34) are
* reserved for the transport being used (eg. virtio_ring), the