mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04: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
@@ -29,6 +29,7 @@
|
||||
#include <linux/virtio_pci_modern.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/mutex.h>
|
||||
|
||||
struct virtio_pci_vq_info {
|
||||
/* the actual virtqueue */
|
||||
@@ -44,6 +45,8 @@ struct virtio_pci_vq_info {
|
||||
struct virtio_pci_admin_vq {
|
||||
/* Virtqueue info associated with this admin queue. */
|
||||
struct virtio_pci_vq_info info;
|
||||
/* serializing admin commands execution and virtqueue deletion */
|
||||
struct mutex cmd_lock;
|
||||
/* Name of the admin queue: avq.$vq_index. */
|
||||
char name[10];
|
||||
u16 vq_index;
|
||||
@@ -152,4 +155,7 @@ static inline void virtio_pci_legacy_remove(struct virtio_pci_device *vp_dev)
|
||||
int virtio_pci_modern_probe(struct virtio_pci_device *);
|
||||
void virtio_pci_modern_remove(struct virtio_pci_device *);
|
||||
|
||||
int vp_modern_admin_cmd_exec(struct virtio_device *vdev,
|
||||
struct virtio_admin_cmd *cmd);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user