Hi,

when creating an UDP packet, I need to use two mbufs - one containing the UDP header (hdr) and another holding the payload (pay):

struct rte_mbuf* hdr = rte_pktmbuf_alloc(hdrmp);
struct rte_mbuf* pay = rte_pktmbuf_alloc(paymp);

// filling ether, IP, UDP header
...
ip_hdr->version_ihl = 0x40 | 0x05; // (*) without 0x05 order it ok
...

// setting sizes and linkage
hdr->data_len   = sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr) + sizeof(struct udp_hdr);
pay->data_len   = payloadSize;

hdr->pkt_len    = hdr->data_len + pay->data_len;
pay->pkt_len    = hdr->pkt_len;

hdr->next       = pay;
hdr->nb_segs    = 2;

When sending plenty of such UDP packets using rte_eth_tx_burst(), all of them were sent correctly, but the sending order seems to be random. When using just a single mbuf for an UDP packet, the sending order is always the order of the packets in the tx array - which is what I expect. Using the header-payload-separation approach and omitting the IP header size info in the ip_hdr field - resulting in a wrong IP packet - the sending order gets ok. I'm using the mlx5 PMD. Could it be some offload mechanisms, influencing the sending order? Maybe someone can help.

Thanks and best regards
Sofia Baran

Reply via email to