[dpdk-users] Changing rte_mbuf

David Marchand david.marchand at redhat.com
Wed Jun 16 08:31:02 CEST 2021


On Wed, Jun 16, 2021 at 8:09 AM mohamad ali <ali64mohammad64 at gmail.com> wrote:
> Hi i want to change rte_mbuf struct and add some custom struct to it but
> when i change it and compile again some error related to this line shows up.
> RTE_BUILD_BUG_ON(sizeof(struct rte_mbuf) > OCTEONTX_FPAVF_BUF_OFFSET);
>
> What is the correct way to add struct to rte_mbuf ?

The correct way is not to add anything to rte_mbuf :-).

If your application needs some private space per mbuf, you should
instead embed the rte_mbuf struct into a structure of yours.
Create a mempool with a private size accounting for this and make sure
to init this private space per object.


-- 
David Marchand



More information about the users mailing list