Re: [PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-02-06 Thread Jason Wang
On 2017年02月06日 01:15, Christoph Hellwig wrote: This lets IRQ layer handle dispatching IRQs to separate handlers for the case where we don't have per-VQ MSI-X vectors, and allows us to greatly simplify the code based on the assumption that we always have interrupt vector 0 (legacy INTx or config

[PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-02-05 Thread Christoph Hellwig
This lets IRQ layer handle dispatching IRQs to separate handlers for the case where we don't have per-VQ MSI-X vectors, and allows us to greatly simplify the code based on the assumption that we always have interrupt vector 0 (legacy INTx or config interrupt for MSI-X) available, and any other inte

Re: [PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-02-03 Thread Jason Wang
On 2017年02月03日 17:52, Christoph Hellwig wrote: On Fri, Feb 03, 2017 at 05:47:41PM +0800, Jason Wang wrote: No, we need to allocate the array larger in that case as want proper names for the interrupts. Consider the case of !per_vq_vectors, the size of msix_names is 2, but snprintf can do out

Re: [PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-02-03 Thread Christoph Hellwig
On Fri, Feb 03, 2017 at 05:47:41PM +0800, Jason Wang wrote: >> No, we need to allocate the array larger in that case as want proper >> names for the interrupts. > > Consider the case of !per_vq_vectors, the size of msix_names is 2, but > snprintf can do out of bound accessing here. (We name the ms

Re: [PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-02-03 Thread Jason Wang
On 2017年02月03日 16:26, Christoph Hellwig wrote: On Fri, Feb 03, 2017 at 03:54:54PM +0800, Jason Wang wrote: On 2017年01月27日 16:16, Christoph Hellwig wrote: + snprintf(vp_dev->msix_names[i + 1], +sizeof(*vp_dev->msix_names), "%s-%s",

Re: [PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-02-03 Thread Christoph Hellwig
On Fri, Feb 03, 2017 at 03:54:54PM +0800, Jason Wang wrote: > On 2017年01月27日 16:16, Christoph Hellwig wrote: >> +snprintf(vp_dev->msix_names[i + 1], >> + sizeof(*vp_dev->msix_names), "%s-%s", >> dev_name(&vp_dev->vdev.dev), names[i]); >>

Re: [PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-02-02 Thread Jason Wang
On 2017年01月27日 16:16, Christoph Hellwig wrote: + snprintf(vp_dev->msix_names[i + 1], +sizeof(*vp_dev->msix_names), "%s-%s", dev_name(&vp_dev->vdev.dev), names[i]); err = request_irq(pci_irq_vector(vp_dev->pci_dev, ms

[PATCH 2/9] virtio_pci: use shared interrupts for virtqueues

2017-01-27 Thread Christoph Hellwig
This lets IRQ layer handle dispatching IRQs to separate handlers for the case where we don't have per-VQ MSI-X vectors, and allows us to greatly simplify the code based on the assumption that we always have interrupt vector 0 (legacy INTx or config interrupt for MSI-X) available, and any other inte