[dpdk-stable] [PATCH 1/2] mempool: use actual IOVA addresses when populating

Burakov, Anatoly anatoly.burakov at intel.com
Fri Nov 15 11:12:55 CET 2019


On 15-Nov-19 8:46 AM, Olivier Matz wrote:
> On Thu, Nov 14, 2019 at 01:58:20PM +0000, Anatoly Burakov wrote:
>> Currently, when mempool is being populated, we get IOVA address
>> of every segment using rte_mem_virt2iova(). This works for internal
>> memory, but does not really work for external memory, and does not
>> work on platforms which return RTE_BAD_IOVA as a result of this
>> call (such as FreeBSD). Moreover, even when it works, the function
>> in question will do unnecessary pagewalks in IOVA as PA mode, as
>> it falls back to rte_mem_virt2phy() instead of just doing a lookup in
>> internal memseg table.
>>
>> To fix it, replace the call to first attempt to look through the
>> internal memseg table (this takes care of internal and external memory),
>> and fall back to rte_mem_virt2iova() when unable to perform VA->IOVA
>> translation via memseg table.
>>
>> Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
> 
> Shouldn't we also add
> Fixes: 035ee5bea5ef ("mempool: remove optimistic IOVA-contiguous allocation")
> ?
> 
>>From what I understand, even if the problem existed in populate_virt()
> before, this is the commit that makes the problem visible in most cases.

The commit didn't introduce the issue - only revealed it. So the commit 
itself isn't buggy, and there's nothing to fix :) However, i'm not 
opposed to sharing the blame!

> 
>> Cc: stable at dpdk.org
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> 
> Acked-by: Olivier Matz <olivier.matz at 6wind.com>
> 


-- 
Thanks,
Anatoly


More information about the stable mailing list