aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaraz Vahedi <kfv@kfv.io>2026-07-09 20:00:07 +0000
committerEnji Cooper <ngie@FreeBSD.org>2026-07-15 06:57:40 +0000
commitf9a4dd60b0cf4ce920a83b125f81ee401fc471ce (patch)
treee5316af4acaef252c1a591b2841cf9e11507f1c5
parent3ff24c76c140d5c533915caecfe4af201126f243 (diff)
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
-rw-r--r--sys/dev/virtio/virtio.c8
-rw-r--r--sys/dev/virtio/virtio_config.h28
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