virtio: Use pci_enable_msix_range() instead of pci_enable_msix()
Subsystems (2)
PATCH 1/1 virtio: Use pci_enable_msix_range() instead of pci_enable_msix()
As result deprecation of MSI-X/MSI enablement functions pci_enable_msix() and pci_enable_msi_block() all drivers using these two interfaces need to be updated to use the new pci_enable_msi_range() and pci_enable_msix_range() interfaces.
--- drivers/virtio/virtio_pci.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/virtio/virtio_pci.c +3 -5
@@ -333,11 +333,9 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,for (i =0 ; i < nvectors; ++i) vp_dev->msix_entries[i].entry = i; -/* pci_enable_msix returns positive if we can't get this many. */ - err =pci_enable_msix (vp_dev->pci_dev, vp_dev->msix_entries, nvectors); -if (err >0 ) - err = -ENOSPC ; -if (err) + err =pci_enable_msix_range (vp_dev->pci_dev, + vp_dev->msix_entries, nvectors, nvectors); +if (err <0 ) goto error; vp_dev->msix_enabled =1 ;
Signature · 1 line
1.7.7.6
Quoted 24 lines · Alexander Gordeev
As result deprecation of MSI-X/MSI enablement functions
pci_enable_msix()andpci_enable_msi_block()all drivers using these two interfaces need to be updated to use the newpci_enable_msi_range()andpci_enable_msix_range()interfaces.Signed-off-by Alexander Gordeev <[email protected]>Cc Rusty Russell <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>--- drivers/virtio/virtio_pci.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)drivers/virtio/virtio_pci.c +0
-0@@ -333,11 +333,9 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,for (i =0 ; i < nvectors; ++i) vp_dev->msix_entries[i].entry = i;
drivers/virtio/virtio_pci.c static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, · line 340
Quoted 10 lines
drivers/virtio/virtio_pci.c +3
-5-/* pci_enable_msix returns positive if we can't get this many. */ - err =pci_enable_msix (vp_dev->pci_dev, vp_dev->msix_entries, nvectors); -if (err >0 ) - err = -ENOSPC ; -if (err) + err =pci_enable_msix_range (vp_dev->pci_dev, + vp_dev->msix_entries, nvectors, nvectors); +if (err <0 ) goto error; vp_dev->msix_enabled =1 ;
I've put this in my pending queue, but in case someone else wants to take it:
Cheers,
Rusty.
Quoted 24 lines · Alexander Gordeev
As result deprecation of MSI-X/MSI enablement functions
pci_enable_msix()andpci_enable_msi_block()all drivers using these two interfaces need to be updated to use the newpci_enable_msi_range()andpci_enable_msix_range()interfaces.Signed-off-by Alexander Gordeev <[email protected]>Cc Rusty Russell <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>--- drivers/virtio/virtio_pci.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)drivers/virtio/virtio_pci.c +0
-0@@ -333,11 +333,9 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,for (i =0 ; i < nvectors; ++i) vp_dev->msix_entries[i].entry = i;
drivers/virtio/virtio_pci.c static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors, · line 340
Quoted 10 lines
drivers/virtio/virtio_pci.c +3
-5-/* pci_enable_msix returns positive if we can't get this many. */ - err =pci_enable_msix (vp_dev->pci_dev, vp_dev->msix_entries, nvectors); -if (err >0 ) - err = -ENOSPC ; -if (err) + err =pci_enable_msix_range (vp_dev->pci_dev, + vp_dev->msix_entries, nvectors, nvectors); +if (err <0 ) goto error; vp_dev->msix_enabled =1 ;
I've put this in my pending queue, but in case someone else wants to take it:
Cheers,
Rusty.
Hi Rusty et al,
Based on recently accepted to the mainline pci_enable_msix_exact() function, I am sending a updated version of the patch. Please, let me know if it does not work for you and you need and incremental update from the previous version.
Thanks!
Signature · 3 lines
Regards, Alexander Gordeev [email protected]
PATCH v2 1/1 virtio: Use pci_enable_msix_exact() instead of pci_enable_msix()
As result of deprecation of MSI-X/MSI enablement functions pci_enable_msix() and pci_enable_msi_block() all drivers using these two interfaces need to be updated to use the new pci_enable_msi_range() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces.
--- drivers/virtio/virtio_pci.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/virtio/virtio_pci.c +2 -4
@@ -333,10 +333,8 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,for (i =0 ; i < nvectors; ++i) vp_dev->msix_entries[i].entry = i; -/* pci_enable_msix returns positive if we can't get this many. */ - err =pci_enable_msix (vp_dev->pci_dev, vp_dev->msix_entries, nvectors); -if (err >0 ) - err = -ENOSPC ; + err =pci_enable_msix_exact (vp_dev->pci_dev, + vp_dev->msix_entries, nvectors);if (err) goto error; vp_dev->msix_enabled =1 ;
Signature · 6 lines
1.7.7.6 -- Regards, Alexander Gordeev [email protected]
Re: [PATCH v2] virtio: Use pci_enable_msix_exact() instead of pci_enable_msix()
Quoted 6 lines · Alexander Gordeev
As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix()andpci_enable_msi_block()all drivers using these two interfaces need to be updated to use the newpci_enable_msi_range()orpci_enable_msi_exact()andpci_enable_msix_range()orpci_enable_msix_exact()interfaces.
Quoted 34 lines
Signed-off-by Alexander Gordeev <[email protected]>Cc Rusty Russell <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>--- drivers/virtio/virtio_pci.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)drivers/virtio/virtio_pci.c +2
-4@@ -333,10 +333,8 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,for (i =0 ; i < nvectors; ++i) vp_dev->msix_entries[i].entry = i; -/* pci_enable_msix returns positive if we can't get this many. */ - err =pci_enable_msix (vp_dev->pci_dev, vp_dev->msix_entries, nvectors); -if (err >0 ) - err = -ENOSPC ; + err =pci_enable_msix_exact (vp_dev->pci_dev, + vp_dev->msix_entries, nvectors);if (err) goto error; vp_dev->msix_enabled =1 ;Signature · 6 lines
1.7.7.6 -- Regards, Alexander Gordeev [email protected]
Rusty Russell
AppliedRe: [PATCH v2] virtio: Use pci_enable_msix_exact() instead of pci_enable_msix()
Quoted 10 lines · Michael S. Tsirkin
Quoted 6 lines · Alexander Gordeev
As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix()andpci_enable_msi_block()all drivers using these two interfaces need to be updated to use the newpci_enable_msi_range()orpci_enable_msi_exact()andpci_enable_msix_range()orpci_enable_msix_exact()interfaces.
Thanks, applied.
Cheers,
Rusty.
Rusty Russell
AppliedRe: [PATCH v2] virtio: Use pci_enable_msix_exact() instead of pci_enable_msix()
In reply to Michael S. TsirkinQuoted 10 lines · Michael S. Tsirkin
Quoted 6 lines · Alexander Gordeev
As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix()andpci_enable_msi_block()all drivers using these two interfaces need to be updated to use the newpci_enable_msi_range()orpci_enable_msi_exact()andpci_enable_msix_range()orpci_enable_msix_exact()interfaces.
Thanks, applied.
Cheers,
Rusty.
Quoted 6 lines · Alexander Gordeev
As result deprecation of MSI-X/MSI enablement functions
pci_enable_msix()andpci_enable_msi_block()all drivers using these two interfaces need to be updated to use the newpci_enable_msi_range()andpci_enable_msix_range()interfaces.
Quoted 6 lines
Signed-off-by Alexander Gordeev <[email protected]>Cc Rusty Russell <[email protected]>Cc "Michael S. Tsirkin" <[email protected]>
Quoted 25 lines
--- drivers/virtio/virtio_pci.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)drivers/virtio/virtio_pci.c +3
-5@@ -333,11 +333,9 @@ static int vp_request_msix_vectors(struct virtio_device *vdev, int nvectors,for (i =0 ; i < nvectors; ++i) vp_dev->msix_entries[i].entry = i; -/* pci_enable_msix returns positive if we can't get this many. */ - err =pci_enable_msix (vp_dev->pci_dev, vp_dev->msix_entries, nvectors); -if (err >0 ) - err = -ENOSPC ; -if (err) + err =pci_enable_msix_range (vp_dev->pci_dev, + vp_dev->msix_entries, nvectors, nvectors); +if (err <0 ) goto error; vp_dev->msix_enabled =1 ;Signature · 1 line
1.7.7.6