mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-21 21:04:26 -05:00
virtio-pci: Introduce admin command sending function
Add support for sending admin command through admin virtqueue interface. Abort any inflight admin commands once device reset completes. Activate admin queue when device becomes ready; deactivate on device reset. To comply to the below specification statement [1], the admin virtqueue is activated for upper layer users only after setting DRIVER_OK status. [1] The driver MUST NOT send any buffer available notifications to the device before setting DRIVER_OK. Signed-off-by: Feng Liu <feliu@nvidia.com> Reviewed-by: Parav Pandit <parav@nvidia.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Yishai Hadas <yishaih@nvidia.com> Link: https://lore.kernel.org/r/20231219093247.170936-4-yishaih@nvidia.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
committed by
Alex Williamson
parent
fd27ef6b44
commit
92792ac752
@@ -223,4 +223,26 @@ struct virtio_pci_cfg_cap {
|
||||
|
||||
#endif /* VIRTIO_PCI_NO_MODERN */
|
||||
|
||||
/* Admin command status. */
|
||||
#define VIRTIO_ADMIN_STATUS_OK 0
|
||||
|
||||
struct __packed virtio_admin_cmd_hdr {
|
||||
__le16 opcode;
|
||||
/*
|
||||
* 1 - SR-IOV
|
||||
* 2-65535 - reserved
|
||||
*/
|
||||
__le16 group_type;
|
||||
/* Unused, reserved for future extensions. */
|
||||
__u8 reserved1[12];
|
||||
__le64 group_member_id;
|
||||
};
|
||||
|
||||
struct __packed virtio_admin_cmd_status {
|
||||
__le16 status;
|
||||
__le16 status_qualifier;
|
||||
/* Unused, reserved for future extensions. */
|
||||
__u8 reserved2[4];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user