pci 介绍

给大家一个大概的介绍,

pci express topology
如何让info, 定义电脑大概的架构是什么样子的。

root complex 
an rc denotes the root of an I/O hierarchy that connects the CPU/Memory subsystem to the I/O.
就是pcie 最开始的位置。当作是一个pcie cpu 一个连接的地方。 视为是一个连接点,他
和root port 不一样,它下面可以有很多root port. 

Root port: pci-pci bridge bwtween the cpu and pci components external to the cpu.

root port: 一个link 开始的位置,他扮演的角色,一个接线生的角色,转达的一个功能。模仿一个人的沟通。

Endpoint: A type of Function that can be the requester or completer of a PCI express transaction
either on its own behalf or on behalf of a distinct non PCI Express device.
    Root complex Integrated Endpoint.

它一个 gpu, ssd, 一种功能,transacton 的requester. 功能可以满足cpu 或者user 的某个需求,它本身也
可以发出需求, bdf 里面的function. Root complex Integrated Endpoint. 以前就存在的, cxl , 会用到。

它是一个逻辑上的function. 基本上,没有对应的root port. 
所以,它也没有link. 
既然它没有root port. 它必须直接出现在root complex. 这会影响到resource 的安排。 他需要新的方式
去分配resource. 

Switch: A logical assemably of multiple virtual PCI to pci bridge devices

switch 的功能是让root port 接到更多的endpoint. 通常的接法一对多的, 同一个bus, 不同的device , function.
切出不同的功能。有的用device 切,有的用function 切。

switch 内部由多个pci to Pci 桥组成,其中每一个上游和下游端口都对应一个虚拟pci 桥。
在一个switch 中有多少个端口,在其内部就有多少个虚拟pci 桥,就有多少个桥配置空间。在switch 内部还具有
一个虚拟的pci 总线,用于连接 虚拟pci 桥。系统软件在初始化switch时,需要为这条虚拟pci 总线编号。

Upstream: Toward the root complex
往 root port , root complex 的位置。
Downstream: Away from the root complex.
远离root complex 方向。


upstream port ,往 root complex 方向。
pci express topology

memory 之间搬资源到cpu. 这个transaction error 发生在哪里。

他也分层,他跟网络很像,但更简化一点。层数少一点,cost 低一点。
最上层,越偏向人类能够读懂的逻辑,

Transaction Layer:
 the transaction layber primary responsibility is the assembly and disassembly of TLPs, 
tlps are used to communicate transactions, such as read and write. For example: Memory read/write.
configuration read/write, The packets would be called as TLP(Transaction Layer Packet).

Data Link Layer

The primary responsibilities of The Data Link Layer include Link management and data integrity, including error

detection and error correction. The packets wuld be called as DLLP(Data Link Layer Packet)

传送过来,会有一个buffer, 就像讲话一样,讲快了,别人理解不了, 像rap 的时候,就只能知道大概讲了什么。 

Transaction Types for Different Address Spaces

Memory :
Transfer data to/from a memory-mapped location

I/O :
Transfer data to/from I/O mapped location

Configuration:

Device Function configuration/setup


configuraiton topology

Data Link Layer:
The primary responsibilites of the Data Link Layer include Link management and data
integrity, including error detection and error correction. The packets would be called as 
DLLP(Data Link Layer Packet).

Physical Layer
This Layber is responsible for converting information received from the Data Link
Layer into an appropriate serialized format and transmitting it across the PCI Express at 
a frequency and width compatible with the device connected to the other side of the Link

分成好几个lane 一起发出去,这样效率最高,宽度,在这一层决定。10 10的保障,就在这一层。

如果是最外层有问题,不会是运送的问题。包裹是好的,那这种时候,我们猜测,寄出来,就是有问题。这
个可能帮助我们理解,为什么要分层。如果最外层有问题,里面有问题,也很好理解。放到pcie ,可能electrical 
就有error. 

一个测试, 叫做ltssm. 如何建立一个machine state 的变化,万一ltssm 出问题的时候,我们知道,大概在哪一层。

大概的一个diagram. 绝大多数都是physical layer . 

Detect: 指的是对方有没有device 存在。 当阻抗无限大的时候,device 不存在。 

送一个pakage 过去。 送过去之后,receive 判断,看有没有收到。
从physical 硬性发现宽度的限制。所以从detect -polling - configuration 速度都在gen1. 
速度的增加是在recovery. 再回到L0. 

发一个reset 之后,又会再回来。


Equalization bypass to highest rate.
在gen5出来之前,是gen1-> gen3->Gen4


configuration: 决定link 的宽度。


configuration topology
all pci expres elements have a pci-compatible configuration space

Pci express configuration space is divided into a Pci-compatible region, which consists of the 256 bytes of a 
Functions's configuraiton space, and a pci express extended configuration space which consists of the remaining configuration space. 
你可把bdf 转成memory 的形式。从cpu 来看,所有的space 就是memory, 

额外引进一个segment , 
segment number: 16 bits(0-65535)
定义在acpi 时面。一个segment 就会重新拥有一组bdf. 
bus number: 8 bits (0-255)
device number: 5 bits(0-31)


因为如果全部接在一起的话,可能没有扩充的空间。 

Configuration topology:
the software can access those registers to control the link and read the link state

type 0 是给endpoint 用。
type 0 header is for endpoint

header type: type 0 or 1
在device 主要是挖 base address registers,  有两个是一定需要的。

capabilities pointer: all pci express functions are required to implement both the pci power
management capability and the pci express capability structure. 


type 1 header 多蛮多东西出来。

type 1 configuration space header is for pci-pci bridge structures such as switch and root ports
primary bus number
secondary bus number
subordinate bus number
base address
i/o limit and base 
memory limit/base
prefetchable memory limit/base
prefetchable memory limit/base upper 32 bits
i/o base limit/upper 16 bits

用root port
primary bus : root port 的位置
secondary bus number: 跟root port 对接的位置
subordinate bus number: 往下长,最后的位置。

分割bus 的时候,没法就是把每一个bus number 分在一起。

只要跨一个link, bus 就要重新assign. 一个switch 就要用到这么多。 
io 真的可以关掉。
advanced error reporting


uncorrectable error
completion timeout status:  必然是发送端的错,timer 太严格。抓trace, 收到跟回来的时间是多久。

debug triage pre-work

The failure symptom shuld be described well
   system configuration
   device information
    failure rate
    how to reproduce
    when the failure happens - booting , under os, any postcode
    how many errors wuld be reported from RAS

Based on the failure symptom, if it is related to PCIe

    which layers would be involed
    which part would impact more
    why this factor would be unique


可能只是某个值设定跟我们不相容。

是什么卡,做什么用的,gpgpu ,在loading 低的时候,可能会降低带宽。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值