vhost: use binary search in address conversion
authorMarvin Liu <yong.liu@intel.com>
Wed, 29 Apr 2020 01:04:22 +0000 (09:04 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 5 May 2020 13:54:26 +0000 (15:54 +0200)
commitfaa9867c4da2faa77141082cab82f458033f2b79
treee04e38266f4ffae8b3081eb44acf1adfb4fe4b1a
parent20fd2f91cf2fb45ffc66abd4ca8ab26906cd0d1f
vhost: use binary search in address conversion

If Tx zero copy enabled, gpa to hpa mapping table is updated one by
one. This will harm performance when guest memory backend using 2M
hugepages. Now utilize binary search to find the entry in mapping
table, meanwhile set the threshold to 256 entries for linear search.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost.h
lib/librte_vhost/vhost_user.c