DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: fix broken transmit functionality
@ 2019-10-15  8:11 Andrew Rybchenko
  2019-10-16  4:17 ` Tiwei Bie
  2019-10-16 11:12 ` Maxime Coquelin
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Rybchenko @ 2019-10-15  8:11 UTC (permalink / raw)
  To: Maxime Coquelin, Tiwei Bie, Zhihong Wang; +Cc: dev, stable

Previous fix removes usage of rte_pktmbuf_prepend() to get pointer
to virtio net header which changes mbuf data_off and data_len.
Size of virtio net header is added to segment length when Tx descriptor
is composed, but segment address (calculated using data_off) is not
adjusted to take size of virtio net header into account.

Fixes: c100fc6849fb ("net/virtio: fix mbuf data and pkt length mismatch")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/virtio/virtio_rxtx.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 929aa4cbd..434e0fedd 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -649,7 +649,8 @@ virtqueue_enqueue_xmit_inorder(struct virtnet_tx *txvq,
 		else
 			virtqueue_xmit_offload(hdr, cookies[i], true);
 
-		start_dp[idx].addr  = VIRTIO_MBUF_DATA_DMA_ADDR(cookies[i], vq);
+		start_dp[idx].addr  =
+			VIRTIO_MBUF_DATA_DMA_ADDR(cookies[i], vq) - head_size;
 		start_dp[idx].len   = cookies[i]->data_len + head_size;
 		start_dp[idx].flags = 0;
 
@@ -696,7 +697,7 @@ virtqueue_enqueue_xmit_packed_fast(struct virtnet_tx *txvq,
 	else
 		virtqueue_xmit_offload(hdr, cookie, true);
 
-	dp->addr = VIRTIO_MBUF_DATA_DMA_ADDR(cookie, vq);
+	dp->addr = VIRTIO_MBUF_DATA_DMA_ADDR(cookie, vq) - head_size;
 	dp->len  = cookie->data_len + head_size;
 	dp->id   = id;
 
@@ -779,6 +780,7 @@ virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 		start_dp[idx].addr = VIRTIO_MBUF_DATA_DMA_ADDR(cookie, vq);
 		start_dp[idx].len  = cookie->data_len;
 		if (prepend_header) {
+			start_dp[idx].addr -= head_size;
 			start_dp[idx].len += head_size;
 			prepend_header = false;
 		}
@@ -882,6 +884,7 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 		start_dp[idx].addr  = VIRTIO_MBUF_DATA_DMA_ADDR(cookie, vq);
 		start_dp[idx].len   = cookie->data_len;
 		if (prepend_header) {
+			start_dp[idx].addr -= head_size;
 			start_dp[idx].len += head_size;
 			prepend_header = false;
 		}
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH] net/virtio: fix broken transmit functionality
  2019-10-15  8:11 [dpdk-dev] [PATCH] net/virtio: fix broken transmit functionality Andrew Rybchenko
@ 2019-10-16  4:17 ` Tiwei Bie
  2019-10-16 11:12 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Tiwei Bie @ 2019-10-16  4:17 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: Maxime Coquelin, Zhihong Wang, dev, stable

On Tue, Oct 15, 2019 at 09:11:27AM +0100, Andrew Rybchenko wrote:
> Previous fix removes usage of rte_pktmbuf_prepend() to get pointer
> to virtio net header which changes mbuf data_off and data_len.
> Size of virtio net header is added to segment length when Tx descriptor
> is composed, but segment address (calculated using data_off) is not
> adjusted to take size of virtio net header into account.
> 
> Fixes: c100fc6849fb ("net/virtio: fix mbuf data and pkt length mismatch")

The commit in main branch is:
Fixes: 1ae55ad38e5e ("net/virtio: fix mbuf data and packet length mismatch")

For the rest,
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>

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

* Re: [dpdk-dev] [PATCH] net/virtio: fix broken transmit functionality
  2019-10-15  8:11 [dpdk-dev] [PATCH] net/virtio: fix broken transmit functionality Andrew Rybchenko
  2019-10-16  4:17 ` Tiwei Bie
@ 2019-10-16 11:12 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2019-10-16 11:12 UTC (permalink / raw)
  To: Andrew Rybchenko, Tiwei Bie, Zhihong Wang; +Cc: dev, stable



On 10/15/19 10:11 AM, Andrew Rybchenko wrote:
> Previous fix removes usage of rte_pktmbuf_prepend() to get pointer
> to virtio net header which changes mbuf data_off and data_len.
> Size of virtio net header is added to segment length when Tx descriptor
> is composed, but segment address (calculated using data_off) is not
> adjusted to take size of virtio net header into account.
> 
> Fixes: c100fc6849fb ("net/virtio: fix mbuf data and pkt length mismatch")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
>  drivers/net/virtio/virtio_rxtx.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
Applied to dpdk-next-virtio/master.

Thanks,
Maxime

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

end of thread, other threads:[~2019-10-16 11:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15  8:11 [dpdk-dev] [PATCH] net/virtio: fix broken transmit functionality Andrew Rybchenko
2019-10-16  4:17 ` Tiwei Bie
2019-10-16 11:12 ` 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).