如何快速判断USP和DSP

        近期,在阅读PCIe spec时,时常出现USP(Upstream port) DSP(Downstream port),有时候把握不准这个到底怎么分辨,就无法理解文档的描述内容。在spec里也没有详细介绍如何分辨USP以及DSP,经过搜寻终于找到一篇相关的文章,由于是英文文档,所以,根据文档内容做了翻译,翻译中加了一部分自己的理解,记录一下,以供后续查阅学习。

I wanted to title this “Upstream, downstream, in my lady’s chamber” in honor of the old nursery rhyme “Goosey, goosey, gander” – but after reading what Wikipedia has to say about the nursery rhyme it didn’t seem quite as childlike as I remembered…  I also thought that putting “in my lady’s chamber” in a blog title was perhaps not going to show up on the kinds of google searches I’d actually hope for!  I guess it’s all a matter of perspective.

工程师上来先撩骚一波,吐槽维基百科搜索的内容连儿歌都不对,也不想本文的内容被各种搜索工具检索到,确实很叛逆。

Actually “perspective” is the key (in my opinion) to understanding PCIe’s upstream/downstream naming.  I admit that when I first encountered PCI Express I was confused – “What’s this upstream component and why does it have a downstream port? I thought I was the endpoint, now I’m the downstream component? Holy heck, and I’ve got an upstream port?!??!

理解upstream/downstream,认知很重要。在我第一次接触PCI Express的时候我就很困惑,什么是upstream component,为啥它会有一个downstream port?如果我是一个endpoint,我就是一个downstream component吗?我就一定会有一个upstream port?

Let’s leave switches out of the discussion for just a moment and consider a “typical” system where we’ve got an endpoint device (let’s say it’s a graphics adapter) connected directly to a root complex (let’s say it’s an x86 workstation computer).  Some of the confusion probably arises because *devices* can be upstream or downstream and their *ports* can also be upstream or downstream.

我们先不讨论switch,值简单看一个典型的(typical)系统,该系统有一个endpoint device(可以是一个显卡),和root complex(我们可以认为是一个x86计算机)相连接。这时候一些迷惑点就出现了,因为device也有upstream和downstream,他们的接口(ports)可以是upstream或者downstream。

The key to decoding this naming is that “stream-ness” is relative to the root complex: up is towards the root, down is away from the root.  For devices this is easy as it’s just their “position” in a logical hierarchy with the root complex at the source of the tree.  So in our example, the workstation houses a root complex which is the upstream device – as you can’t get any closer to the root complex than, well, the root complex itself.  The graphics adapter is the downstream device as it connects to the root.

关键点就和root complex相关:up就是朝向root的方向,down是远离root的方向。对于device来说很容易判断他们在架构中的位置。所以在我们这个例子当中,root complex就是upstream device,因为你无法找到比root complex更加接近root的设备了。显卡就是downstream device,他和root相连。

       For me it’s easiest to picture a little gremlin standing on the root complex (workstation) and looking at the connected device (endpoint/graphics adapter), he is looking away from the root complex (defined as down) therefore the endpoint is downstream from the root complex (a downstream device).  Likewise if our gremlin stands on the endpoint and looks at the connected device he is looking towards the root complex (defined as up) and thus the root complex is upstream (an upstream device).

       对我而言最简单的技巧就是找到root complex和device的连接关系,device看起来是远离root complex的,所以device就是一个downstream device。或者我们站在device的视角看,它的连接是朝向root complex的,因此root complex就是一个upstream device。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值