vhost: fix net header settings in vhost datapath
PATCH 1/1 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.
--- lib/vhost/virtio_net.c | 6 ++++++ 1 file changed, 6 insertions(+)
lib/vhost/virtio_net.c +6 -0
@@ -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);
Signature · 1 line
2.25.1
Quoted 11 lines
-----Original Message-----
From: Wenwu Ma <[email protected]>
Sent: Wednesday, January 4, 2023 10:40 AM
To: [email protected]
Cc: Ma, WenwuX <[email protected]>; [email protected]
Subject: [PATCH] vhost: fix net header settings in vhost datapathIn vhost sync batch enqueue, the "
num_buffers" of virtio net header is not be set, but it should be set to 1 if themrg_rxbuffeature is turned on, This patch fix the issue.
Quoted 5 lines
Fixes ef861692c398 ("vhost: add packed ring batch enqueue")Signed-off-by Wenwu Ma <[email protected]>---
Hi Wenwu,
Quoted 38 lines
-----Original Message-----
From: Wenwu Ma <[email protected]>
Sent: Wednesday, January 4, 2023 10:40 AM
To: [email protected]
Cc: Ma, WenwuX <[email protected]>; [email protected]
Subject: [PATCH] vhost: fix net header settings in vhost datapathIn vhost sync batch enqueue, the "
num_buffers" of virtio net header is not be set, but it should be set to 1 if themrg_rxbuffeature is turned on, This patch fix the issue.Fixes ef861692c398 ("vhost: add packed ring batch enqueue")Signed-off-by Wenwu Ma <[email protected]>--- lib/vhost/virtio_net.c | 6 ++++++ 1 file changed, 6 insertions(+)lib/vhost/virtio_net.c index renamed from lib/vhost/virtio_net.c +0
-0
cf796183a0..61d9052a57100644lib/vhost/virtio_net.c +6
-1@@ -1493,6 +1493,12 @@ virtio_dev_rx_batch_packed_copy(structvirtio_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); --
Quoted 1 line
2.25.1
Thanks,
Cheng
Quoted 20 lines · 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 themrg_rxbuffeature is turned on, This patch fix the issue.Fixes ef861692c398 ("vhost: add packed ring batch enqueue")Signed-off-by Wenwu Ma <[email protected]>--- lib/vhost/virtio_net.c | 6 ++++++ 1 file changed, 6 insertions(+)lib/vhost/virtio_net.c +0
-0@@ -1493,6 +1493,12 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev,sizeof (struct virtio_net_hdr_mrg_rxbuf ); }
lib/vhost/virtio_net.c virtio_dev_rx_batch_packed_copy(struct virtio_net *dev, · line 1504
Quoted 10 lines
lib/vhost/virtio_net.c +6
-0+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);
Thanks,
Maxime
Maxime Coquelin
AppliedQuoted 20 lines · 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 themrg_rxbuffeature is turned on, This patch fix the issue.Fixes ef861692c398 ("vhost: add packed ring batch enqueue")Signed-off-by Wenwu Ma <[email protected]>--- lib/vhost/virtio_net.c | 6 ++++++ 1 file changed, 6 insertions(+)lib/vhost/virtio_net.c +0
-0@@ -1493,6 +1493,12 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev,sizeof (struct virtio_net_hdr_mrg_rxbuf ); }
lib/vhost/virtio_net.c virtio_dev_rx_batch_packed_copy(struct virtio_net *dev, · line 1504
Quoted 10 lines
lib/vhost/virtio_net.c +6
-0+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