vhost: support requests only handled by external backend
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 19 Mar 2019 10:54:17 +0000 (11:54 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 20 Mar 2019 17:15:42 +0000 (18:15 +0100)
commit3e0396166be4950fcbb629215019efadaf7c19c5
tree2506d5f4570ecd79f4417c24dbd0ddb3acf030f3
parent9401b80327a288719802e526e76f947b5d8b2e3f
vhost: support requests only handled by external backend

External backends may have specific requests to handle, and so
we don't want the vhost-user lib to handle these requests as
errors.

This patch also changes the experimental API by introducing
RTE_VHOST_MSG_RESULT_NOT_HANDLED so that vhost-user lib
can report an error if a message is handled neither by
the vhost-user library nor by the external backend.

The logic changes a bit so that if the callback returns
with ERR, OK or REPLY, it is considered the message
is handled by the external backend so it won't be
handled by the vhost-user library.
It is still possible for an external backend to listen
to requests that have to be handled by the vhost-user
library like SET_MEM_TABLE, but the callback have to
return NOT_HANDLED in that case.

Vhost-crypto backend is also adapted to this API change.

Suggested-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
lib/librte_vhost/rte_vhost.h
lib/librte_vhost/vhost_crypto.c
lib/librte_vhost/vhost_user.c