kni: fix kernel crash with multi-segments
authorYangchao Zhou <zhouyates@gmail.com>
Tue, 25 Jun 2019 15:04:14 +0000 (23:04 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 15 Jul 2019 20:48:20 +0000 (22:48 +0200)
commit5eb1708ec1db1f2d644f44a42468139df0b0ad6c
tree2999d45473b953bb20fada741536a423aa7e4032
parent89247e1a736c19093fc1fb4372a7fff8bbfe845a
kni: fix kernel crash with multi-segments

va2pa depends on the physical address and virtual address offset of
current mbuf. It may get the wrong physical address of next mbuf which
allocated in another hugepage segment.

In rte_mempool_populate_default(), trying to allocate whole block of
contiguous memory could be failed. Then, it would reserve memory in
several memzones that have different physical address and virtual address
offsets. The rte_mempool_populate_default() is used by
rte_pktmbuf_pool_create().

Fixes: 8451269e6d7b ("kni: remove continuous memory restriction")
Cc: stable@dpdk.org
Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
doc/guides/prog_guide/kernel_nic_interface.rst
kernel/linux/kni/kni_net.c
lib/librte_eal/linux/eal/include/rte_kni_common.h
lib/librte_kni/rte_kni.c
lib/librte_kni/rte_kni_fifo.h