net/virtio-user: do not reset virtqueues for split ring

Message ID 20200205021108.370141-1-tiwei.bie@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series net/virtio-user: do not reset virtqueues for split ring |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation fail apply issues

Commit Message

Tiwei Bie Feb. 5, 2020, 2:11 a.m. UTC
  Add missing braces to avoid resetting virtqueues unconditionally
during reconnection.

Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
Cc: Xuan Ding <xuan.ding@intel.com>

 drivers/net/virtio/virtio_user_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Ding, Xuan Feb. 5, 2020, 3:07 a.m. UTC | #1
Hi Tiwei,

Corrected on my local, thank you for your fix in advance.

Regards,
Xuan Ding

> -----Original Message-----
> From: Bie, Tiwei <tiwei.bie@intel.com>
> Sent: Wednesday, February 5, 2020 10:11 AM
> To: dev@dpdk.org; maxime.coquelin@redhat.com; Wang, Zhihong
> <zhihong.wang@intel.com>
> Cc: Ding, Xuan <xuan.ding@intel.com>
> Subject: [PATCH] net/virtio-user: do not reset virtqueues for split ring
> 
> Add missing braces to avoid resetting virtqueues unconditionally during
> reconnection.
> 
> Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
> Cc: Xuan Ding <xuan.ding@intel.com>
> 
>  drivers/net/virtio/virtio_user_ethdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio/virtio_user_ethdev.c
> b/drivers/net/virtio/virtio_user_ethdev.c
> index f3b35d1bd..e61af4068 100644
> --- a/drivers/net/virtio/virtio_user_ethdev.c
> +++ b/drivers/net/virtio/virtio_user_ethdev.c
> @@ -89,10 +89,11 @@ virtio_user_server_reconnect(struct virtio_user_dev
> *dev)
>  	dev->features &= dev->device_features;
> 
>  	/* For packed ring, resetting queues is required in reconnection. */
> -	if (vtpci_packed_queue(hw))
> +	if (vtpci_packed_queue(hw)) {
>  		PMD_INIT_LOG(NOTICE, "Packets on the fly will be dropped"
>  				" when packed ring reconnecting.");
>  		virtio_user_reset_queues_packed(eth_dev);
> +	}
> 
>  	ret = virtio_user_start_device(dev);
>  	if (ret < 0)
> --
> 2.24.1
  
Maxime Coquelin Feb. 5, 2020, 7:52 a.m. UTC | #2
On 2/5/20 3:11 AM, Tiwei Bie wrote:
> Add missing braces to avoid resetting virtqueues unconditionally
> during reconnection.
> 
> Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
> Cc: Xuan Ding <xuan.ding@intel.com>
> 
>  drivers/net/virtio/virtio_user_ethdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
> index f3b35d1bd..e61af4068 100644
> --- a/drivers/net/virtio/virtio_user_ethdev.c
> +++ b/drivers/net/virtio/virtio_user_ethdev.c
> @@ -89,10 +89,11 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)
>  	dev->features &= dev->device_features;
>  
>  	/* For packed ring, resetting queues is required in reconnection. */
> -	if (vtpci_packed_queue(hw))
> +	if (vtpci_packed_queue(hw)) {
>  		PMD_INIT_LOG(NOTICE, "Packets on the fly will be dropped"
>  				" when packed ring reconnecting.");
>  		virtio_user_reset_queues_packed(eth_dev);
> +	}
>  
>  	ret = virtio_user_start_device(dev);
>  	if (ret < 0)
> 

Oops, thank you Tiwei for fixing it!

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

Maxime
  
Maxime Coquelin Feb. 5, 2020, 9:45 a.m. UTC | #3
On 2/5/20 3:11 AM, Tiwei Bie wrote:
> Add missing braces to avoid resetting virtqueues unconditionally
> during reconnection.
> 
> Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
> Cc: Xuan Ding <xuan.ding@intel.com>
> 
>  drivers/net/virtio/virtio_user_ethdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to dpdk-next-virtio tree.

Thanks,
Maxime
  

Patch

diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index f3b35d1bd..e61af4068 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -89,10 +89,11 @@  virtio_user_server_reconnect(struct virtio_user_dev *dev)
 	dev->features &= dev->device_features;
 
 	/* For packed ring, resetting queues is required in reconnection. */
-	if (vtpci_packed_queue(hw))
+	if (vtpci_packed_queue(hw)) {
 		PMD_INIT_LOG(NOTICE, "Packets on the fly will be dropped"
 				" when packed ring reconnecting.");
 		virtio_user_reset_queues_packed(eth_dev);
+	}
 
 	ret = virtio_user_start_device(dev);
 	if (ret < 0)