[v2,1/2] net/virtio: do not limit packed ring size

Message ID 20191030092421.38220-1-yong.liu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series [v2,1/2] net/virtio: do not limit packed ring size |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Marvin Liu Oct. 30, 2019, 9:24 a.m. UTC
  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(-)
  

Comments

Tiwei Bie Nov. 4, 2019, 4:51 a.m. UTC | #1
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>
  
Maxime Coquelin Nov. 6, 2019, 2:14 p.m. UTC | #2
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
  
Maxime Coquelin Nov. 6, 2019, 8:58 p.m. UTC | #3
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
  

Patch

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;
 	}