search for: mdev_get_status

Displaying 12 results from an estimated 12 matches for "mdev_get_status".

Did you mean: dev_get_stats
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...+#include "vhost.h" + +struct vhost_mdev { + /* The lock is to protect this structure. */ + struct mutex mutex; + struct vhost_dev dev; + struct vhost_virtqueue *vqs; + int nvqs; + u64 state; + u64 features; + u64 acked_features; + bool opened; + struct mdev_device *mdev; +}; + +static u8 mdev_get_status(struct mdev_device *mdev) +{ + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + return ops->get_status(mdev); +} + +static void mdev_set_status(struct mdev_device *mdev, u8 status) +{ + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + return ops->se...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...+#include "vhost.h" + +struct vhost_mdev { + /* The lock is to protect this structure. */ + struct mutex mutex; + struct vhost_dev dev; + struct vhost_virtqueue *vqs; + int nvqs; + u64 state; + u64 features; + u64 acked_features; + bool opened; + struct mdev_device *mdev; +}; + +static u8 mdev_get_status(struct mdev_device *mdev) +{ + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + return ops->get_status(mdev); +} + +static void mdev_set_status(struct mdev_device *mdev, u8 status) +{ + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); + + return ops->se...
2019 Sep 26
0
[PATCH] vhost: introduce mdev based hardware backend
...e lock is to protect this structure. */ > + struct mutex mutex; > + struct vhost_dev dev; > + struct vhost_virtqueue *vqs; > + int nvqs; > + u64 state; > + u64 features; > + u64 acked_features; > + bool opened; > + struct mdev_device *mdev; > +}; > + > +static u8 mdev_get_status(struct mdev_device *mdev) > +{ > + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); > + > + return ops->get_status(mdev); > +} > + > +static void mdev_set_status(struct mdev_device *mdev, u8 status) > +{ > + const struct virtio_mdev_device_ops *ops =...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...e lock is to protect this structure. */ > + struct mutex mutex; > + struct vhost_dev dev; > + struct vhost_virtqueue *vqs; > + int nvqs; > + u64 state; > + u64 features; > + u64 acked_features; > + bool opened; > + struct mdev_device *mdev; > +}; > + > +static u8 mdev_get_status(struct mdev_device *mdev) > +{ > + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev); > + > + return ops->get_status(mdev); > +} > + > +static void mdev_set_status(struct mdev_device *mdev, u8 status) > +{ > + const struct virtio_mdev_device_ops *ops =...
2019 Sep 27
5
[PATCH] vhost: introduce mdev based hardware backend
...= mdev_get_dev_ops(mdev); > > + struct virtio_mdev_callback cb; > > + struct vhost_virtqueue *vq; > > + int idx; > > + > > + ops->set_features(mdev, m->acked_features); > > + > > + mdev_add_status(mdev, VIRTIO_CONFIG_S_FEATURES_OK); > > + if (!(mdev_get_status(mdev) & VIRTIO_CONFIG_S_FEATURES_OK)) > > + goto reset; > > + > > + for (idx = 0; idx < m->nvqs; idx++) { > > + vq = &m->vqs[idx]; > > + > > + if (!vq->desc || !vq->avail || !vq->used) > > + break; > > + > > + if...
2019 Sep 27
5
[PATCH] vhost: introduce mdev based hardware backend
...= mdev_get_dev_ops(mdev); > > + struct virtio_mdev_callback cb; > > + struct vhost_virtqueue *vq; > > + int idx; > > + > > + ops->set_features(mdev, m->acked_features); > > + > > + mdev_add_status(mdev, VIRTIO_CONFIG_S_FEATURES_OK); > > + if (!(mdev_get_status(mdev) & VIRTIO_CONFIG_S_FEATURES_OK)) > > + goto reset; > > + > > + for (idx = 0; idx < m->nvqs; idx++) { > > + vq = &m->vqs[idx]; > > + > > + if (!vq->desc || !vq->avail || !vq->used) > > + break; > > + > > + if...
2019 Sep 27
1
[PATCH] vhost: introduce mdev based hardware backend
...> > > > + struct vhost_virtqueue *vq; > > > > + int idx; > > > > + > > > > + ops->set_features(mdev, m->acked_features); > > > > + > > > > + mdev_add_status(mdev, VIRTIO_CONFIG_S_FEATURES_OK); > > > > + if (!(mdev_get_status(mdev) & VIRTIO_CONFIG_S_FEATURES_OK)) > > > > + goto reset; > > > > + > > > > + for (idx = 0; idx < m->nvqs; idx++) { > > > > + vq = &m->vqs[idx]; > > > > + > > > > + if (!vq->desc || !vq->avail || !vq...
2019 Sep 17
0
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...r now, as we + * don't have a proper way to access parent ops directly yet. + * + * virtio_mdev_readl() + * virtio_mdev_writel() + */ +extern u32 virtio_mdev_readl(struct mdev_device *mdev, loff_t off); +extern void virtio_mdev_writel(struct mdev_device *mdev, loff_t off, u32 val); + +static u8 mdev_get_status(struct mdev_device *mdev) +{ + return virtio_mdev_readl(mdev, VIRTIO_MDEV_STATUS); +} + +static void mdev_set_status(struct mdev_device *mdev, u8 status) +{ + virtio_mdev_writel(mdev, VIRTIO_MDEV_STATUS, status); +} + +static void mdev_add_status(struct mdev_device *mdev, u8 status) +{ + status |=...
2019 Sep 17
1
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...tio_mdev_readl(struct mdev_device *mdev, loff_t off); > +extern void virtio_mdev_writel(struct mdev_device *mdev, loff_t off, u32 val); Need to consider a better approach, I feel we should do it through some kind of mdev driver instead of talk to mdev device directly. > + > +static u8 mdev_get_status(struct mdev_device *mdev) > +{ > + return virtio_mdev_readl(mdev, VIRTIO_MDEV_STATUS); > +} > + > +static void mdev_set_status(struct mdev_device *mdev, u8 status) > +{ > + virtio_mdev_writel(mdev, VIRTIO_MDEV_STATUS, status); > +} > + > +static void mdev_add_status(st...
2019 Sep 17
7
[RFC v4 0/3] vhost: introduce mdev based hardware backend
This RFC is to demonstrate below ideas, a) Build vhost-mdev on top of the same abstraction defined in the virtio-mdev series [1]; b) Introduce /dev/vhost-mdev to do vhost ioctls and support setting mdev device as backend; Now the userspace API looks like this: - Userspace generates a compatible mdev device; - Userspace opens this mdev device with VFIO API (including doing IOMMU
2019 Sep 17
7
[RFC v4 0/3] vhost: introduce mdev based hardware backend
This RFC is to demonstrate below ideas, a) Build vhost-mdev on top of the same abstraction defined in the virtio-mdev series [1]; b) Introduce /dev/vhost-mdev to do vhost ioctls and support setting mdev device as backend; Now the userspace API looks like this: - Userspace generates a compatible mdev device; - Userspace opens this mdev device with VFIO API (including doing IOMMU
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...); >>> + struct virtio_mdev_callback cb; >>> + struct vhost_virtqueue *vq; >>> + int idx; >>> + >>> + ops->set_features(mdev, m->acked_features); >>> + >>> + mdev_add_status(mdev, VIRTIO_CONFIG_S_FEATURES_OK); >>> + if (!(mdev_get_status(mdev) & VIRTIO_CONFIG_S_FEATURES_OK)) >>> + goto reset; >>> + >>> + for (idx = 0; idx < m->nvqs; idx++) { >>> + vq = &m->vqs[idx]; >>> + >>> + if (!vq->desc || !vq->avail || !vq->used) >>> + break; >&gt...