[dpdk-dev] mbuf: how to set data to NULL?

Bruce Richardson bruce.richardson at intel.com
Wed Dec 17 17:49:35 CET 2014


On Wed, Dec 17, 2014 at 04:44:15PM +0000, Kavanagh, Mark B wrote:
> Hi,
> 
> DPDK 1.8.0 removes the data pointer from the mbuf structure, such that the start of the data in the segment buffer must be calculated (i.e. buf_addr + data_off = 'data').
> 
> Given this, what is the best approach to set the mbuf data to NULL (previously mbuf.data = NULL)?
> 
> As I see it, given an initialized mbuf, such that buf_addr is non-null, and data_off =RTE_PKTMBUF_HEADROOM, is it fair to say that the best solution is to memset to 0 from location (buf_addr + data_off) for a length of (data_len - data_off)?
> 
> Thanks in advance,
> Mark

Why not just set data_len = 0 to indicate an empty mbuf?


More information about the dev mailing list