DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/virtio: do not limit packed ring size
@ 2019-10-28 14:18 Marvin Liu
  2019-10-28 14:18 ` [dpdk-dev] [PATCH 2/2] vhost: " Marvin Liu
  2019-10-30  9:24 ` [dpdk-dev] [PATCH v2 1/2] net/virtio: " Marvin Liu
  0 siblings, 2 replies; 11+ messages in thread
From: Marvin Liu @ 2019-10-28 14:18 UTC (permalink / raw)
  To: maxime.coquelin, tiwei.bie, zhihong.wang; +Cc: dev, Marvin Liu

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.

Signed-off-by: Marvin Liu <yong.liu@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 7d3db4d73..41d323fc9 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -465,8 +465,8 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
 		return -EINVAL;
 	}
 
-	if (!rte_is_power_of_2(vq_size)) {
-		PMD_INIT_LOG(ERR, "virtqueue size is not powerof 2");
+	if (!vtpci_packed_queue(hw) && !rte_is_power_of_2(vq_size)) {
+		PMD_INIT_LOG(ERR, "split virtqueue size is not powerof 2");
 		return -EINVAL;
 	}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] [PATCH 2/2] vhost: do not limit packed ring size
  2019-10-28 14:18 [dpdk-dev] [PATCH 1/2] net/virtio: do not limit packed ring size Marvin Liu
@ 2019-10-28 14:18 ` Marvin Liu
  2019-10-29 13:08   ` Tiwei Bie
  2019-10-30  9:24 ` [dpdk-dev] [PATCH v2 1/2] net/virtio: " Marvin Liu
  1 sibling, 1 reply; 11+ messages in thread
From: Marvin Liu @ 2019-10-28 14:18 UTC (permalink / raw)
  To: maxime.coquelin, tiwei.bie, zhihong.wang; +Cc: dev, Marvin Liu

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.

Signed-off-by: Marvin Liu <yong.liu@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;
+		}
+
+	}
+
+	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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] vhost: do not limit packed ring size
  2019-10-28 14:18 ` [dpdk-dev] [PATCH 2/2] vhost: " Marvin Liu
@ 2019-10-29 13:08   ` Tiwei Bie
  0 siblings, 0 replies; 11+ messages in thread
From: Tiwei Bie @ 2019-10-29 13:08 UTC (permalink / raw)
  To: Marvin Liu; +Cc: maxime.coquelin, zhihong.wang, dev

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] [PATCH v2 1/2] net/virtio: do not limit packed ring size
  2019-10-28 14:18 [dpdk-dev] [PATCH 1/2] net/virtio: do not limit packed ring size Marvin Liu
  2019-10-28 14:18 ` [dpdk-dev] [PATCH 2/2] vhost: " Marvin Liu
@ 2019-10-30  9:24 ` Marvin Liu
  2019-10-30  9:24   ` [dpdk-dev] [PATCH v2 2/2] vhost: " Marvin Liu
                     ` (3 more replies)
  1 sibling, 4 replies; 11+ messages in thread
From: Marvin Liu @ 2019-10-30  9:24 UTC (permalink / raw)
  To: maxime.coquelin, tiwei.bie, zhihong.wang; +Cc: dev, Marvin Liu, stable

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: aea29aa5d37b ("net/virtio: enable packed virtqueues by default")
Cc: stable@dpdk.org

Signed-off-by: Marvin Liu <yong.liu@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 7d3db4d73..41d323fc9 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -465,8 +465,8 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
 		return -EINVAL;
 	}
 
-	if (!rte_is_power_of_2(vq_size)) {
-		PMD_INIT_LOG(ERR, "virtqueue size is not powerof 2");
+	if (!vtpci_packed_queue(hw) && !rte_is_power_of_2(vq_size)) {
+		PMD_INIT_LOG(ERR, "split virtqueue size is not powerof 2");
 		return -EINVAL;
 	}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-dev] [PATCH v2 2/2] vhost: do not limit packed ring size
  2019-10-30  9:24 ` [dpdk-dev] [PATCH v2 1/2] net/virtio: " Marvin Liu
@ 2019-10-30  9:24   ` Marvin Liu
  2019-11-04  4:54     ` Tiwei Bie
                       ` (2 more replies)
  2019-11-04  4:51   ` [dpdk-dev] [PATCH v2 1/2] net/virtio: " Tiwei Bie
                     ` (2 subsequent siblings)
  3 siblings, 3 replies; 11+ messages in thread
From: Marvin Liu @ 2019-10-30  9:24 UTC (permalink / raw)
  To: maxime.coquelin, tiwei.bie, zhihong.wang; +Cc: dev, Marvin Liu, stable

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 <yong.liu@intel.com>
---
 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] net/virtio: do not limit packed ring size
  2019-10-30  9:24 ` [dpdk-dev] [PATCH v2 1/2] net/virtio: " Marvin Liu
  2019-10-30  9:24   ` [dpdk-dev] [PATCH v2 2/2] vhost: " Marvin Liu
@ 2019-11-04  4:51   ` Tiwei Bie
  2019-11-06 14:14   ` Maxime Coquelin
  2019-11-06 20:58   ` Maxime Coquelin
  3 siblings, 0 replies; 11+ messages in thread
From: Tiwei Bie @ 2019-11-04  4:51 UTC (permalink / raw)
  To: Marvin Liu; +Cc: maxime.coquelin, zhihong.wang, dev, stable

