Skip to content

Commit 16c22c5

Browse files
danielj-mellanoxmstsirkin
authored andcommitted
virtio_pci: Use self group type for cap commands
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: bfcad51 ("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>
1 parent 8ffd015 commit 16c22c5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/virtio/virtio_pci_modern.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ virtio_pci_admin_cmd_dev_parts_objects_enable(struct virtio_device *virtio_dev)
247247
sg_init_one(&data_sg, get_data, sizeof(*get_data));
248248
sg_init_one(&result_sg, result, sizeof(*result));
249249
cmd.opcode = cpu_to_le16(VIRTIO_ADMIN_CMD_DEVICE_CAP_GET);
250-
cmd.group_type = cpu_to_le16(VIRTIO_ADMIN_GROUP_TYPE_SRIOV);
250+
cmd.group_type = cpu_to_le16(VIRTIO_ADMIN_GROUP_TYPE_SELF);
251251
cmd.data_sg = &data_sg;
252252
cmd.result_sg = &result_sg;
253253
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)
305305

306306
sg_init_one(&result_sg, data, sizeof(*data));
307307
cmd.opcode = cpu_to_le16(VIRTIO_ADMIN_CMD_CAP_ID_LIST_QUERY);
308-
cmd.group_type = cpu_to_le16(VIRTIO_ADMIN_GROUP_TYPE_SRIOV);
308+
cmd.group_type = cpu_to_le16(VIRTIO_ADMIN_GROUP_TYPE_SELF);
309309
cmd.result_sg = &result_sg;
310310

311311
ret = vp_modern_admin_cmd_exec(virtio_dev, &cmd);

include/uapi/linux/virtio_pci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ struct virtio_pci_cfg_cap {
246246
#define VIRTIO_ADMIN_CMD_LIST_USE 0x1
247247

248248
/* Admin command group type. */
249+
#define VIRTIO_ADMIN_GROUP_TYPE_SELF 0x0
249250
#define VIRTIO_ADMIN_GROUP_TYPE_SRIOV 0x1
250251

251252
/* Transitional device admin command. */

0 commit comments

Comments
 (0)