crypto/dpaa_sec: use iova2virt instead of memseg iteration
Reduce dependency on internal details of EAL memory subsystem, and simplify code. Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Tested-by: Santosh Shukla <santosh.shukla@caviumnetworks.com> Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com> Tested-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
This commit is contained in:
parent
00bc40e265
commit
11d2f002e0
@ -120,16 +120,7 @@ dpaa_mem_vtop_ctx(struct dpaa_sec_op_ctx *ctx, void *vaddr)
|
||||
static inline void *
|
||||
dpaa_mem_ptov(rte_iova_t paddr)
|
||||
{
|
||||
const struct rte_memseg *memseg = rte_eal_get_physmem_layout();
|
||||
int i;
|
||||
|
||||
for (i = 0; i < RTE_MAX_MEMSEG && memseg[i].addr_64 != 0; i++) {
|
||||
if (paddr >= memseg[i].iova &&
|
||||
paddr < memseg[i].iova + memseg[i].len)
|
||||
return (void *)(size_t)(memseg[i].addr_64 +
|
||||
(paddr - memseg[i].iova));
|
||||
}
|
||||
return NULL;
|
||||
return rte_mem_iova2virt(paddr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user