From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DABB8A00BE; Wed, 30 Oct 2019 02:45:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EDFD51BEBD; Wed, 30 Oct 2019 02:45:09 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 82A9F1BEA6; Wed, 30 Oct 2019 02:45:05 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Oct 2019 18:45:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,245,1569308400"; d="scan'208";a="399989924" Received: from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.142]) by fmsmga005.fm.intel.com with ESMTP; 29 Oct 2019 18:45:04 -0700 From: Marvin Liu To: maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com Cc: dev@dpdk.org, Marvin Liu , stable@dpdk.org Date: Wed, 30 Oct 2019 17:24:21 +0800 Message-Id: <20191030092421.38220-2-yong.liu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191030092421.38220-1-yong.liu@intel.com> References: <20191028141811.73444-1-yong.liu@intel.com> <20191030092421.38220-1-yong.liu@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] vhost: do not limit packed ring size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Virtio spec only set rule that packed ring maximum size is up to 2^15 entries. Should not limit packed ring size to power of two. Fixes: 708e14d8b9ac ("vhost: advertize packed ring layout support") Cc: stable@dpdk.org Signed-off-by: Marvin Liu --- lib/librte_vhost/vhost_user.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 61ef699ac..df9bbf0ac 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -363,8 +363,20 @@ vhost_user_set_vring_num(struct virtio_net **pdev, * * Queue Size value is always a power of 2. The maximum Queue Size * value is 32768. + * + * VIRTIO 1.1 2.7 Virtqueues says: + * + * Packed virtqueues support up to 2^15 entries each. */ - if ((vq->size & (vq->size - 1)) || vq->size > 32768) { + if (!vq_is_packed(dev)) { + if (vq->size & (vq->size - 1)) { + RTE_LOG(ERR, VHOST_CONFIG, + "invalid virtqueue size %u\n", vq->size); + return RTE_VHOST_MSG_RESULT_ERR; + } + } + + if (vq->size > 32768) { RTE_LOG(ERR, VHOST_CONFIG, "invalid virtqueue size %u\n", vq->size); return RTE_VHOST_MSG_RESULT_ERR; -- 2.17.1