[dpdk-stable] patch 'vhost: fix IPv4 checksum' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Tue Dec 10 15:59:05 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/16/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/63e3d795a7688b7d6803a75ca675012bca930f9d

Thanks.

Kevin.

---
>From 63e3d795a7688b7d6803a75ca675012bca930f9d Mon Sep 17 00:00:00 2001
From: Flavio Leitner <fbl at sysclose.org>
Date: Thu, 24 Oct 2019 13:29:19 -0300
Subject: [PATCH] vhost: fix IPv4 checksum

[ upstream commit 84c39beb2fdbef86b917a18ade8d2e2baa3de732 ]

Currently the IPv4 header checksum is calculated including its
current value, which can be a valid checksum or just garbage.
In any case, if the original value is not zero, then the result
is always wrong.

The IPv4 checksum is defined in RFC791, page 14 says:
  Header Checksum:  16 bits

  The checksum algorithm is:
  The checksum field is the 16 bit one's complement of the one's
  complement sum of all 16 bit words in the header.  For purposes of
  computing the checksum, the value of the checksum field is zero.

Thus force the csum field to always be zero.

Fixes: b08b8cfeb2ae ("vhost: fix IP checksum")

Signed-off-by: Flavio Leitner <fbl at sysclose.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_vhost/virtio_net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index a6576891a..740db2ed7 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -269,4 +269,5 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)
 		ipv4_hdr = rte_pktmbuf_mtod_offset(m_buf, struct ipv4_hdr *,
 						   m_buf->l2_len);
+		ipv4_hdr->hdr_checksum = 0;
 		ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr);
 	}
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-10 14:49:41.209899453 +0000
+++ 0031-vhost-fix-IPv4-checksum.patch	2019-12-10 14:49:39.046457879 +0000
@@ -1 +1 @@
-From 84c39beb2fdbef86b917a18ade8d2e2baa3de732 Mon Sep 17 00:00:00 2001
+From 63e3d795a7688b7d6803a75ca675012bca930f9d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 84c39beb2fdbef86b917a18ade8d2e2baa3de732 ]
+
@@ -22 +23,0 @@
-Cc: stable at dpdk.org
@@ -31 +32 @@
-index eae7825f0..cde7498c7 100644
+index a6576891a..740db2ed7 100644
@@ -34,2 +35,2 @@
-@@ -446,4 +446,5 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)
- 		ipv4_hdr = rte_pktmbuf_mtod_offset(m_buf, struct rte_ipv4_hdr *,
+@@ -269,4 +269,5 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)
+ 		ipv4_hdr = rte_pktmbuf_mtod_offset(m_buf, struct ipv4_hdr *,



More information about the stable mailing list