[dpdk-users] ipv4 fragmentation

Александр Киселев kiselev99 at gmail.com
Fri Aug 12 23:01:50 CEST 2016

2016-08-12 22:42 GMT+03:00 Stephen Hemminger <stephen at networkplumber.org>:

> > >> Fragment function gets a packet, successfuly splits it to the two
> packets,
> > >> then I add an L2 header to the each of resulting fragments
> > >> and send the fragments using rte_eth_tx_burst() to the wire. All
> steps of
> > >> the above process are succesfully completed without any error, but I
> don't
> > >> see the fragments on the wire and PMD stat function also reports that
> no
> > >> packets were transmitted.
> Did you account for the fact that some of these might be indirect mbuf's
> where refcount > 1? If refcount is not 1 then mbuf is shared, and you can
> not safely write your L2 header directly.

No, I was following the ip_reassembly example.

Since rte_ipv4_fragment_packet() function requires as input parameter an
mbuf without L2 header,
it produces fragments without L2 too, so L2 header should be added. That is
exactly what the example application does.

And I've just checked the mbufs that are created by
the rte_ipv4_fragment_packet(). The are direct mbuf. They have non
zero buf_len size.

Also I checked the sources of rte_ipv4_fragment_packet() function. For each
fragment it creates direct mbuf,
then reserves space for the IP header in it and then adds one or more
indirect mbuf to it. Therefore it should be safe to prepend
L2 header to each resulting fragment, shouldn't be?

Kiselev Alexander

More information about the users mailing list