Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Jason Wang
On 2020/6/8 下午9:29, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 06:07:36PM +0800, Jason Wang wrote: On 2020/6/8 下午5:54, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:46:52PM +0800, Jason Wang wrote: On 2020/6/8 下午5:45, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:43:58P

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Michael S. Tsirkin
On Mon, Jun 08, 2020 at 06:07:36PM +0800, Jason Wang wrote: > > On 2020/6/8 下午5:54, Michael S. Tsirkin wrote: > > On Mon, Jun 08, 2020 at 05:46:52PM +0800, Jason Wang wrote: > > > On 2020/6/8 下午5:45, Michael S. Tsirkin wrote: > > > > On Mon, Jun 08, 2020 at 05:43:58PM +0800, Jason Wang wrote: > >

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Jason Wang
On 2020/6/8 下午5:54, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:46:52PM +0800, Jason Wang wrote: On 2020/6/8 下午5:45, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:43:58PM +0800, Jason Wang wrote: Looking at pci_match_one_device() it checks both subvendor and subdevice there.

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Michael S. Tsirkin
On Mon, Jun 08, 2020 at 05:46:52PM +0800, Jason Wang wrote: > > On 2020/6/8 下午5:45, Michael S. Tsirkin wrote: > > On Mon, Jun 08, 2020 at 05:43:58PM +0800, Jason Wang wrote: > > > > > Looking at > > > > > pci_match_one_device() it checks both subvendor and subdevice there. > > > > > > > > > > Tha

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Jason Wang
On 2020/6/8 下午5:45, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:43:58PM +0800, Jason Wang wrote: Looking at pci_match_one_device() it checks both subvendor and subdevice there. Thanks But IIUC there is no guarantee that driver with a specific subvendor matches in presence of a gener

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Michael S. Tsirkin
On Mon, Jun 08, 2020 at 05:43:58PM +0800, Jason Wang wrote: > > > > > Looking at > > > pci_match_one_device() it checks both subvendor and subdevice there. > > > > > > Thanks > > > > But IIUC there is no guarantee that driver with a specific subvendor > > matches in presence of a generic one. >

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Jason Wang
On 2020/6/8 下午5:31, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 05:18:44PM +0800, Jason Wang wrote: On 2020/6/8 下午2:32, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 11:32:31AM +0800, Jason Wang wrote: On 2020/6/7 下午9:51, Michael S. Tsirkin wrote: On Fri, Jun 05, 2020 at 04:54:17P

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Michael S. Tsirkin
On Mon, Jun 08, 2020 at 05:18:44PM +0800, Jason Wang wrote: > > On 2020/6/8 下午2:32, Michael S. Tsirkin wrote: > > On Mon, Jun 08, 2020 at 11:32:31AM +0800, Jason Wang wrote: > > > On 2020/6/7 下午9:51, Michael S. Tsirkin wrote: > > > > On Fri, Jun 05, 2020 at 04:54:17PM +0800, Jason Wang wrote: > >

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-08 Thread Jason Wang
On 2020/6/8 下午2:32, Michael S. Tsirkin wrote: On Mon, Jun 08, 2020 at 11:32:31AM +0800, Jason Wang wrote: On 2020/6/7 下午9:51, Michael S. Tsirkin wrote: On Fri, Jun 05, 2020 at 04:54:17PM +0800, Jason Wang wrote: On 2020/6/2 下午3:08, Jason Wang wrote: +static const struct pci_device_id vp_vdp

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-07 Thread Michael S. Tsirkin
On Mon, Jun 08, 2020 at 11:32:31AM +0800, Jason Wang wrote: > > On 2020/6/7 下午9:51, Michael S. Tsirkin wrote: > > On Fri, Jun 05, 2020 at 04:54:17PM +0800, Jason Wang wrote: > > > On 2020/6/2 下午3:08, Jason Wang wrote: > > > > > > +static const struct pci_device_id vp_vdpa_id_table[] = { > > > > >

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-07 Thread Jason Wang
On 2020/6/7 下午9:51, Michael S. Tsirkin wrote: On Fri, Jun 05, 2020 at 04:54:17PM +0800, Jason Wang wrote: On 2020/6/2 下午3:08, Jason Wang wrote: +static const struct pci_device_id vp_vdpa_id_table[] = { +    { PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) }, +    { 0 } +}; This looks

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-07 Thread Michael S. Tsirkin
On Fri, Jun 05, 2020 at 04:54:17PM +0800, Jason Wang wrote: > > On 2020/6/2 下午3:08, Jason Wang wrote: > > > > > > > +static const struct pci_device_id vp_vdpa_id_table[] = { > > > > +    { PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) }, > > > > +    { 0 } > > > > +}; > > > This looks lik

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-05 Thread Jason Wang
On 2020/6/2 下午3:08, Jason Wang wrote: +static const struct pci_device_id vp_vdpa_id_table[] = { +    { PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) }, +    { 0 } +}; This looks like it'll create a mess with either virtio pci or vdpa being loaded at random. Maybe just don't specify a

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-04 Thread Michael S. Tsirkin
On Tue, Jun 02, 2020 at 03:12:27PM +0800, Jason Wang wrote: > > On 2020/6/2 下午1:09, Michael S. Tsirkin wrote: > > On Fri, May 29, 2020 at 04:03:02PM +0800, Jason Wang wrote: > > > Note that since virtio specification does not support get/restore > > > virtqueue state. So we can not use this driver

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-02 Thread Jason Wang
On 2020/6/2 下午1:09, Michael S. Tsirkin wrote: On Fri, May 29, 2020 at 04:03:02PM +0800, Jason Wang wrote: Note that since virtio specification does not support get/restore virtqueue state. So we can not use this driver for VM. This can be addressed by extending the virtio specification. Looks

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-02 Thread Jason Wang
On 2020/6/2 下午1:08, Michael S. Tsirkin wrote: On Fri, May 29, 2020 at 04:03:02PM +0800, Jason Wang wrote: +static void vp_vdpa_set_vq_ready(struct vdpa_device *vdpa, +u16 qid, bool ready) +{ + struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa); + + vp_iowrit

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-01 Thread Michael S. Tsirkin
On Fri, May 29, 2020 at 04:03:02PM +0800, Jason Wang wrote: > Note that since virtio specification does not support get/restore > virtqueue state. So we can not use this driver for VM. This can be > addressed by extending the virtio specification. Looks like exactly the kind of hardware limitation

Re: [PATCH 5/6] vdpa: introduce virtio pci driver

2020-06-01 Thread Michael S. Tsirkin
On Fri, May 29, 2020 at 04:03:02PM +0800, Jason Wang wrote: > +static void vp_vdpa_set_vq_ready(struct vdpa_device *vdpa, > + u16 qid, bool ready) > +{ > + struct vp_vdpa *vp_vdpa = vdpa_to_vp(vdpa); > + > + vp_iowrite16(qid, &vp_vdpa->common->queue_select); > +

[PATCH 5/6] vdpa: introduce virtio pci driver

2020-05-29 Thread Jason Wang
This patch introduce a vDPA driver for virtio-pci device. It bridges the virtio-pci control command to the vDPA bus. This will be used for developing new features for both software vDPA framework and hardware vDPA feature. Compared to vdpa_sim, it has several advantages: - it's a real device driv