On Wed, Oct 30, 2019 at 05:24:20PM +0800, Marvin Liu wrote:
> 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: aea29aa5d37b ("net/virtio: enable packed virtqueues by default")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/2] vhost: do not limit packed ring size
  2019-10-30  9:24   ` [dpdk-dev] [PATCH v2 2/2] vhost: " Marvin Liu
@ 2019-11-04  4:54     ` Tiwei Bie
  2019-11-06 14:19     ` Maxime Coquelin
  2019-11-06 20:58     ` Maxime Coquelin
  2 siblings, 0 replies; 11+ messages in thread
From: Tiwei Bie @ 2019-11-04  4:54 UTC (permalink / raw)
  To: Marvin Liu; +Cc: maxime.coquelin, zhihong.wang, dev, stable

On Wed, Oct 30, 2019 at 05:24:21PM +0800, Marvin Liu wrote:
> 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 <yong.liu@intel.com>
> ---
>  lib/librte_vhost/vhost_user.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)

Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] net/virtio: do not limit packed ring size
  2019-10-30  9:24 ` [dpdk-dev] [PATCH v2 1/2] net/virtio: " Marvin Liu
  2019-10-30  9:24   ` [dpdk-dev] [PATCH v2 2/2] vhost: " Marvin Liu
  2019-11-04  4:51   ` [dpdk-dev] [PATCH v2 1/2] net/virtio: " Tiwei Bie
@ 2019-11-06 14:14   ` Maxime Coquelin
  2019-11-06 20:58   ` Maxime Coquelin
  3 siblings, 0 replies; 11+ messages in thread
From: Maxime Coquelin @ 2019-11-06 14:14 UTC (permalink / raw)
  To: Marvin Liu, tiwei.bie, zhihong.wang; +Cc: dev, stable



On 10/30/19 10:24 AM, Marvin Liu wrote:
> 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: aea29aa5d37b ("net/virtio: enable packed virtqueues by default")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 7d3db4d73..41d323fc9 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -465,8 +465,8 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
>  		return -EINVAL;
>  	}
>  
> -	if (!rte_is_power_of_2(vq_size)) {
> -		PMD_INIT_LOG(ERR, "virtqueue size is not powerof 2");
> +	if (!vtpci_packed_queue(hw) && !rte_is_power_of_2(vq_size)) {
> +		PMD_INIT_LOG(ERR, "split virtqueue size is not powerof 2");
>  		return -EINVAL;
>  	}
>  
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/2] vhost: do not limit packed ring size
  2019-10-30  9:24   ` [dpdk-dev] [PATCH v2 2/2] vhost: " Marvin Liu
  2019-11-04  4:54     ` Tiwei Bie
@ 2019-11-06 14:19     ` Maxime Coquelin
  2019-11-06 20:58     ` Maxime Coquelin
  2 siblings, 0 replies; 11+ messages in thread
From: Maxime Coquelin @ 2019-11-06 14:19 UTC (permalink / raw)
  To: Marvin Liu, tiwei.bie, zhihong.wang; +Cc: dev, stable



On 10/30/19 10:24 AM, Marvin Liu wrote:
> 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 <yong.liu@intel.com>
> ---
>  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;
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/2] net/virtio: do not limit packed ring size
  2019-10-30  9:24 ` [dpdk-dev] [PATCH v2 1/2] net/virtio: " Marvin Liu
                     ` (2 preceding siblings ...)
  2019-11-06 14:14   ` Maxime Coquelin
@ 2019-11-06 20:58   ` Maxime Coquelin
  3 siblings, 0 replies; 11+ messages in thread
From: Maxime Coquelin @ 2019-11-06 20:58 UTC (permalink / raw)
  To: Marvin Liu, tiwei.bie, zhihong.wang; +Cc: dev, stable



On 10/30/19 10:24 AM, Marvin Liu wrote:
> 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: aea29aa5d37b ("net/virtio: enable packed virtqueues by default")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/2] vhost: do not limit packed ring size
  2019-10-30  9:24   ` [dpdk-dev] [PATCH v2 2/2] vhost: " Marvin Liu
  2019-11-04  4:54     ` Tiwei Bie
  2019-11-06 14:19     ` Maxime Coquelin
@ 2019-11-06 20:58     ` Maxime Coquelin
  2 siblings, 0 replies; 11+ messages in thread
From: Maxime Coquelin @ 2019-11-06 20:58 UTC (permalink / raw)
  To: Marvin Liu, tiwei.bie, zhihong.wang; +Cc: dev, stable



On 10/30/19 10:24 AM, Marvin Liu wrote:
> 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 <yong.liu@intel.com>
> ---
>  lib/librte_vhost/vhost_user.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
Applied to dpdk-next-virtio/master.

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-11-06 20:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28 14:18 [dpdk-dev] [PATCH 1/2] net/virtio: do not limit packed ring size Marvin Liu
2019-10-28 14:18 ` [dpdk-dev] [PATCH 2/2] vhost: " Marvin Liu
2019-10-29 13:08   ` Tiwei Bie
2019-10-30  9:24 ` [dpdk-dev] [PATCH v2 1/2] net/virtio: " Marvin Liu
2019-10-30  9:24   ` [dpdk-dev] [PATCH v2 2/2] vhost: " Marvin Liu
2019-11-04  4:54     ` Tiwei Bie
2019-11-06 14:19     ` Maxime Coquelin
2019-11-06 20:58     ` Maxime Coquelin
2019-11-04  4:51   ` [dpdk-dev] [PATCH v2 1/2] net/virtio: " Tiwei Bie
2019-11-06 14:14   ` Maxime Coquelin
2019-11-06 20:58   ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).