net/virtio-user: fix feature negotiation
authorJianfeng Tan <jianfeng.tan@intel.com>
Thu, 13 Apr 2017 10:11:27 +0000 (10:11 +0000)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 19 Apr 2017 08:49:06 +0000 (10:49 +0200)
commitbed3b24c87cb7fb63d24d16d65b911fe14525d82
tree5dbaf44af702db8e4e9a3c6c5937f6ae2b37a2df
parent912be9daf41c0a5d1042ccde5581492a43865f32
net/virtio-user: fix feature negotiation

The feature negotiation in virtio-user is proven to be broken,
which results in device initialization failure.

Originally, we get features from vhost backend, and remove those
that are not supported. But when new feature is added, for example,
VIRTIO_NET_F_MTU, we fail to remove this new feature. Then, this
new feature will be negotiated, as both frontend and backend claim
to support this feature.

To fix it, we add a macro to record supported features, as a filter
to remove newly added features.

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_user/virtio_user_dev.c