From: Anatoly Burakov Date: Wed, 11 Apr 2018 12:30:14 +0000 (+0100) Subject: crypto/dpaa_sec: use iova2virt instead of memseg iteration X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=11d2f002e0e6bb33b3ce73d355c40360936ab415;p=dpdk.git 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 Tested-by: Santosh Shukla Tested-by: Hemant Agrawal Tested-by: Gowrishankar Muthukrishnan --- diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index c5191cef9c..b04510f417 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -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