From: Yuanhan Liu Date: Thu, 22 Oct 2015 12:35:50 +0000 (+0800) Subject: vhost-user: announce queue number in message X-Git-Tag: spdx-start~8355 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b09b198bfb5c;p=dpdk.git vhost-user: announce queue number in message Add VHOST_USER_GET_QUEUE_NUM message to tell the frontend (qemu) how many queue pairs we support. And it is initiated to VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX. Signed-off-by: Yuanhan Liu Acked-by: Flavio Leitner Acked-by: Huawei Xie --- diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vhost/vhost_user/vhost-net-user.c index bc2ad243fb..8675cd4d72 100644 --- a/lib/librte_vhost/vhost_user/vhost-net-user.c +++ b/lib/librte_vhost/vhost_user/vhost-net-user.c @@ -98,6 +98,7 @@ static const char *vhost_message_str[VHOST_USER_MAX] = { [VHOST_USER_SET_VRING_ERR] = "VHOST_USER_SET_VRING_ERR", [VHOST_USER_GET_PROTOCOL_FEATURES] = "VHOST_USER_GET_PROTOCOL_FEATURES", [VHOST_USER_SET_PROTOCOL_FEATURES] = "VHOST_USER_SET_PROTOCOL_FEATURES", + [VHOST_USER_GET_QUEUE_NUM] = "VHOST_USER_GET_QUEUE_NUM", }; /** @@ -421,6 +422,12 @@ vserver_message_handler(int connfd, void *dat, int *remove) RTE_LOG(INFO, VHOST_CONFIG, "not implemented\n"); break; + case VHOST_USER_GET_QUEUE_NUM: + msg.payload.u64 = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX; + msg.size = sizeof(msg.payload.u64); + send_vhost_message(connfd, &msg); + break; + default: break; diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.h b/lib/librte_vhost/vhost_user/vhost-net-user.h index 4490d2387a..389d21de20 100644 --- a/lib/librte_vhost/vhost_user/vhost-net-user.h +++ b/lib/librte_vhost/vhost_user/vhost-net-user.h @@ -65,6 +65,7 @@ typedef enum VhostUserRequest { VHOST_USER_SET_VRING_ERR = 14, VHOST_USER_GET_PROTOCOL_FEATURES = 15, VHOST_USER_SET_PROTOCOL_FEATURES = 16, + VHOST_USER_GET_QUEUE_NUM = 17, VHOST_USER_MAX } VhostUserRequest;