When connected to a vhost-user backend, the flag
VHOST_USER_F_PROTOCOL_FEATURES is not advertised, preventing to do
multiqueue (the VHOST_USER_PROTOCOL_F_MQ protocol feature is ignored by
some backends if the VHOST_USER_F_PROTOCOL_FEATURES feature is not set).
When setting vhost-user features, advertise this flag if it was
advertised by our peer.
Fixes: 8e7561054ac7 ("net/virtio: support vhost-user protocol features")
Cc: stable@dpdk.org
Suggested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
if (has_reply_ack)
msg.flags |= VHOST_USER_NEED_REPLY_MASK;
/* Fallthrough */
- case VHOST_USER_SET_FEATURES:
case VHOST_USER_SET_PROTOCOL_FEATURES:
case VHOST_USER_SET_LOG_BASE:
msg.payload.u64 = *((__u64 *)arg);
msg.size = sizeof(m.payload.u64);
break;
+ case VHOST_USER_SET_FEATURES:
+ msg.payload.u64 = *((__u64 *)arg) | (dev->device_features &
+ (1ULL << VHOST_USER_F_PROTOCOL_FEATURES));
+ msg.size = sizeof(m.payload.u64);
+ break;
+
case VHOST_USER_SET_OWNER:
case VHOST_USER_RESET_OWNER:
break;