[dpdk-dev] [PATCH 2/2] vhost: do not limit packed ring size

Tiwei Bie tiwei.bie at intel.com
Tue Oct 29 14:08:15 CET 2019


On Mon, Oct 28, 2019 at 10:18:11PM +0800, Marvin Liu wrote:
> Virtio spec only set rule that packed ring maximum size is up to 2^15
> entries. Do not limit packed ring size to power of two.

Please add a "Fixes:" line.

> 
> Signed-off-by: Marvin Liu <yong.liu at intel.com>
> ---
>  lib/librte_vhost/vhost_user.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 87dc3fc53..bbf323373 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -363,8 +363,21 @@ 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;
> +		}
> +
> +	}

Please remove above empty line.

> +
> +	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
> 


More information about the dev mailing list