Dear Team
I would like bring it to your kind notice of below code of vpp-1707-dpdk 
plunging.

static_always_inline void dpdk_prefetch_buffer_by_index (vlib_main_t * vm, u32 
bi)
{
  vlib_buffer_t *b;
  struct rte_mbuf *mb;
  b = vlib_get_buffer (vm, bi);
  mb = rte_mbuf_from_vlib_buffer (b);
  CLIB_PREFETCH (mb, CLIB_CACHE_LINE_BYTES, LOAD);
  CLIB_PREFETCH (b, CLIB_CACHE_LINE_BYTES, LOAD);
}


#define CLIB_PREFETCH(addr,size,type)   \
do {            \
  void * _addr = (addr);      \
            \
  ASSERT ((size) <= 4*CLIB_CACHE_LINE_BYTES); \
  _CLIB_PREFETCH (0, size, type);   \
  _CLIB_PREFETCH (1, size, type);   \
  _CLIB_PREFETCH (2, size, type);   \
  _CLIB_PREFETCH (3, size, type);   \
} while (0)


[cid:a4244621-4b4e-4fe0-b6e7-c6928cd4909a]



Here , Sizeof(rte_mbuf) = 128 and sizeof(vlib_buffer_t) = 128 + HEAD_ROOM(128)= 
256.


In above code part, vlib_buffer is ahead of 128 bytes from start of rte_mbuf 
structure.  As i understood one CLIB_PREFETCH will load 256 bytes from memory. 
,hence total pre-fetch  is 512 bytes. As per the above code first CLIB_PREFETCH 
will load 256, which includes 128 of rte_mbuf + 128 of vlib_buffer as well . 
2nd CLIB_PREFETCH will also load vlib_buffer whcih as ready has been loaded.

I must say duplication in prefetching the memory. Please correct me if I am 
wrong.

Regards
MJ
Senior Project Engineer.
Mob: 9735128504









The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to