[dpdk-dev] [RFC 0/8] mbuf: structure reorganization

Morten Brørup mb at smartsharesystems.com
Tue Feb 21 10:22:57 CET 2017


Hi Olivier,

There has been a lot of debate about the size and location (1st or 2nd cache line) of the mbuf fields.

May I suggest that you add a comment to each field briefly mentioning why it has a specific size (8 or 16 bits) (e.g. by example use case), and optionally also why it deserves to be in the first cache line. (A comment to the mbuf structure can say that fields manipulated by PMDs on ingress generally belong in the 1st cache line.)

It's not necessary for all fields, just the non-obvious ones (the ones discussed here on the mailing list). It will make the information more easily accessible to avoid repeating the same discussions in the future.

E.g. the port field is 16 bits because a hypervisor can serve more than 256 virtual machines. And it is in the 1st cache line because a PMD for a multi-port NIC with a shared ingress queue needs to set it on ingress.

And the refcnt field has the same size as the port field to support L3 multicast and L2 port flooding on all ports.


Med venlig hilsen / kind regards
- Morten Brørup


More information about the dev mailing list