Displaying 14 results from an estimated 14 matches for "virtio_mdev_config".
2019 Sep 10
1
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...reak;
> + case VIRTIO_MDEV_QUEUE_AVAIL_HIGH:
> + *val = vq->driver_addr_hi;
> + break;
> + case VIRTIO_MDEV_QUEUE_USED_LOW:
> + *val = vq->device_addr_lo;
> + break;
> + case VIRTIO_MDEV_QUEUE_USED_HIGH:
> + *val = vq->device_addr_hi;
> + break;
> + case VIRTIO_MDEV_CONFIG_GENERATION:
> + *val = 1;
> + break;
> + default:
> + pr_err("Unsupported mdev read offset at 0x%x\n", pos);
> + break;
> + }
> +
> + return 4;
> +}
> +
> +static ssize_t mvnet_read_net_config(struct mdev_device *mdev,
> + char *buf, size_t...
2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...> +
> > > +/* Selected queue's Used Ring address, 64 bits in two halves */
> > > +#define VIRTIO_MDEV_QUEUE_USED_LOW 0x0a0
> > > +#define VIRTIO_MDEV_QUEUE_USED_HIGH 0x0a4
> > > +
> > > +/* Configuration atomicity value */
> > > +#define VIRTIO_MDEV_CONFIG_GENERATION 0x0fc
> > > +
> > > +/* The config space is defined by each driver as
> > > + * the per-driver configuration space - Read Write */
> > > +#define VIRTIO_MDEV_CONFIG 0x100
> > Mixing device and generic config space is what virtio pci did,
> &g...
2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...> +
> > > +/* Selected queue's Used Ring address, 64 bits in two halves */
> > > +#define VIRTIO_MDEV_QUEUE_USED_LOW 0x0a0
> > > +#define VIRTIO_MDEV_QUEUE_USED_HIGH 0x0a4
> > > +
> > > +/* Configuration atomicity value */
> > > +#define VIRTIO_MDEV_CONFIG_GENERATION 0x0fc
> > > +
> > > +/* The config space is defined by each driver as
> > > + * the per-driver configuration space - Read Write */
> > > +#define VIRTIO_MDEV_CONFIG 0x100
> > Mixing device and generic config space is what virtio pci did,
> &g...
2019 Sep 10
0
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...E_AVAIL_LOW:
+ *val = vq->driver_addr_lo;
+ break;
+ case VIRTIO_MDEV_QUEUE_AVAIL_HIGH:
+ *val = vq->driver_addr_hi;
+ break;
+ case VIRTIO_MDEV_QUEUE_USED_LOW:
+ *val = vq->device_addr_lo;
+ break;
+ case VIRTIO_MDEV_QUEUE_USED_HIGH:
+ *val = vq->device_addr_hi;
+ break;
+ case VIRTIO_MDEV_CONFIG_GENERATION:
+ *val = 1;
+ break;
+ default:
+ pr_err("Unsupported mdev read offset at 0x%x\n", pos);
+ break;
+ }
+
+ return 4;
+}
+
+static ssize_t mvnet_read_net_config(struct mdev_device *mdev,
+ char *buf, size_t count, loff_t pos)
+{
+ struct mvnet_state *mvnet = mdev_get...
2019 Sep 10
8
[RFC PATCH 0/4] mdev based hardware virtio offloading support
Hi all:
There are hardware that can do virtio datapath offloading while having
its own control path. This path tries to implement a mdev based
unified API to support using kernel virtio driver to drive those
devices. This is done by introducing a new mdev transport for virtio
(virtio_mdev) and register itself as a new kind of mdev driver. Then
it provides a unified way for kernel virtio driver to
2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...uct virtio_device *vdev, unsigned offset,
> + void *buf, unsigned len)
> +{
> + struct virtio_mdev_device *vm_dev = to_virtio_mdev_device(vdev);
> + struct mdev_device *mdev = vm_dev->mdev;
> + struct mdev_parent *parent = mdev->parent;
> +
> + loff_t off = offset + VIRTIO_MDEV_CONFIG;
> +
> + switch (len) {
> + case 1:
> + *(u8 *)buf = parent->ops->read(mdev, buf, 1, &off);
> + break;
> + case 2:
> + *(u16 *)buf = parent->ops->read(mdev, buf, 2, &off);
> + break;
> + case 4:
> + *(u32 *)buf = parent->ops->read(mdev, b...
2019 Sep 10
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...uct virtio_device *vdev, unsigned offset,
> + void *buf, unsigned len)
> +{
> + struct virtio_mdev_device *vm_dev = to_virtio_mdev_device(vdev);
> + struct mdev_device *mdev = vm_dev->mdev;
> + struct mdev_parent *parent = mdev->parent;
> +
> + loff_t off = offset + VIRTIO_MDEV_CONFIG;
> +
> + switch (len) {
> + case 1:
> + *(u8 *)buf = parent->ops->read(mdev, buf, 1, &off);
> + break;
> + case 2:
> + *(u16 *)buf = parent->ops->read(mdev, buf, 2, &off);
> + break;
> + case 4:
> + *(u32 *)buf = parent->ops->read(mdev, b...
2019 Sep 10
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...+
+static void virtio_mdev_get(struct virtio_device *vdev, unsigned offset,
+ void *buf, unsigned len)
+{
+ struct virtio_mdev_device *vm_dev = to_virtio_mdev_device(vdev);
+ struct mdev_device *mdev = vm_dev->mdev;
+ struct mdev_parent *parent = mdev->parent;
+
+ loff_t off = offset + VIRTIO_MDEV_CONFIG;
+
+ switch (len) {
+ case 1:
+ *(u8 *)buf = parent->ops->read(mdev, buf, 1, &off);
+ break;
+ case 2:
+ *(u16 *)buf = parent->ops->read(mdev, buf, 2, &off);
+ break;
+ case 4:
+ *(u32 *)buf = parent->ops->read(mdev, buf, 4, &off);
+ break;
+ case 8:
+ *(u32 *)b...
2019 Sep 10
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...RTIO_MDEV_QUEUE_AVAIL_HIGH 0x094
>> +
>> +/* Selected queue's Used Ring address, 64 bits in two halves */
>> +#define VIRTIO_MDEV_QUEUE_USED_LOW 0x0a0
>> +#define VIRTIO_MDEV_QUEUE_USED_HIGH 0x0a4
>> +
>> +/* Configuration atomicity value */
>> +#define VIRTIO_MDEV_CONFIG_GENERATION 0x0fc
>> +
>> +/* The config space is defined by each driver as
>> + * the per-driver configuration space - Read Write */
>> +#define VIRTIO_MDEV_CONFIG 0x100
> Mixing device and generic config space is what virtio pci did,
> caused lots of problems with ex...
2019 Sep 11
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...L_LOW 0x090
> +#define VIRTIO_MDEV_QUEUE_AVAIL_HIGH 0x094
> +
> +/* Selected queue's Used Ring address, 64 bits in two halves */
> +#define VIRTIO_MDEV_QUEUE_USED_LOW 0x0a0
> +#define VIRTIO_MDEV_QUEUE_USED_HIGH 0x0a4
> +
> +/* Configuration atomicity value */
> +#define VIRTIO_MDEV_CONFIG_GENERATION 0x0fc
> +
> +/* The config space is defined by each driver as
> + * the per-driver configuration space - Read Write */
> +#define VIRTIO_MDEV_CONFIG 0x100
IIUC, we can use above registers with virtio-mdev parent's
read()/write() to access the mdev device from kernel dri...
2019 Sep 11
2
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...L_LOW 0x090
> +#define VIRTIO_MDEV_QUEUE_AVAIL_HIGH 0x094
> +
> +/* Selected queue's Used Ring address, 64 bits in two halves */
> +#define VIRTIO_MDEV_QUEUE_USED_LOW 0x0a0
> +#define VIRTIO_MDEV_QUEUE_USED_HIGH 0x0a4
> +
> +/* Configuration atomicity value */
> +#define VIRTIO_MDEV_CONFIG_GENERATION 0x0fc
> +
> +/* The config space is defined by each driver as
> + * the per-driver configuration space - Read Write */
> +#define VIRTIO_MDEV_CONFIG 0x100
IIUC, we can use above registers with virtio-mdev parent's
read()/write() to access the mdev device from kernel dri...
2019 Sep 11
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...>>> +/* Selected queue's Used Ring address, 64 bits in two halves */
>>>> +#define VIRTIO_MDEV_QUEUE_USED_LOW 0x0a0
>>>> +#define VIRTIO_MDEV_QUEUE_USED_HIGH 0x0a4
>>>> +
>>>> +/* Configuration atomicity value */
>>>> +#define VIRTIO_MDEV_CONFIG_GENERATION 0x0fc
>>>> +
>>>> +/* The config space is defined by each driver as
>>>> + * the per-driver configuration space - Read Write */
>>>> +#define VIRTIO_MDEV_CONFIG 0x100
>>> Mixing device and generic config space is what virtio pci d...
2019 Sep 11
1
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...ed Ring address, 64 bits in two halves */
> > > > > +#define VIRTIO_MDEV_QUEUE_USED_LOW 0x0a0
> > > > > +#define VIRTIO_MDEV_QUEUE_USED_HIGH 0x0a4
> > > > > +
> > > > > +/* Configuration atomicity value */
> > > > > +#define VIRTIO_MDEV_CONFIG_GENERATION 0x0fc
> > > > > +
> > > > > +/* The config space is defined by each driver as
> > > > > + * the per-driver configuration space - Read Write */
> > > > > +#define VIRTIO_MDEV_CONFIG 0x100
> > > > Mixing device and ge...
2019 Sep 11
0
[RFC PATCH 3/4] virtio: introudce a mdev based transport
...RTIO_MDEV_QUEUE_AVAIL_HIGH 0x094
>> +
>> +/* Selected queue's Used Ring address, 64 bits in two halves */
>> +#define VIRTIO_MDEV_QUEUE_USED_LOW 0x0a0
>> +#define VIRTIO_MDEV_QUEUE_USED_HIGH 0x0a4
>> +
>> +/* Configuration atomicity value */
>> +#define VIRTIO_MDEV_CONFIG_GENERATION 0x0fc
>> +
>> +/* The config space is defined by each driver as
>> + * the per-driver configuration space - Read Write */
>> +#define VIRTIO_MDEV_CONFIG 0x100
> IIUC, we can use above registers with virtio-mdev parent's
> read()/write() to access the md...