Skip to contentSkip to conversation

Access to the PCI config space

DISCUSSION Patrick Mahan 2 participants 2 messages Aug 22, 2013 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Has anyone contemplated providing access to the PCI config space (pci_read_config_[byte|word|dword]) for DPDK? It seems simple to perform, some preliminary testing by me seems to indicate opening the /sys/bus/pci/devices/<domain:bus:loc.func>/config file, seeking to the correct offset and reading off the value.

It seems to be correctly returning expected values and sysfs-pci.txt seems to indicate that this is RW so you can set values as well. It would seem a natural to make the PCI support code in DPDK more fully capable of porting PCI drivers.

I realize that somethings should be avoid (ie. causing interrupts), but I know that my device needs to modify bits in both the DEVCTL field of the PCI config and a BAR0 register to ensure they have the same value.

Thoughts?

Thanks,

Patrick

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 16 lines · On Wed, 21 Aug 2013 18:13:21 -0700 Patrick Mahan…

Has anyone contemplated providing access to the PCI config space (pci_read_config_[byte|word|dword]) for DPDK? It seems simple to perform, some preliminary testing by me seems to indicate opening the /sys/bus/pci/devices/<domain:bus:loc.func>/config file, seeking to the correct offset and reading off the value.

It seems to be correctly returning expected values and sysfs-pci.txt seems to indicate that this is RW so you can set values as well. It would seem a natural to make the PCI support code in DPDK more fully capable of porting PCI drivers.

I realize that somethings should be avoid (ie. causing interrupts), but I know that my device needs to modify bits in both the DEVCTL field of the PCI config and a BAR0 register to ensure they have the same value.

Quoted 5 lines

Thoughts?

Thanks,

Patrick

I played with that and it worked, but proved be unnecessary for the hardware we support. If your device needs it, then sure it makes sense to be supported genericly.