There are some status reads and updates that need to happen before the
protocol features are negotiated. Therefore, assuming the backend does
support this feature can lead to failures.
On server mode, do not assume the backend supports
VHOST_USER_PROTOCOL_F_STATUS. Activate it back on reconnection and
clear it on disconnection.
Fixes:
57912824615f ("net/virtio-user: support vhost status setting")
Cc: stable@dpdk.org
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
* later.
*/
dev->device_features = VIRTIO_USER_SUPPORTED_FEATURES;
+
+ /* We cannot assume VHOST_USER_PROTOCOL_F_STATUS is supported
+ * until it's negotiated
+ */
+ dev->protocol_features &=
+ ~(1ULL << VHOST_USER_PROTOCOL_F_STATUS);
}
&protocol_features))
return -1;
+ /* Offer VHOST_USER_PROTOCOL_F_STATUS */
+ dev->protocol_features |=
+ (1ULL << VHOST_USER_PROTOCOL_F_STATUS);
dev->protocol_features &= protocol_features;
if (dev->ops->send_request(dev,
if (dev->vhostfd >= 0) {
close(dev->vhostfd);
dev->vhostfd = -1;
+ /* Until the featuers are negotiated again, don't assume
+ * the backend supports VHOST_USER_PROTOCOL_F_STATUS
+ */
+ dev->protocol_features &=
+ ~(1ULL << VHOST_USER_PROTOCOL_F_STATUS);
}
eth_dev->intr_handle->fd = dev->listenfd;
rte_intr_callback_register(eth_dev->intr_handle,