Skip to contentSkip to conversation

bus/pci: pcidev access from secondary process

PATCH In review Vijaya Mohan Guvva 3 participants 5 messages Mar 6, 2020 – Mar 31, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus/pci: pcidev access from secondary process

For pci devices presented through igb_uio, pcidev->mem_resource[] is not populated when the device is initialized for secondary process.

Initialize pcidev->mem_resource[] with pci-bar mapped addresses.

---
 drivers/bus/pci/pci_common_uio.c | 1 +
 1 file changed, 1 insertion(+)
drivers/bus/pci/pci_common_uio.c +1 -0
index 7ea73db..f4dca9d 100644
@@ -70,6 +70,7 @@
 				}
 				return -1;
 			}
+			dev->mem_resource[i].addr = mapaddr;
 		}
 		return 0;
 	}
Signature · 1 line
1.8.3.1
#2 lore raw

06/03/2020 13:28, Ferruh Yigit:

Quoted 9 lines · Vijaya Mohan Guvva
Quoted 6 lines

For pci devices presented through igb_uio, pcidev->mem_resource[] is not populated when the device is initialized for secondary process.

Initialize pcidev->mem_resource[] with pci-bar mapped addresses.

Do you mean secondary process never worked with igb_uio? Or is there a specific case?
What is the root cause?
Should it be backported to stable?

#3 lore raw

Hi Thomas,
As long as pmd or application doesn't access dev->mem_resource[i].addr, secondary process works with igb_uio. But for pci devices like crypto_qat, pmd checks for dev->mem_resource[i].addr and bails out if the address is null.

Root cause is, not initializing the mapped address in rte_pcidev when device is exposed through igb_uio.

Thanks,
Vijay

Quoted 18 lines · Thomas Monjalon

06/03/2020 13:28, Ferruh Yigit:

Quoted 9 lines · Vijaya Mohan Guvva
Quoted 6 lines

For pci devices presented through igb_uio, pcidev->mem_resource[] is not populated when the device is initialized for secondary process.

Initialize pcidev->mem_resource[] with pci-bar mapped addresses.

Do you mean secondary process never worked with igb_uio? Or is there a specific case?
What is the root cause?
Should it be backported to stable?

#4 lore raw

31/03/2020 04:12, vijay mohan:

Quoted 20 lines · Thomas Monjalon
Quoted 5 lines

06/03/2020 13:28, Ferruh Yigit:

Quoted 4 lines · Vijaya Mohan Guvva
Quoted 3 lines

For pci devices presented through igb_uio, pcidev->mem_resource[] is not populated when the device is initialized for secondary process.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Initialize pcidev->mem_resource[] with pci-bar mapped addresses.

Do you mean secondary process never worked with igb_uio? Or is there a specific case?

As long as pmd or application doesn't access dev->mem_resource[i].addr, secondary process works with igb_uio. But for pci devices like crypto_qat, pmd checks for dev->mem_resource[i].addr and bails out if the address is null.

Quoted 4 lines
Quoted 1 line

What is the root cause?

Root cause is, not initializing the mapped address in rte_pcidev when device is exposed through igb_uio.

So the issue has always been there?
In this case, you should specify the origin commit in "Fixes:" line.

Quoted 1 line
Quoted 1 line

Should it be backported to stable?

I think it needs to be backported. So please add Cc: [email protected] in the commit log.