Hi, > + rte_memcpy(bm_bufs, mcr->acquire.bufs, > + sizeof(struct bm_buffer) * rst); "mcr->acquire.bufs" is located in register space, it is supposed to improve performance to copy it to DDR(bm_bufs) to parse and read.
BR Jun -----Original Message----- From: Stephen Hemminger <[email protected]> Sent: Wednesday, May 28, 2025 10:31 PM To: Vanshika Shukla <[email protected]> Cc: [email protected]; Hemant Agrawal <[email protected]>; Sachin Saxena <[email protected]>; Jun Yang <[email protected]> Subject: [EXT] Re: [v1 04/10] bus/dpaa: optimize bman acquire/release Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button On Wed, 28 May 2025 16:09:28 +0530 [email protected] wrote: > +RTE_EXPORT_INTERNAL_SYMBOL(bman_acquire_fast) > +int > +bman_acquire_fast(struct bman_pool *pool, uint64_t *bufs, uint8_t > +num) { > + struct bman_portal *p = get_affine_portal(); > + struct bm_mc_command *mcc; > + struct bm_mc_result *mcr; > + uint8_t i, rst; > + struct bm_hw_buf_desc bm_bufs[FSL_BM_BURST_MAX]; > + > +#ifdef RTE_LIBRTE_DPAA_HWDEBUG > + if (!num || (num > FSL_BM_BURST_MAX)) > + return -EINVAL; > + if (pool->params.flags & BMAN_POOL_FLAG_ONLY_RELEASE) > + return -EINVAL; > +#endif > + > + mcc = bm_mc_start(&p->p); > + mcc->acquire.bpid = pool->params.bpid; > + bm_mc_commit(&p->p, BM_MCC_VERB_CMD_ACQUIRE | > + (num & BM_MCC_VERB_ACQUIRE_BUFCOUNT)); > + while (!(mcr = bm_mc_result(&p->p))) > + ; > + rst = mcr->verb & BM_MCR_VERB_ACQUIRE_BUFCOUNT; > + if (unlikely(!rst)) > + return 0; > + > + rte_memcpy(bm_bufs, mcr->acquire.bufs, > + sizeof(struct bm_buffer) * rst); > + > + for (i = 0; i < rst; i++) > + bufs[i] = bman_hw_extract_addr(&bm_bufs[i]); > + Why do you need multiple the local copy? Does hw_extract_addr modify the buffers?

