1

Hello Stackoverflow Experts,

I am using DPDK on Mellanox NIC, but am struggling with applying the packet fragmentation in DPDK application.

sungho@c3n24:~$ lspci | grep Mellanox
81:00.0 Ethernet controller: Mellanox Technologies MT27500 Family
[ConnectX-3]

the dpdk application(l3fwd, ip-fragmentation, ip-assemble) did not recognized the received packet as the ipv4 header.

At first, I have crafted my own packets when sending ipv4 headers so I assumed that I was crafting the packets in a wrong way.

So I have used DPDK-pktgen but dpdk-application (l3fwd, ip-fragmentation, ip-assemble) did not recognized the ipv4 header. As the last resort, I have tested the dpdk-testpmd, and found out this in the status info.

********************* 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

According to DPDK documentation. in the flow type of the info status of port 1 should show, but mine shows that no flow type is supported. The below example should be the one that needs to be displayed in flow types:

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

So Is my NIC, Mellanox Connect X-3 does not support DPDK IP fragmentation? Or is there additional configuration that needs to be done before trying out the packet fragmentation?

-- [EDIT] So I have checked the packets from DPDK-PKTGEN and the packets received by DPDK application. The packets that I receive is the exact one that I have sent from the application. (I get the correct data)

The problem begins at the code

struct rte_mbuf *pkt
RTE_ETH_IS_IPV4_HDR(pkt->packet_type) 

This determines the whether the packet is ipv4 or not. and the value of pkt->packet_type is both zero from DPDK-PKTGEN and DPDK application. and if the pkt-packet_type is zero then the DPDK application reviews this packet as NOT IPV4 header.

This basic type checker is wrong from the start. So what I believe is that either the DPDK sample is wrong or the NIC cannot support ipv4 for some reason.

The data I received have some pattern at the beginning I receive the correct message but after that sequence of packets have different data between the MAC address and the data offset

enter image description here

So what I assume is they are interpreting the data differently, and getting the wrong result.

1 Answer 1

1

I am pretty sure any NIC, including Mellanox ConnectX-3 MUST support ip fragments.

The flow type you are referring is for the Flow Director, i.e. mapping specific flows to specific RX queues. Even if your NIC does not support flow director, it does not matter for the IP fragmentation.

I guess there is an error in the setup or in the app. You wrote:

the dpdk application did not recognized the received packet as the ipv4 header.

I would look into this more closely. Try to dump those packets with dpdk-pdump or even by simply dumping the receiving packet on the console with rte_pktmbuf_dump()

If you still suspect the NIC, the best option would be to temporary substitute it with another brand or a virtual device. Just to confirm it is the NIC indeed.

EDIT:

Have a look at mlx4_ptype_table for fragmented IPv4 packets it should return packet_type set to RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT_UNKNOWN | RTE_PTYPE_L4_FRAG

Please note the functionality was added in DPDK 17.11.

I suggest you to dump pkt->packet_type on console to make sure it is zero indeed. Also make sure you have the latest libmlx4 installed.

6
  • Thanks for the reply, but the problem is I tried the rte_pktmbuf_dump() but I don't know what is the correct packet, because I don't have any examples that work. I have tried to test using testpmd, but there is no option for ipv4 packet sending at all (only mac address) so I cannot know how the ipv4 headers should be properly crafted. Sep 20, 2018 at 22:59
  • Yeah, I think testpmd cannot generated ipv4 packets, only the DPDK-pktgen can. So as you said the only choice for me is to look at the packets, but the biggest problem is I don't know what is the correct format. I will check again in the pktgen and figure out the complete version of ipv4 packet and then try to make something similar to that one. Sep 20, 2018 at 23:39
  • So how do you know “the dpdk application did not recognized the received packet as the ipv4 header“? Maybe it is invalid MAC and you just need to fix it or to put the NIC into the promiscuous mode? Sep 21, 2018 at 0:24
  • No definitely I have the correct MAC address. For that part I am so sure, and I can send and receive the message, I am comparing the packets that are sent from the PKTGEN and the DPDK application. and as you have predicted something is different between the l2 header and the data-offset. (which i presume it is the l3 header) Sep 21, 2018 at 0:57
  • @SunghoHong it is still not clear if you think pkt->packet_type is zero or you have it checked? The packets on the dump are IPv4 packets for sure. So it looks like the packet type info is getting lost somewhere. Please see my updated answer. Sep 21, 2018 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.