* [dpdk-dev] why uses the cldemote here in dpdk21.02?
@ 2021-05-19 6:09 vic_yf
0 siblings, 0 replies; only message in thread
From: vic_yf @ 2021-05-19 6:09 UTC (permalink / raw)
To: dev
Hi,
when I read the dpdk dlb eventdev driver code, I find that it used the cldemote instruction in the dlb_recv_qe(). But I don't understand why it used there?
The cldemote instruction means to move the cache line to the more remote cache, which helps to accelerate core-to-core communication. But who will be use the memory of cache_line_base?
>static __rte_always_inline int dlb_recv_qe(struct dlb_port *qm_port, struct dlb_dequeue_qe *qe, uint8_t *offset)
>{
>
> cq_addr = dlb_port[qm_port->id][PORT_TYPE(qm_port)].cq_base;
> cq_addr = &cq_addr[qm_port->cq_idx];
> cache_line_base = (void *)(((uintptr_t)cq_addr) & ~0x3F);
> *offset = ((uintptr_t)cq_addr & 0x30) >> 4;
> /* Load the next CQ cache line from memory. Pack these reads as tight
> * as possible to reduce the chance that DLB invalidates the line while
> * the CPU is reading it. Read the cache line backwards to ensure that
> * if QE[N] (N > 0) is valid, then QEs[0:N-1] are too.
> *
> * (Valid QEs start at &qe[offset])
> */
> qes[3] = _mm_load_si128((__m128i *)&cache_line_base[6]);
> qes[2] = _mm_load_si128((__m128i *)&cache_line_base[4]);
> qes[1] = _mm_load_si128((__m128i *)&cache_line_base[2]);
> qes[0] = _mm_load_si128((__m128i *)&cache_line_base[0]);
>
> /* Evict the cache line ASAP */
> rte_cldemote(cache_line_base);
Thanks.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-20 8:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 6:09 [dpdk-dev] why uses the cldemote here in dpdk21.02? vic_yf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).