patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] vhost: fix net header settings in vhost datapath
@ 2023-01-04  2:39 Wenwu Ma
  2023-01-13  3:06 ` Ling, WeiX
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Wenwu Ma @ 2023-01-04  2:39 UTC (permalink / raw)
  To: dev; +Cc: Wenwu Ma, stable

In vhost sync batch enqueue, the "num_buffers" of
virtio net header is not be set, but it should be
set to 1 if the mrg_rxbuf feature is turned on,
This patch fix the issue.

Fixes: ef861692c398 ("vhost: add packed ring batch enqueue")
Cc: stable@dpdk.org

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
 lib/vhost/virtio_net.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index cf796183a0..61d9052a57 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -1493,6 +1493,12 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev,
 			sizeof(struct virtio_net_hdr_mrg_rxbuf);
 	}
 
+	if (rxvq_is_mergeable(dev)) {
+		vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) {
+			ASSIGN_UNLESS_EQUAL(hdrs[i]->num_buffers, 1);
+		}
+	}
+
 	vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
 		virtio_enqueue_offload(pkts[i], &hdrs[i]->hdr);
 
-- 
2.25.1


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

* RE: [PATCH] vhost: fix net header settings in vhost datapath
  2023-01-04  2:39 [PATCH] vhost: fix net header settings in vhost datapath Wenwu Ma
@ 2023-01-13  3:06 ` Ling, WeiX
  2023-01-13  3:16 ` Jiang, Cheng1
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Ling, WeiX @ 2023-01-13  3:06 UTC (permalink / raw)
  To: Ma, WenwuX, dev; +Cc: Ma, WenwuX, stable

> -----Original Message-----
> From: Wenwu Ma <wenwux.ma@intel.com>
> Sent: Wednesday, January 4, 2023 10:40 AM
> To: dev@dpdk.org
> Cc: Ma, WenwuX <wenwux.ma@intel.com>; stable@dpdk.org
> Subject: [PATCH] vhost: fix net header settings in vhost datapath
>
> In vhost sync batch enqueue, the "num_buffers" of virtio net header is not
> be set, but it should be set to 1 if the mrg_rxbuf feature is turned on, This
> patch fix the issue.
>
> Fixes: ef861692c398 ("vhost: add packed ring batch enqueue")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> ---

Tested-by: Wei Ling <weix.ling@intel.com>


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

* RE: [PATCH] vhost: fix net header settings in vhost datapath
  2023-01-04  2:39 [PATCH] vhost: fix net header settings in vhost datapath Wenwu Ma
  2023-01-13  3:06 ` Ling, WeiX
@ 2023-01-13  3:16 ` Jiang, Cheng1
  2023-02-03 14:43 ` Maxime Coquelin
  2023-02-03 14:58 ` Maxime Coquelin
  3 siblings, 0 replies; 6+ messages in thread
From: Jiang, Cheng1 @ 2023-01-13  3:16 UTC (permalink / raw)
  To: Ma, WenwuX, dev, Coquelin, Maxime, Xia, Chenbo; +Cc: Ma, WenwuX, stable

Hi Wenwu,

> -----Original Message-----
> From: Wenwu Ma <wenwux.ma@intel.com>
> Sent: Wednesday, January 4, 2023 10:40 AM
> To: dev@dpdk.org
> Cc: Ma, WenwuX <wenwux.ma@intel.com>; stable@dpdk.org
> Subject: [PATCH] vhost: fix net header settings in vhost datapath
>
> In vhost sync batch enqueue, the "num_buffers" of virtio net header is not
> be set, but it should be set to 1 if the mrg_rxbuf feature is turned on, This
> patch fix the issue.
>
> Fixes: ef861692c398 ("vhost: add packed ring batch enqueue")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> ---
>  lib/vhost/virtio_net.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index
> cf796183a0..61d9052a57 100644
> --- a/lib/vhost/virtio_net.c
> +++ b/lib/vhost/virtio_net.c
> @@ -1493,6 +1493,12 @@ virtio_dev_rx_batch_packed_copy(struct
> virtio_net *dev,
>                       sizeof(struct virtio_net_hdr_mrg_rxbuf);
>       }
>
> +     if (rxvq_is_mergeable(dev)) {
> +             vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) {
> +                     ASSIGN_UNLESS_EQUAL(hdrs[i]->num_buffers, 1);
> +             }
> +     }
> +
>       vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
>               virtio_enqueue_offload(pkts[i], &hdrs[i]->hdr);
>
> --
> 2.25.1

Acked-by: Cheng Jiang <cheng1.jiang@intel.com>

Thanks,
Cheng


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

* Re: [PATCH] vhost: fix net header settings in vhost datapath
  2023-01-04  2:39 [PATCH] vhost: fix net header settings in vhost datapath Wenwu Ma
  2023-01-13  3:06 ` Ling, WeiX
  2023-01-13  3:16 ` Jiang, Cheng1
@ 2023-02-03 14:43 ` Maxime Coquelin
  2023-02-03 14:58 ` Maxime Coquelin
  3 siblings, 0 replies; 6+ messages in thread
From: Maxime Coquelin @ 2023-02-03 14:43 UTC (permalink / raw)
  To: Wenwu Ma, dev; +Cc: stable



On 1/4/23 03:39, Wenwu Ma wrote:
> In vhost sync batch enqueue, the "num_buffers" of
> virtio net header is not be set, but it should be
> set to 1 if the mrg_rxbuf feature is turned on,
> This patch fix the issue.
> 
> Fixes: ef861692c398 ("vhost: add packed ring batch enqueue")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> ---
>   lib/vhost/virtio_net.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
> index cf796183a0..61d9052a57 100644
> --- a/lib/vhost/virtio_net.c
> +++ b/lib/vhost/virtio_net.c
> @@ -1493,6 +1493,12 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev,
>   			sizeof(struct virtio_net_hdr_mrg_rxbuf);
>   	}
>   
> +	if (rxvq_is_mergeable(dev)) {
> +		vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) {
> +			ASSIGN_UNLESS_EQUAL(hdrs[i]->num_buffers, 1);
> +		}
> +	}
> +
>   	vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
>   		virtio_enqueue_offload(pkts[i], &hdrs[i]->hdr);
>   

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

Thanks,
Maxime


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

* Re: [PATCH] vhost: fix net header settings in vhost datapath
  2023-01-04  2:39 [PATCH] vhost: fix net header settings in vhost datapath Wenwu Ma
                   ` (2 preceding siblings ...)
  2023-02-03 14:43 ` Maxime Coquelin
@ 2023-02-03 14:58 ` Maxime Coquelin
  3 siblings, 0 replies; 6+ messages in thread
