numam-dpdk/lib
Yuanhan Liu 84ad6e4491 vhost: fix dequeue zero copy
For zero copy mode, we need pin the mbuf to not let the underlaying PMD
driver (or the app) free the mbuf. Currently, only the heading mbuf is
pinned. However, the mbuf free function would try to free all mbufs
in the mbuf chain (-1 to the refcnt). This may lead the head mbuf being
still pinned, while the other subsequent mbufs are actually freed. Which
is wrong.

It becomes more fatal after the mbuf refactor, more specificly, after
the commit 8f094a9ac5 ("mbuf: set mbuf fields while in pool"). The
refcnt resets to 1 after the last real reference. OTOH, it leads to a
situtation that we never know one mbuf is actually freed or not. This
would result the mbuf __just__ after the heading mbuf being freed twice:
it's firstly freed (and put back to mempool) when the underlaying PMD
finishes the DMA.  Later, it will then be freed again when vhost unpins
it. Meaning, one mbuf may be returned to the mempool twice, while in
turn, being allocated twice later. Something uncertain may happen then.
For example, the VM2VM case becomes broken.

Fixes: b0a985d1f3 ("vhost: add dequeue zero copy")
Cc: stable@dpdk.org

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2017-04-19 10:49:06 +02:00
..
librte_acl lib: remove unnecessary void cast 2017-04-11 18:05:10 +02:00
librte_bitratestats bitrate: add bitrate statistics library 2017-04-05 17:59:43 +02:00
librte_cfgfile cfgfile: support empty value 2017-04-04 16:32:06 +02:00
librte_cmdline mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_compat compat: remove unneeded macro 2015-06-29 16:41:23 +02:00
librte_cryptodev lib: remove unnecessary void cast 2017-04-11 18:05:10 +02:00
librte_distributor distributor: fix creation error checks 2017-04-04 14:58:49 +02:00
librte_eal vfio: export utility functions in map file 2017-04-19 15:37:37 +02:00
librte_efd mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_ether ethdev: fix build with strict flags 2017-04-19 15:33:51 +02:00
librte_eventdev eventdev: fix build for clang 4 2017-04-19 15:24:32 +02:00
librte_hash ring: return remaining entry count when dequeuing 2017-03-29 22:32:20 +02:00
librte_ip_frag mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_jobstats mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_kni mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_kvargs mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_latencystats latency: fix build without timer library 2017-04-07 11:43:43 +02:00
librte_lpm mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_mbuf mbuf: bump library version 2017-04-05 13:37:17 +02:00
librte_mempool lib: remove unnecessary void cast 2017-04-11 18:05:10 +02:00
librte_meter mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_metrics metrics: add information metrics library 2017-04-05 17:58:51 +02:00
librte_net lib: remove unnecessary void cast 2017-04-11 18:05:10 +02:00
librte_pdump ring: return free space when enqueuing 2017-03-29 22:32:04 +02:00
librte_pipeline mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_port lib: remove unnecessary void cast 2017-04-11 18:05:10 +02:00
librte_power mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_reorder mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_ring ring: fix return value for single dequeue 2017-04-13 17:18:27 +02:00
librte_sched mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_table lib: remove unnecessary void cast 2017-04-11 18:05:10 +02:00
librte_timer mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
librte_vhost vhost: fix dequeue zero copy 2017-04-19 10:49:06 +02:00
Makefile net: add CRC computation API 2017-04-05 23:03:23 +02:00