From patchwork Fri Oct 9 05:46:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuanhan Liu X-Patchwork-Id: 7492 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 566598E6E; Fri, 9 Oct 2015 07:46:14 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1564C8D97 for ; Fri, 9 Oct 2015 07:46:09 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 08 Oct 2015 22:46:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,657,1437462000"; d="scan'208";a="822889464" Received: from yliu-dev.sh.intel.com ([10.239.66.49]) by fmsmga002.fm.intel.com with ESMTP; 08 Oct 2015 22:46:08 -0700 From: Yuanhan Liu To: dev@dpdk.org Date: Fri, 9 Oct 2015 13:46:01 +0800 Message-Id: <1444369572-1157-3-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1444369572-1157-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1444369572-1157-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: marcel@redhat.com, "Michael S. Tsirkin" Subject: [dpdk-dev] [PATCH v6 02/13] vhost-user: add VHOST_USER_GET_QUEUE_NUM message X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- lib/librte_vhost/vhost_user/vhost-net-user.c | 7 +++++++ lib/librte_vhost/vhost_user/vhost-net-user.h | 1 + 2 files changed, 8 insertions(+) diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vhost/vhost_user/vhost-net-user.c index bc2ad24..8675cd4 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 4490d23..389d21d 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;