bus/pci: fix mapping of PCI resources
PATCH 1/1 bus/pci: fix mapping of PCI resources
From: Alvin Zhang <[email protected]>
When mapping PCI bar resources around the MSI-X table, if the size of the first part is 0, the second part should also be mapped if its size is not 0.
--- drivers/bus/pci/linux/pci_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/pci/linux/pci_vfio.c +1 -1
@@ -565,7 +565,7 @@ }/* if there's a second part, try to map it */ -if (map_addr !=NULL +if ((map_addr !=NULL || memreg[0 ].size ==0 ) && memreg[1 ].offset && memreg[1 ].size) { void *second_addr = RTE_PTR_ADD(bar_addr, (uintptr_t)(memreg[1].offset -
Signature · 1 line
1.8.3.1
Quoted 20 lines · On 28-Sep-20 7:34 AM, [email protected] wrote:
From: Alvin Zhang <[email protected]>
When mapping PCI bar resources around the MSI-X table, if the size of the first part is 0, the second part should also be mapped if its size is not 0.
Fixes e200535c1ca3 ("mem: drop mapping API workaround")Signed-off-by Alvin Zhang <[email protected]>--- drivers/bus/pci/linux/pci_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/bus/pci/linux/pci_vfio.c +0
-0
drivers/bus/pci/linux/pci_vfio.c line 571
Quoted 8 lines
drivers/bus/pci/linux/pci_vfio.c +1
-1@@ -565,7 +565,7 @@ }/* if there's a second part, try to map it */ -if (map_addr !=NULL +if ((map_addr !=NULL || memreg[0 ].size ==0 ) && memreg[1 ].offset && memreg[1 ].size) { void *second_addr = RTE_PTR_ADD(bar_addr, (uintptr_t)(memreg[1].offset -
Dupe of http://patches.dpdk.org/patch/78768/ ?
Signature · 2 lines
Thanks, Anatoly
Quoted 1 line · Anatoly
Dupe of http://patches.dpdk.org/patch/78768/ ?
Yes.
Signature · 1 line
David Marchand
Regards,
Ling Wei
Quoted 7 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of [email protected]
Sent: Monday, September 28, 2020 02:34 PM
To: [email protected]; [email protected]
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] bus/pci: fix mapping of PCI resources