From: Maxime Coquelin @ 2023-02-03 14:58 UTC (permalink / raw)
  To: Wenwu Ma, dev; +Cc: stable



On 1/4/23 03:39, Wenwu Ma wrote:
> In vhost sync batch enqueue, the "num_buffers" of
> virtio net header is not be set, but it should be
> set to 1 if the mrg_rxbuf feature is turned on,
> This patch fix the issue.
> 
> Fixes: ef861692c398 ("vhost: add packed ring batch enqueue")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> ---
>   lib/vhost/virtio_net.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
> index cf796183a0..61d9052a57 100644
> --- a/lib/vhost/virtio_net.c
> +++ b/lib/vhost/virtio_net.c
> @@ -1493,6 +1493,12 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev,
>   			sizeof(struct virtio_net_hdr_mrg_rxbuf);
>   	}
>   
> +	if (rxvq_is_mergeable(dev)) {
> +		vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) {
> +			ASSIGN_UNLESS_EQUAL(hdrs[i]->num_buffers, 1);
> +		}
> +	}
> +
>   	vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
>   		virtio_enqueue_offload(pkts[i], &hdrs[i]->hdr);
>   

Applied to dpdk-next-virtio/main.

Thanks,
Maxime


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

* [PATCH] vhost: fix net header settings in vhost datapath
@ 2023-01-04  2:31 Wenwu Ma
  0 siblings, 0 replies; 6+ messages in thread
From: Wenwu Ma @ 2023-01-04  2:31 UTC (permalink / raw)
  To: maxime.coquelin, chenbo.xia, stable
  Cc: jiayu.hu, yinan.wang, weix.ling, cheng1.jiang, Wenwu Ma

In vhost sync batch enqueue, the "num_buffers" of
virtio net header is not be set, but it should be
set to 1 if the mrg_rxbuf feature is turned on,
This patch fix the issue.

Fixes: ef861692c398 ("vhost: add packed ring batch enqueue")
Cc: stable@dpdk.org

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
 lib/vhost/virtio_net.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
index cf796183a0..61d9052a57 100644
--- a/lib/vhost/virtio_net.c
+++ b/lib/vhost/virtio_net.c
@@ -1493,6 +1493,12 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev,
 			sizeof(struct virtio_net_hdr_mrg_rxbuf);
 	}
 
+	if (rxvq_is_mergeable(dev)) {
+		vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) {
+			ASSIGN_UNLESS_EQUAL(hdrs[i]->num_buffers, 1);
+		}
+	}
+
 	vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)
 		virtio_enqueue_offload(pkts[i], &hdrs[i]->hdr);
 
-- 
2.25.1


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

end of thread, other threads:[~2023-02-03 14:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04  2:39 [PATCH] vhost: fix net header settings in vhost datapath Wenwu Ma
2023-01-13  3:06 ` Ling, WeiX
2023-01-13  3:16 ` Jiang, Cheng1
2023-02-03 14:43 ` Maxime Coquelin
2023-02-03 14:58 ` Maxime Coquelin
  -- strict thread matches above, loose matches on Subject: below --
2023-01-04  2:31 Wenwu Ma

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).