Tested-by: Chen, BoX C <box.c.c...@intel.com>

> -----Original Message-----
> From: stable [mailto:stable-boun...@dpdk.org] On Behalf Of Anatoly Burakov
> Sent: Thursday, November 14, 2019 9:58 PM
> To: dev@dpdk.org
> Cc: Olivier Matz <olivier.m...@6wind.com>; Andrew Rybchenko
> <arybche...@solarflare.com>; david.march...@redhat.com; sta...@dpdk.org
> Subject: [dpdk-stable] [PATCH 2/2] mempool: remove check for bad IOVA when
> populating
> 
> Currently, mempool will check if IOVA is bad for a segment, and reject the 
> IOVA
> if hugepages are also enabled. This check is wrong because now that we have
> external memory segments, they are allowed to have their IOVA's to be invalid.
> This check also doesn't make much sense in the first place, because the
> following code can handle bad IOVA's perfectly well (and in fact, this check 
> is
> not triggering a failure when --no-huge option is enabled), so there is not 
> much
> sense to check for this in the first place.
> 
> Fixes: 950e8fb4e194 ("mem: allow registering external memory areas")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com>
> ---
> 
> Notes:
>     An alternative implementation would be to add a socket ID check to see
>     if the memory being allocated from belongs to an external segment.
> 
>  lib/librte_mempool/rte_mempool.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/lib/librte_mempool/rte_mempool.c
> b/lib/librte_mempool/rte_mempool.c
> index 8da2e471c7..78d8eb941e 100644
> --- a/lib/librte_mempool/rte_mempool.c
> +++ b/lib/librte_mempool/rte_mempool.c
> @@ -390,11 +390,6 @@ rte_mempool_populate_virt(struct rte_mempool *mp,
> char *addr,
> 
>               iova = get_iova(addr + off);
> 
> -             if (iova == RTE_BAD_IOVA && rte_eal_has_hugepages()) {
> -                     ret = -EINVAL;
> -                     goto fail;
> -             }
> -
>               /* populate with the largest group of contiguous pages */
>               for (phys_len = RTE_MIN(
>                       (size_t)(RTE_PTR_ALIGN_CEIL(addr + off + 1, pg_sz) -
> --
> 2.17.1

Reply via email to