]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
virtio_pci: Use self group type for cap commands
authorDaniel Jurgens <danielj@nvidia.com>
Tue, 4 Mar 2025 16:14:42 +0000 (10:14 -0600)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 14 Apr 2025 13:51:31 +0000 (09:51 -0400)
Section 2.12.1.2 of v1.4 of the VirtIO spec states:

The device and driver capabilities commands are currently defined for
self group type.
1. VIRTIO_ADMIN_CMD_CAP_ID_LIST_QUERY
2. VIRTIO_ADMIN_CMD_DEVICE_CAP_GET
3. VIRTIO_ADMIN_CMD_DRIVER_CAP_SET

Fixes: bfcad518605d ("virtio: Manage device and driver capabilities via the admin commands")
Signed-off-by: Daniel Jurgens <danielj@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Message-Id: <20250304161442.90700-1-danielj@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_pci_modern.c
include/uapi/linux/virtio_pci.h

index 5eaade7578606e4b02af0d66447417ad6aa11064..d50fe030d8253445e3866d2d3c8152b5baef7f67 100644 (file)
@@ -247,7 +247,7 @@ virtio_pci_admin_cmd_dev_parts_objects_enable(struct virtio_device *virtio_dev)
        sg_init_one(&data_sg, get_data, sizeof(*get_data));
        sg_init_one(&result_sg, result, sizeof(*result));
        cmd.opcode = cpu_to_le16(VIRTIO_ADMIN_CMD_DEVICE_CAP_GET);
-       cmd.group_type = cpu_to_le16(VIRTIO_ADMIN_GROUP_TYPE_SRIOV);
+       cmd.group_type = cpu_to_le16(VIRTIO_ADMIN_GROUP_TYPE_SELF);
        cmd.data_sg = &data_sg;
        cmd.result_sg = &result_sg;
        ret = vp_modern_admin_cmd_exec(virtio_dev, &cmd);
@@ -305,7 +305,7 @@ static void virtio_pci_admin_cmd_cap_init(struct virtio_device *virtio_dev)
 
        sg_init_one(&result_sg, data, sizeof(*data));
        cmd.opcode = cpu_to_le16(VIRTIO_ADMIN_CMD_CAP_ID_LIST_QUERY);
-       cmd.group_type = cpu_to_le16(VIRTIO_ADMIN_GROUP_TYPE_SRIOV);
+       cmd.group_type = cpu_to_le16(VIRTIO_ADMIN_GROUP_TYPE_SELF);
        cmd.result_sg = &result_sg;
 
        ret = vp_modern_admin_cmd_exec(virtio_dev, &cmd);
index 8549d4571257142ac6c9dad5c01369923791a85a..c691ac210ce2efee783d4bc49de374cc2a359980 100644 (file)
@@ -246,6 +246,7 @@ struct virtio_pci_cfg_cap {
 #define VIRTIO_ADMIN_CMD_LIST_USE      0x1
 
 /* Admin command group type. */
+#define VIRTIO_ADMIN_GROUP_TYPE_SELF   0x0
 #define VIRTIO_ADMIN_GROUP_TYPE_SRIOV  0x1
 
 /* Transitional device admin command. */