mbuf init questions

Morten Brørup mb at smartsharesystems.com
Tue Dec 5 10:07:56 CET 2023


Why is m->nb_segs initialized in rte_pktmbuf_prefree_seg()?

It's part of the m->rearm_data, and will be initialized on RX descriptor rearm anyway.


Slightly related:

When built without RTE_IOVA_IN_MBUF, m->next lives in the first cache line.

Theoretically, it would improve performance to initialize m->next together with the RX descriptor rearm, when writing to the first cache line anyway, instead of in rte_pktmbuf_prefree_seg(), which requires another write to the first cache line. (In the case where m->next is non-NULL and m->refcnt is 1.)



Med venlig hilsen / Kind regards,
-Morten Brørup




More information about the dev mailing list