vhost: fix guest/host physical address conversion
authorPatrick Fu <patrick.fu@intel.com>
Tue, 27 Oct 2020 02:06:08 +0000 (10:06 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:35:05 +0000 (23:35 +0100)
commitfb4b7a131c9ea45fa6381c7492d7568c302d3cc2
treee95d4cd45a7ce92701f245f9dad6335171e9a0e9
parent47235f16505f8f4c0de689a94c66169a2b944e37
vhost: fix guest/host physical address conversion

gpa_to_hpa() function almost always fails due to the wrong setup of
the binary tree search key. Since there has already been a similar
function gpa_to_first_hpa() available in the vhost, instead of fixing
the issue in its original logic, gpa_to_hpa() function is rewritten to
be a wrapper of the gpa_to_first_hpa() to avoid code redundancy.

Fixes: e246896178e6 ("vhost: get guest/host physical address mappings")
Fixes: faa9867c4da2 ("vhost: use binary search in address conversion")
Cc: stable@dpdk.org
Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost.h