Mellanox ConnectX-3 不支持 DPDK 数据包分段吗?
No DPDK packet fragmentation supported in Mellanox ConnectX-3?
您好 Whosebug 专家,
我在 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 header.
起初,我在发送 ipv4 headers 时制作了自己的数据包,所以我
假设我以错误的方式制作数据包。
所以我使用了 DPDK-pktgen 但是 dpdk-application (l3fwd, ip-fragmentation,
ip-assemble) 无法识别 ipv4 header。
作为最后的手段,我测试了 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 header。
这个基本类型检查器从一开始就是错误的。
所以我认为要么是 DPDK 示例错误,要么是 NIC 出于某种原因无法支持 ipv4。
我收到的数据在开始时有一些模式,我收到了正确的消息,但之后的数据包序列在 MAC 地址和数据偏移量
之间有不同的数据
所以我假设他们对数据的解释不同,并得到了错误的结果。
我很确定任何 NIC,包括 Mellanox ConnectX-3 都必须支持 ip 片段。
您所指的流类型适用于 Flow Director,即将特定流映射到特定 RX 队列。即使你的网卡不支持flow director,IP分片也无所谓。
我猜设置或应用程序中有错误。您写道:
the dpdk application did not recognized the received packet as the ipv4 header.
我会更仔细地研究这个问题。尝试使用 dpdk-pdump
转储这些数据包,甚至通过使用 rte_pktmbuf_dump()
简单地在控制台上转储接收数据包
如果您仍然怀疑网卡,最好的选择是暂时用其他品牌或虚拟设备替换它。只是为了确认它确实是网卡。
编辑:
查看 mlx4_ptype_table
分段的 IPv4 数据包,它应该 return packet_type
设置为 RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_L4_FRAG
请注意该功能是在 DPDK 17.11 中添加的。
我建议您将 pkt->packet_type
转储到控制台以确保它确实为零。还要确保安装了最新的 libmlx4
。
您好 Whosebug 专家,
我在 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 header.
起初,我在发送 ipv4 headers 时制作了自己的数据包,所以我 假设我以错误的方式制作数据包。
所以我使用了 DPDK-pktgen 但是 dpdk-application (l3fwd, ip-fragmentation, ip-assemble) 无法识别 ipv4 header。 作为最后的手段,我测试了 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 header。
这个基本类型检查器从一开始就是错误的。 所以我认为要么是 DPDK 示例错误,要么是 NIC 出于某种原因无法支持 ipv4。
我收到的数据在开始时有一些模式,我收到了正确的消息,但之后的数据包序列在 MAC 地址和数据偏移量
之间有不同的数据所以我假设他们对数据的解释不同,并得到了错误的结果。
我很确定任何 NIC,包括 Mellanox ConnectX-3 都必须支持 ip 片段。
您所指的流类型适用于 Flow Director,即将特定流映射到特定 RX 队列。即使你的网卡不支持flow director,IP分片也无所谓。
我猜设置或应用程序中有错误。您写道:
the dpdk application did not recognized the received packet as the ipv4 header.
我会更仔细地研究这个问题。尝试使用 dpdk-pdump
转储这些数据包,甚至通过使用 rte_pktmbuf_dump()
如果您仍然怀疑网卡,最好的选择是暂时用其他品牌或虚拟设备替换它。只是为了确认它确实是网卡。
编辑:
查看 mlx4_ptype_table
分段的 IPv4 数据包,它应该 return packet_type
设置为 RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_L4_FRAG
请注意该功能是在 DPDK 17.11 中添加的。
我建议您将 pkt->packet_type
转储到控制台以确保它确实为零。还要确保安装了最新的 libmlx4
。