Re: Q: Relation between lanes to devices and to BARs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 11, 2016 at 05:22:15PM +0200, Ran Shalit wrote:
> If I may please ask one more on this issue.
> You have made it clear the terms lanes & device in relation to
> PCI/PCI-e device driver.
> What about port ? Is there any relation between port to lane/device or
> is there no relation between these terms.

In Linux, PCIe Ports (Root Ports, Switch Upstream Ports, or Switch
Downstream Ports) are treated as devices.  There is a struct pci_dev
for each Port.  A Switch contains at least two Ports (an Upstream Port
and one or more Downstream Ports), and there is a pci_dev for each of
them.

There is no connection between the number of lanes and the number of
pci_dev structs.  The Linux PCI core doesn't do anything with the
number of lanes.  My understanding is that the devices on either end
of a Link normally negotiate the link width (number of lanes) between
themselves automatically, without software intervention.

> For example, can it be 1 device with 2 lanes and 8 ports for example ?

"1 device with 8 ports" is a phrase that would make sense in the PCIe
spec, where you could be talking about a Switch with one Upstream Port
and seven Downstream Ports.

But in the Linux kernel, since we treat each PCI/PCIe *function* as an
independent device, this looks like 8 devices.  There will be 8
pci_dev structs, one for each port.

The "2 lanes" part is irrelevant.  The number of lanes makes no
difference as far as how many pci_dev structs we have.

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux