-
Notifications
You must be signed in to change notification settings - Fork 938
Description
Hi there,
I think the if-condition in the function ff_rte_frm_extcl
needs to be changed from this
if ( bsd_mbuf->m_ext.ext_type==EXT_DISPOSABLE && bsd_mbuf->m_ext.ext_free==ff_mbuf_ext_free )
to this
if ( (bsd_mbuf->m_flags & M_EXT) && bsd_mbuf->m_ext.ext_type==EXT_DISPOSABLE && bsd_mbuf->m_ext.ext_free==ff_mbuf_ext_free )
.
I just hit the following case:
- There was external storage attached to a BSD mbuf (input packet).
- Then this mbuf was freed and returned back to the BSD mbuf pools.
- The BSD stack needed mbuf for an output packet, allocated one and got the mbuf from point 2.
- Now if I give this packet to the
ff_rte_frm_extcl
it'll return wrong non NULL result because the BSD stack just leave the external storage as it is unless functions likem_extadd
orm_extaddref
are used.
Also in the freebsd/sys/mbuf.h
you can see the comment above struct m_ext
Description of external storage mapped into mbuf; valid only if M_EXT is set
and all BSD functions which read from the m_ext
are guarded with checks or assertions if this flag is set.
I just use the F-stack not as a server but as a mixed L3-L4 proxy and noticed that this function returns wrong results for the output packets. I use it because it allows me to skip allocation of rte_pktmbuf
for an output packet if this packet is being L3 forwarded because it already has rte_pktmbuf
attached on input.
Regards,
Pavel.