search for: virtio_pci_common_cfg

Displaying 20 results from an estimated 137 matches for "virtio_pci_common_cfg".

2013 May 29
0
[PATCH RFC] virtio-pci: new config layout: using memory BAR
On Wed, May 29, 2013 at 02:01:18PM +0930, Rusty Russell wrote: > Anthony Liguori <aliguori at us.ibm.com> writes: > > "Michael S. Tsirkin" <mst at redhat.com> writes: > >> + case offsetof(struct virtio_pci_common_cfg, device_feature_select): > >> + return proxy->device_feature_select; > > > > Oh dear no... Please use defines like the rest of QEMU. > > It is pretty ugly. > > Yet the structure definitions are descriptive, capturing layout, size > and endianness in...
2013 May 29
6
[PATCH RFC] virtio-pci: new config layout: using memory BAR
Anthony Liguori <aliguori at us.ibm.com> writes: > "Michael S. Tsirkin" <mst at redhat.com> writes: >> + case offsetof(struct virtio_pci_common_cfg, device_feature_select): >> + return proxy->device_feature_select; > > Oh dear no... Please use defines like the rest of QEMU. It is pretty ugly. Yet the structure definitions are descriptive, capturing layout, size and endianness in natural a format readable by any C progr...
2013 May 29
6
[PATCH RFC] virtio-pci: new config layout: using memory BAR
Anthony Liguori <aliguori at us.ibm.com> writes: > "Michael S. Tsirkin" <mst at redhat.com> writes: >> + case offsetof(struct virtio_pci_common_cfg, device_feature_select): >> + return proxy->device_feature_select; > > Oh dear no... Please use defines like the rest of QEMU. It is pretty ugly. Yet the structure definitions are descriptive, capturing layout, size and endianness in natural a format readable by any C progr...
2014 Dec 30
0
[PATCH RFC v2 6/7] virtio_pci: macros for PCI layout offsets.
...dern.c | 63 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h index 28c2ce0..5d546c6 100644 --- a/include/uapi/linux/virtio_pci.h +++ b/include/uapi/linux/virtio_pci.h @@ -159,6 +159,36 @@ struct virtio_pci_common_cfg { __le32 queue_used_hi; /* read-write */ }; +/* Macro versions of offsets for the Old Timers! */ +#define VIRTIO_PCI_CAP_VNDR 0 +#define VIRTIO_PCI_CAP_NEXT 1 +#define VIRTIO_PCI_CAP_LEN 2 +#define VIRTIO_PCI_CAP_TYPE_AND_BAR 3 +#define VIRTIO_PCI_CAP_OFFSET 4 +#define VIRTIO_PCI_CAP_LENG...
2014 Dec 30
0
[PATCH RFC v2 6/7] virtio_pci: macros for PCI layout offsets.
...dern.c | 63 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h index 28c2ce0..5d546c6 100644 --- a/include/uapi/linux/virtio_pci.h +++ b/include/uapi/linux/virtio_pci.h @@ -159,6 +159,36 @@ struct virtio_pci_common_cfg { __le32 queue_used_hi; /* read-write */ }; +/* Macro versions of offsets for the Old Timers! */ +#define VIRTIO_PCI_CAP_VNDR 0 +#define VIRTIO_PCI_CAP_NEXT 1 +#define VIRTIO_PCI_CAP_LEN 2 +#define VIRTIO_PCI_CAP_TYPE_AND_BAR 3 +#define VIRTIO_PCI_CAP_OFFSET 4 +#define VIRTIO_PCI_CAP_LENG...
2013 May 28
3
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...tic uint64_t virtio_pci_config_common_read(void *opaque, hwaddr addr, + unsigned size) +{ + VirtIOPCIProxy *proxy = opaque; + VirtIODevice *vdev = proxy->vdev; + + uint64_t low = 0xffffffffull; + + switch (addr) { + case offsetof(struct virtio_pci_common_cfg, device_feature_select): + return proxy->device_feature_select; + case offsetof(struct virtio_pci_common_cfg, device_feature): + /* TODO: 64-bit features */ + return proxy->device_feature_select ? 0 : proxy->host_features; + case offsetof(struct virtio_pci_common_cfg, g...
2013 May 28
3
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...tic uint64_t virtio_pci_config_common_read(void *opaque, hwaddr addr, + unsigned size) +{ + VirtIOPCIProxy *proxy = opaque; + VirtIODevice *vdev = proxy->vdev; + + uint64_t low = 0xffffffffull; + + switch (addr) { + case offsetof(struct virtio_pci_common_cfg, device_feature_select): + return proxy->device_feature_select; + case offsetof(struct virtio_pci_common_cfg, device_feature): + /* TODO: 64-bit features */ + return proxy->device_feature_select ? 0 : proxy->host_features; + case offsetof(struct virtio_pci_common_cfg, g...
2013 May 28
0
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...id *opaque, hwaddr addr, > + unsigned size) > +{ > + VirtIOPCIProxy *proxy = opaque; > + VirtIODevice *vdev = proxy->vdev; > + > + uint64_t low = 0xffffffffull; > + > + switch (addr) { > + case offsetof(struct virtio_pci_common_cfg, device_feature_select): > + return proxy->device_feature_select; Oh dear no... Please use defines like the rest of QEMU. >From a QEMU pov, take a look at: https://github.com/aliguori/qemu/commit/587c35c1a3fe90f6af0f97927047ef4d3182a659 And: https://github.com/aliguori/qemu/co...
2013 May 30
5
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...ny Liguori <aliguori at us.ibm.com> writes: > Rusty Russell <rusty at rustcorp.com.au> writes: > >> Anthony Liguori <aliguori at us.ibm.com> writes: >>> "Michael S. Tsirkin" <mst at redhat.com> writes: >>>> + case offsetof(struct virtio_pci_common_cfg, device_feature_select): >>>> + return proxy->device_feature_select; >>> >>> Oh dear no... Please use defines like the rest of QEMU. >> >> It is pretty ugly. > > I think beauty is in the eye of the beholder here... > > Pretty much eve...
2013 May 30
5
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...ny Liguori <aliguori at us.ibm.com> writes: > Rusty Russell <rusty at rustcorp.com.au> writes: > >> Anthony Liguori <aliguori at us.ibm.com> writes: >>> "Michael S. Tsirkin" <mst at redhat.com> writes: >>>> + case offsetof(struct virtio_pci_common_cfg, device_feature_select): >>>> + return proxy->device_feature_select; >>> >>> Oh dear no... Please use defines like the rest of QEMU. >> >> It is pretty ugly. > > I think beauty is in the eye of the beholder here... > > Pretty much eve...
2014 Dec 11
6
[PATCH RFC 0/5] virtio_pci: modern driver
Based on Rusty's patches. Coding style and funny jokes are his. Bugs and a star wars reference (should be easy to spot) are mine. Untested, but useful as basis for beginning the qemu work. TODO: = simplify probing: use a common probe function, probe with modern driver first, if that fails - probe with legacy driver. BUGS: ATM legacy driver can win and drive a transitional device
2014 Dec 11
6
[PATCH RFC 0/5] virtio_pci: modern driver
Based on Rusty's patches. Coding style and funny jokes are his. Bugs and a star wars reference (should be easy to spot) are mine. Untested, but useful as basis for beginning the qemu work. TODO: = simplify probing: use a common probe function, probe with modern driver first, if that fails - probe with legacy driver. BUGS: ATM legacy driver can win and drive a transitional device
2013 May 29
1
[RFC 7/11] virtio_pci: new, capability-aware driver.
...layout struct? > > Not sure what you mean.... We use a queue_enable field, so it doesn't > matter if the accesses aren't atomic for that. > > Cheers, > Rusty. I mean the struct should have separate _lo and _hi fields. Otherwise I have to do: + case offsetof(struct virtio_pci_common_cfg, queue_desc): + assert(size == 4); + return virtio_queue_get_desc_addr(vdev, vdev->queue_sel) & low; + case offsetof(struct virtio_pci_common_cfg, queue_desc) + 4: + assert(size == 4); + return virtio_queue_get_desc_addr(vdev, vdev->queue_sel) >> 32; Would be nic...
2014 Dec 15
6
[PATCH RFC 0/5] virtio pci: virtio 1.0 support
This is on top of 3.19 master + my bugfix patches, and adds virtio 1.0 support to virtio pci. This is 3.20 material I think. Would like to get feedback on s390 change as it's untested. Michael S Tsirkin (2): pci: add pci_iomap_range s390: add pci_iomap_range Michael S. Tsirkin (2): virtio_pci: modern driver virtio_pci: macros for PCI layout offsets. Rusty Russell (1): virtio-pci:
2014 Dec 15
6
[PATCH RFC 0/5] virtio pci: virtio 1.0 support
This is on top of 3.19 master + my bugfix patches, and adds virtio 1.0 support to virtio pci. This is 3.20 material I think. Would like to get feedback on s390 change as it's untested. Michael S Tsirkin (2): pci: add pci_iomap_range s390: add pci_iomap_range Michael S. Tsirkin (2): virtio_pci: modern driver virtio_pci: macros for PCI layout offsets. Rusty Russell (1): virtio-pci:
2023 May 08
1
[PATCH V2 1/5] vDPA/ifcvf: virt queue ops take immediate actions
...--- a/drivers/vdpa/ifcvf/ifcvf_base.c +++ b/drivers/vdpa/ifcvf/ifcvf_base.c @@ -329,31 +329,49 @@ int ifcvf_set_vq_state(struct ifcvf_hw *hw, u16 qid, u16 num) return 0; } -static int ifcvf_hw_enable(struct ifcvf_hw *hw) +void ifcvf_set_vq_num(struct ifcvf_hw *hw, u16 qid, u32 num) { - struct virtio_pci_common_cfg __iomem *cfg; - u32 i; + struct virtio_pci_common_cfg __iomem *cfg = hw->common_cfg; - cfg = hw->common_cfg; - for (i = 0; i < hw->nr_vring; i++) { - if (!hw->vring[i].ready) - break; + vp_iowrite16(qid, &cfg->queue_select); + vp_iowrite16(num, &cfg->queue_size); +...
2015 Jan 21
9
[PATCH post-squash 0/9] virtio 1.0: virtio-pci fixup
This is just repost of all patches with fixups squashed in - convenient if you just want to remove old ones from queue and apply new ones. I also tweaked commit log for patch "virtio_pci: modern driver" I also included Gerd's tag: Tested-by: Gerd Hoffmann <kraxel at redhat.com> You can find it all before the rebase -i --autosquash in my tree:
2015 Jan 21
9
[PATCH post-squash 0/9] virtio 1.0: virtio-pci fixup
This is just repost of all patches with fixups squashed in - convenient if you just want to remove old ones from queue and apply new ones. I also tweaked commit log for patch "virtio_pci: modern driver" I also included Gerd's tag: Tested-by: Gerd Hoffmann <kraxel at redhat.com> You can find it all before the rebase -i --autosquash in my tree:
2015 Jan 21
14
[PATCH pre-squash 00/14] virtio 1.0: virtio-pci fixup
This is just the full patchset reposted with fixups in correct order, before squashing them. I also tweaked commit log for patch "virtio_pci: modern driver" I also included Gerd's tag: Tested-by: Gerd Hoffmann <kraxel at redhat.com> You can find it all before the rebase -i --autosquash in my tree: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git virtio-next
2015 Jan 21
14
[PATCH pre-squash 00/14] virtio 1.0: virtio-pci fixup
This is just the full patchset reposted with fixups in correct order, before squashing them. I also tweaked commit log for patch "virtio_pci: modern driver" I also included Gerd's tag: Tested-by: Gerd Hoffmann <kraxel at redhat.com> You can find it all before the rebase -i --autosquash in my tree: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git virtio-next