From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by dpdk.org (Postfix) with ESMTP id 70D8AADA2 for ; Thu, 16 Apr 2015 09:39:30 +0200 (CEST) Received: by wizk4 with SMTP id k4so183594706wiz.1 for ; Thu, 16 Apr 2015 00:39:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=tlir7MGyEHW3POmEUTnDNoq5jfRKUN4mPB344xCt+ek=; b=IIKKGaEPZAloOEcNA1NXqL/7PZ40J5bjAG3+MngWgc83m3PbSTcEBCHU7u4wgFifT4 ks9hUbWylgHXZ21LyyWD8Lqg4gnwyhad8WpxQa13oZZfgdWczn7//7G+k9oCwD+dRj1f VvbSBbiYPiPgKg4JOwVdhCVpSoDKIv1B7MpYp4FJanUOeSQ+FqDjNftTkZst+j5GHr9v zB/xL866i6fR1iRFn6FbdKYyfWZfa3+y7reX7P7QRXNGL3ttjSerFFM09/HNTUsNSFh2 9oetI2/Smv910H5nkJnm5Iu2WDx4wuwXT6yFIcJIB3Ut88iv3R/diTGP6xYAUS+QGz/s F58Q== X-Gm-Message-State: ALoCoQnsZtRiTQnET2xF1sve73C8VkuA7zJ6XrLIVviC/A7H7F9AmELn69RcheNg8LvdbQrAA4Uv X-Received: by 10.180.73.230 with SMTP id o6mr5307877wiv.11.1429169970281; Thu, 16 Apr 2015 00:39:30 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id wr2sm9129170wjb.45.2015.04.16.00.39.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Apr 2015 00:39:29 -0700 (PDT) From: Thomas Monjalon To: dev@dpdk.org Date: Thu, 16 Apr 2015 09:38:46 +0200 Message-ID: <8989447.p2fNsf6zhO@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: References: <1429111219-8789-1-git-send-email-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Subject: Re: [dpdk-dev] [PATCH 4/5] virtio: fix ring size negotiation 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: , X-List-Received-Date: Thu, 16 Apr 2015 07:39:30 -0000 Guys, this is an example of what should not be done with emails formatt= ing. 2015-04-16 06:26, Ouyang, Changchun: >=20 > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Thursday, April 16, 2015 1:48 PM > To: Ouyang, Changchun > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 4/5] virtio: fix ring size negotiation= This header is partly useless. >=20 > No warning is needed, it just works. Stephen, please do not top post. It makes harder to find what you are c= ommenting. >=20 > I know it works, but the upper user don=E2=80=99t know the descriptor= number is reduced. > I concern it is not so user-friendly here. Changchun, please be sure the above text is quoted. How are we supposed to understand who is speaking here? All, please, take care of readers. Thanks > On Wed, Apr 15, 2015 at 8:39 PM, Ouyang, Changchun > wrote: >=20 >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org= ] On Behalf Of Stephen > > Hemminger > > Sent: Wednesday, April 15, 2015 11:20 PM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH 4/5] virtio: fix ring size negotiation > > > > This fixes another of the issues with running virtio on non-KVM > > envirionments. For example, Google Compute Engine reports a ring si= ze of > > 16K. > > > > If guest virtio requests more slots than available then the queue s= hould just >=20 > I suspect 'more' here should be 'less'? >=20 > > be initialized to the smaller value. > > > > Conversely, if the number of descriptors requested exceeds the virt= io host > > queue size, then just silently use the smaller host size. > > > > Signed-off-by: Stephen Hemminger > > > --- > > lib/librte_pmd_virtio/virtio_ethdev.c | 18 +++++++++++++----- > > 1 file changed, 13 insertions(+), 5 deletions(-) > > > > diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c > > b/lib/librte_pmd_virtio/virtio_ethdev.c > > index 3cb9c6a..db0232e 100644 > > --- a/lib/librte_pmd_virtio/virtio_ethdev.c > > +++ b/lib/librte_pmd_virtio/virtio_ethdev.c > > @@ -267,13 +267,21 @@ int virtio_dev_queue_setup(struct rte_eth_dev= > > *dev, > > if (vq_size =3D=3D 0) { > > PMD_INIT_LOG(ERR, "%s: virtqueue does not exist", > > __func__); > > return -EINVAL; > > - } else if (!rte_is_power_of_2(vq_size)) { > > + } > > + > > + if (!rte_is_power_of_2(vq_size)) { > > PMD_INIT_LOG(ERR, "%s: virtqueue size is not powerof = 2", > > __func__); > > return -EINVAL; > > - } else if (nb_desc !=3D vq_size) { > > - PMD_INIT_LOG(ERR, "Warning: nb_desc(%d) is not equal = to > > vq size (%d), fall to vq size", > > - nb_desc, vq_size); > > - nb_desc =3D vq_size; > > + } > > + > > + if (nb_desc < vq_size) { > > + if (!rte_is_power_of_2(nb_desc)) { > > + PMD_INIT_LOG(ERR, > > + "nb_desc(%u) size is not powerof= 2", > > + nb_desc); > > + return -EINVAL; > > + } > > + vq_size =3D nb_desc; > Don't we need a warning when nb_desc > vq_size? >=20 > > } > > > > if (queue_type =3D=3D VTNET_RQ) { > > -- > > 2.1.4 >=20 >=20