【发布时间】:2018-09-20 20:05:50
【问题描述】:
您好 Stackoverflow 专家,
我在 Mellanox NIC 上使用 DPDK,但在应用数据包时遇到了困难 DPDK 应用程序中的碎片。
sungho@c3n24:~$ lspci | grep Mellanox
81:00.0 Ethernet controller: Mellanox Technologies MT27500 Family
[ConnectX-3]
dpdk 应用程序(l3fwd,ip-fragmentation,ip-assemble)没有 将接收到的数据包识别为 ipv4 标头。
起初,我在发送 ipv4 标头时制作了自己的数据包,所以我 假设我以错误的方式制作数据包。
所以我使用了 DPDK-pktgen 但 dpdk-application (l3fwd, ip-fragmentation, ip-assemble) 无法识别 ipv4 标头。 作为最后的手段,我测试了 dpdk-testpmd,并在 状态信息。
********************* Infos for port 1 *********************
MAC address: E4:1D:2D:D9:CB:81
Driver name: net_mlx4
Connect to socket: 1
memory allocation on the socket: 1
Link status: up
Link speed: 10000 Mbps
Link duplex: full-duplex
MTU: 1500
Promiscuous mode: enabled
Allmulticast mode: disabled
Maximum number of MAC addresses: 127
Maximum number of MAC addresses of hash filtering: 0
VLAN offload:
strip on
filter on
qinq(extend) off
No flow type is supported.
Max possible RX queues: 65408
Max possible number of RXDs per queue: 65535
Min possible number of RXDs per queue: 0
RXDs number alignment: 1
Max possible TX queues: 65408
Max possible number of TXDs per queue: 65535
Min possible number of TXDs per queue: 0
TXDs number alignment: 1
testpmd> show port
根据 DPDK 文档。 在端口 1 的信息状态的流类型中应该显示,但我的显示 不支持流类型。 下面的例子应该是需要在流类型中显示的:
Supported flow types:
ipv4-frag
ipv4-tcp
ipv4-udp
ipv4-sctp
ipv4-other
ipv6-frag
ipv6-tcp
ipv6-udp
ipv6-sctp
ipv6-other
l2_payload
port
vxlan
geneve
nvgre
那么是我的网卡,Mellanox Connect X-3 不支持 DPDK IP 分片吗?或者是 在尝试数据包分片之前需要进行其他配置吗?
-- [编辑] 所以我检查了来自 DPDK-PKTGEN 的数据包和 DPDK 应用程序接收到的数据包。 我收到的数据包正是我从应用程序发送的数据包。 (我得到正确的数据)
问题从代码开始
struct rte_mbuf *pkt
RTE_ETH_IS_IPV4_HDR(pkt->packet_type)
这决定了数据包是否是 ipv4。 并且 pkt->packet_type 的值在 DPDK-PKTGEN 和 DPDK 应用程序中都为零。如果 pkt-packet_type 为零,则 DPDK 应用程序将此数据包视为 NOT IPV4 标头。
这个基本类型检查器从一开始就是错误的。 所以我认为要么是 DPDK 样本是错误的,要么是 NIC 由于某种原因不能支持 ipv4。
我收到的数据在开始时有一些模式,我收到了正确的消息,但在那之后的数据包序列在 MAC 地址和数据偏移量之间有不同的数据
所以我假设他们对数据的解释不同,并得到了错误的结果。
【问题讨论】:
标签: dpdk