zigzag
zigzag

Reputation: 181

Why DPDK only cannot send and receive 60 bytes packet

I have written a simple DPDK send and receive application. When the packet len <= 60 bytes, send and receive application works, but when packet len > 60 bytes, send application show it has sent out packet. but in recieve application, it does not receive anything.

In send application:

mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL", NUM_MBUFS,
            MBUF_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
pkt = rte_pktmbuf_alloc(mbuf_pool);
pkt->data_len = packlen; //if packlen<=60, it works, but when packlen>60, receiver cannot receive anything. 

I try both l2fwd and basicfwd as receive application. It is same result.

Upvotes: 2

Views: 682

Answers (1)

Andriy Berestovskyy
Andriy Berestovskyy

Reputation: 8534

The issue is here:

pchar[12]=0;
pchar[13] = 0

This means Ethertype is 0. From the list of assigned Ethertypes:

https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml

We see that 0 means zero Ethernet frame length. Since the minimum Ethernet frame length is 64 (60 + 4 FCS), that is why you have troubles sending packets longer that 60 bytes.

To fix the issue, simply put there a reasonable Ethertype from the list above.

Upvotes: 2

Related Questions