DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Access to the PCI config space
@ 2013-08-22  1:13 Patrick Mahan
  2013-08-22  1:55 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Mahan @ 2013-08-22  1:13 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] Access to the PCI config space
  2013-08-22  1:13 [dpdk-dev] Access to the PCI config space Patrick Mahan
@ 2013-08-22  1:55 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2013-08-22  1:55 UTC (permalink / raw)
  To: Patrick Mahan; +Cc: dev

On Wed, 21 Aug 2013 18:13:21 -0700
Patrick Mahan <mahan@mahan.org> wrote:

> 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

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-22  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-22  1:13 [dpdk-dev] Access to the PCI config space Patrick Mahan
2013-08-22  1:55 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).