PCI Express support for 2.4 kernel
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Vladimir Kondratiev
As alternative between 1 page and 256M, I see also lazy allocation on per-bus basis: when bus is first accessed, ioremap 1Mb for it. On real system, it is no more then 3-4 buses. This way, we will end with several 1MB mappings. Finer granularity do not looks feasible, since bus scanning procedure tries to access all devices.
For bus scanning fixmaps are fine, but for the normal use of the config space in the driver just doing ioremap once (e.g. at pci_enable_device time) and caching it is preferable. The number of PCI-E devices in a given system should be bounded, so e.g. when you have 100 devices you will only lose 400kB of vmalloc space this way which is quite reasonable.
I don't think dynamic fixmaps at each access would be a good idea.
-Andi
Andi,
My fist intention was exactly same as yours, but if all access were done through pci_dev... Unfortunately, you can't store ioremap()'ed address for 4k within pci_dev and then simply use it. In all places around, config accessed through (bus,dev,fn) indexes.
If you want to keep virt. addr. footprint small, the only alternative to fixmap is some kind of LRU cache for dozen of devices. When choosing between fixmap and LRU cache, I would choose fixmaps. It is very simple and clear, low virt. addr. and comparable overhead.
Vladimir.
Quoted 23 lines · Andi Kleen
Quoted 7 lines · Vladimir Kondratiev
As alternative between 1 page and 256M, I see also lazy allocation on per-bus basis: when bus is first accessed, ioremap 1Mb for it. On real system, it is no more then 3-4 buses. This way, we will end with several 1MB mappings. Finer granularity do not looks feasible, since bus scanning procedure tries to access all devices.
For bus scanning fixmaps are fine, but for the normal use of the config space in the driver just doing ioremap once (e.g. at
pci_enable_devicetime) and caching it is preferable. The number of PCI-E devices in a given system should be bounded, so e.g. when you have 100 devices you will only lose 400kB of vmalloc space this way which is quite reasonable.I don't think dynamic fixmaps at each access would be a good idea.
-Andi
Quoted 5 lines · Vladimir Kondratiev
My fist intention was exactly same as yours, but if all access were done through
pci_dev...
Unfortunately, you can't store ioremap()'ed address for 4k withinpci_devand then simply use it.
In all places around, config accessed through (bus,dev,fn) indexes.
Just use a small binary tree or hash table to look up the pci_dev given (bus,dev,fn). That will be much faster than playing with mappings and flushing TLBs.
-Andi
Quoted 3 lines · Vladimir Kondratiev
My fist intention was exactly same as yours, but if all access were done through
pci_dev...
Look at 2.6's version of pci_[read|write]_config_*() :)
(yeah, it's just a wrapper around pci_bus_*() right now, but that's easier to change if we have to...)
thanks,
greg k-h