IO接口

来源:互联网 发布:服装店零售收银软件 编辑:程序博客网 时间:2024/05/10 09:54
1、
i_port和eport的对应关系存放在设备文件系统的 etc/mdu/mdu_port_config 目录下。
这个目录上是前端的接口映射关系,注意:有ipdport字段

2、
xe = 10ge,每一片卡上有8个ge(千兆口),2个xe(万兆口)

3、
实例:
0       0       3136    1       ge      16GE4XG 0
0       1       3136    1       ge      16GE4XG 1
0       2       3136    1       ge      16GE4XG 2
0       3       3136    1       ge      16GE4XG 3
0       4       3136    1       ge      16GE4XG 4
0       5       3136    1       ge      16GE4XG 5
0       6       3136    1       ge      16GE4XG 6
0       7       3136    1       ge      16GE4XG 7
0       8       3136    1       xe      16GE4XG 8
0       9       3136    1       xe      16GE4XG 9
0       10      2880    1       ge      16GE4XG 10
0       11      2880    1       ge      16GE4XG 11
0       12      2880    1       ge      16GE4XG 12
0       13      2880    1       ge      16GE4XG 13
0       14      2880    1       ge      16GE4XG 14
0       15      2880    1       ge      16GE4XG 15
0       16      2880    1       ge      16GE4XG 16
0       17      2880    1       ge      16GE4XG 17
0       18      2880    1       xe      16GE4XG 18
0       19      2880    1       xe      16GE4XG 19
2       0       2624    1       ge      16GE4XG 20
2       1       2624    1       ge      16GE4XG 21
2       2       2624    1       ge      16GE4XG 22
2       3       2624    1       ge      16GE4XG 23
2       4       2624    1       ge      16GE4XG 24
2       5       2624    1       ge      16GE4XG 25
2       6       2624    1       ge      16GE4XG 26
2       7       2624    1       ge      16GE4XG 27
2       8       2624    1       xe      16GE4XG 28
2       9       2624    1       xe      16GE4XG 29
2       10      2112    1       ge      16GE4XG 30
2       11      2112    1       ge      16GE4XG 31
2       12      2112    1       ge      16GE4XG 32
2       13      2112    1       ge      16GE4XG 33
2       14      2112    1       ge      16GE4XG 34
2       15      2112    1       ge      16GE4XG 35
2       16      2112    1       ge      16GE4XG 36
2       17      2112    1       ge      16GE4XG 37
2       18      2112    1       xe      16GE4XG 38
2       19      2112    1       xe      16GE4XG 39


测试:
插满中卡的情况下,测试结果如下:

物理接口      queue           pko     p_iport        eport
0/0-0/9        9,10,11        3    3136        0-9
0-10-0/19    6,7,8        2    2880        10-19
2/0-2/9        3,4,5        1    2624        20-29
2/10-2/19    0,1,2        0    2112        30-39


总结:
每一个iport管理10个出接口,设备插满状态下,一共有4个p_iport,每一个p_iport对应一个pko,所以一共4个pko,每一个pko/p_iport对应3个queue,一共用了12个queue,同时每一个pko/p_iport对应10个出接口。

问题:
为什么我们用计数对单位p_iport含有的queue个数取余?因为发送的时候是按照从0到3的顺序来轮寻检测queue的,所以要把数据包也按照这个顺序轮寻发送到queue上。前提:一次往queue上只放一个包,并且轮寻检测发送一次只发送一个包。

1、QLM配置对应关系:
cat /proc/driver/octeon_ipd_port_info 这个是查看后端QLM的对应关系

2、
interface       port    ipd_port        port_type       index
0                   0         2048            ge                  0
0                   1         2064            ge                  1
0                   2         2080            ge                  2
0                   3         2096            ge                  3
3                   0         2880            xe                  4
4                   0         3136            xe                  5
这个对应关系是中卡(16GE4XG)或者小卡(4GCOMB)在后端连接CPU时的关系映射。interface是指的QLM编号,也可以认为是CPU的10G接口编号,注意,这里也有ipd_port字段,这个ipd_port是后端和前端联系的标志,CPU通过这个ipd_port就可以知道报文是从哪组接口收上来的,转发的原理就是改变了一下ipd_port然后就可以根据ipd_port发送到对应的QLM上。
对于16GE4XG来说,因为只有ipd_port不能精确的标识出每一个接口,只能标识出QLM,所以蔺工那里需要为每一个接口做一个vlan作为标识,这样通过我们自己的vlan就可以实现具体接口到具体接口的转发功能,转发时修改vlan即可。
对于4GCOMB来说,因为每一个接口都对应一个ipd_port,所以不许要vlan,直接根据ipd_port就能知道具体是哪一个接口,所以转发的时候只要修改 ipd_port即可


接口图:
CN68XX手册P869:

图片
名词解释:
QLM:四通路模块(quad-lane modules),设备上每10个接口(8个ge,2个xe口)对应一个QLM,设备上的板卡从低到高分别对应QLM4、QLM3、QLM2、QLM1,其中每一个QLM都对应一个XAUI口(万兆以太网连接单元接口),
SGMII:以太网MAC与PHY之间的媒体接口(单工),速率是1.25G
XAUI:以太网MAC层与物理层(PHY)相连的接口,速率10G,是对XGMII的扩展
RXAUI:Reduced XAUI
DXAUI:refers to a ×4 XAUI link operating at 6.25 Gbd
ILK:
Interlaken接口,Interlaken是可扩展协议,支持从10 Gbps到100 Gbps及以上的芯片至芯片数据包传送

1、
PCIe, ILK, XAUI/RXAUI, and SGMII实际上是共享的SerDes接口,SerDes接口是由5个4通路模块(QLM)构成, 每一个QLM最多能支持4个通路,这四个QLM可以有以下几种灵活的配置:
QLM0: SGMII, XAUI, or RXAUI
QLM1: PCIe or ILK
QLM2: PCIe, ILK, XAUI, DXAUI, or SGMII
QLM3: PCIe, XAUI, or SGMII
QLM4: PCIe, XAUI, DXAUI, or SGMII
这里的配置是插上中卡或者小卡以后,硬件识别卡类型后自动配置给QLM的,我们常用到的情况是每一个QLM都对应xe类型,见上面的打印信息,这种类型就是配置成XAUI,即10G,我们的设备最大支持4个XAUI口,所以速率最高支持40G,再大就会丢包

补充:
ipd_port的算法:
if (interface >= 0 && interface <= 4)
{
    cvmx_helper_interface_mode_t mode = cvmx_helper_interface_get_mode(interface);
    if (mode == CVMX_HELPER_INTERFACE_MODE_XAUI || mode == CVMX_HELPER_INTERFACE_MODE_RXAUI)
       return 0x840 + (interface * 0x100);
    else
        return 0x800 + (interface * 0x100) + (port * 16);
}

2880 = 0x840 + (3 * 0x100)
3136 = 0x840 + (4 * 0x100) 
0 0
原创粉丝点击