Users Guide

DCBX 操作
lldpad dcbtool 可用于配置具有 DCB 功能的驱动程序,例如支持 rtnetlink DCB 界面的 ixgbe 驱动程序。DCB 功能配置后,下一步是将标识
802.1p 优先的通信及其关联的 DCB 功能分类。要完成这一步,可运行 tc 命令来设置 qdisc 和过滤器,使网络通信在不同的队列上传输。
可在 tc 过滤器中使用 skbedit 动作机制,将通信型式分类至 0-7 的特定 queue_mapping 值。ixgbe 驱动程序会将给定 queue_mapping 值的通
信放置在相应的硬件队列中,并用相应的 802.1p 值标记出站帧。
为选定界面设置多队列 qdisc
# tc qdisc add dev ethX root handle 1: multiq
TC 过滤器中设置 queue_mapping 允许 ixgbe 驱动程序将信息包分类至一个队列。下面是如何使用信息流 ID 将通信过滤至不同队列的实例:
# tc filter add dev ethX protocol ip parent 1: u32 match ip dport 80 \
0xffff action skbedit queue_mapping 0
# tc filter add dev ethX protocol ip parent 1: u32 match ip dport 53 \
0xffff action skbedit queue_mapping 1
# tc filter add dev ethX protocol ip parent 1: u32 match ip dport 5001 \
0xffff action skbedit queue_mapping 2
# tc filter add dev ethX protocol ip parent 1: u32 match ip dport 20 \
0xffff action skbedit queue_mapping 7
下面是设置基于 EtherType 过滤器的实例。在本例中,EtherType 0x8906
# tc filter add dev ethX protocol 802_3 parent 1: handle 0xfc0e basic match \
'cmp(u16 at 12 layer 1 mask 0xffff eq 35078)' action skbedit queue_mapping 3
测试
要进行背靠背测试,使用以下 tc 命令为 5000 - 5007 TCP 端口设置 qdisc 和过滤器。然后再使用一种工具(例如 iperf)在端口 5000-5007
生成 UDP TCP 通信。
ixgbe 驱动程序的每一个队列的统计数字可通过 ethtool 实用程序核查:ethtool -S ethX
# tc qdisc add dev ethX root handle 1: multiq
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip dport 5000 0xffff action skbedit queue_mapping 0
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip sport 5000 0xffff action skbedit queue_mapping 0
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip dport 5001 0xffff action skbedit queue_mapping 1
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip sport 5001 0xffff action skbedit queue_mapping 1
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip dport 5002 0xffff action skbedit queue_mapping 2
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip sport 5002 0xffff action skbedit queue_mapping 2
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip dport 5003 0xffff action skbedit queue_mapping 3
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip sport 5003 0xffff action skbedit queue_mapping 3
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip dport 5004 0xffff action skbedit queue_mapping 4
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip sport 5004 0xffff action skbedit queue_mapping 4
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip dport 5005 0xffff action skbedit queue_mapping 5
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip sport 5005 0xffff action skbedit queue_mapping 5
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip dport 5006 0xffff action skbedit queue_mapping 6
# tc filter add dev ethX protocol ip parent 1: \
u32 match ip sport 5006 0xffff action skbedit queue_mapping 6