From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 68E11A04F3 for ; Thu, 19 Dec 2019 15:38:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5EEC71BF7B; Thu, 19 Dec 2019 15:38:37 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id A97811BFB7 for ; Thu, 19 Dec 2019 15:38:36 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id y11so6218448wrt.6 for ; Thu, 19 Dec 2019 06:38:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IUBe+m+M3f6nCUU+vFenlB2Ap1Ly41/a1M0RuTbhp2A=; b=RbsOgb/MLqrIOmdWvHF6QWvcSvv+DaUkP6irou1EN6v718Mp0muviWI/bO1MezpFA9 T5vGFvJqvdWcC+JN2Iz+GNMdSYAjqyMaIRA3/r3dgXUNPM6t0Dpl7aet30tckRGZciFn Of0oligYOa48xmucvDO8r7azK13CfUDP75oz7n3lL5y5heCpNRE2kQN206Esw06/WU+y dUjnMqnSoEet+KELKElVgYGdYx9sQw1tVEDHn6LPsGkW620Udqrh8jp+KxSAivOII2cX gqDS8H6rLKyVI8hsiVjtcJoPW53YDOBaJdifT3H+lR9EfLm5Boz54kEpHRckAelH7lR7 Z6ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IUBe+m+M3f6nCUU+vFenlB2Ap1Ly41/a1M0RuTbhp2A=; b=PI36hwydySEKkOTjXwqpmcSmz+nQr65AYTP4lSyFbSfupC63YaaRrzNen84YtNwK/S 8LyAQqtTcXe4df819OV9VMO+svFZ8ZnqGTMqMa6P0JNBY0f8WRm3NztANQc/teILKox3 MUckZORFz8jTdsUwJ5wv8+A2SEbRensxw0lBxHVUxD1KYd2jzJ1uk15ULOVDfONvy2qB DcKEd7lRCllKdgdqe4YE/JJrF5xnMySnLh3+iSemsOui46G2FmApFaQE7eNw4Uz/qR1w FYfVwn87Tc+A7K3WiiATW9DidbkB//xfi2PUABTcPGYdAYlacZdeYXy9KK+YRIA2uwxh rFrQ== X-Gm-Message-State: APjAAAUlVINUffYsmDLHHjQQxvwFKyhU8k81MklsQtJXzOPRcwKF1sRr sVFnKqv74X7HpLEAG1SCN5g= X-Google-Smtp-Source: APXvYqxjBwSSEeXIOCWW1d87yBh4aBrybCrIrhUx0c+VQ4yaa8VcAKt5+ROZSseeSODASIYJ7STrBw== X-Received: by 2002:adf:f789:: with SMTP id q9mr10052945wrp.103.1576766316398; Thu, 19 Dec 2019 06:38:36 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id z83sm6600847wmg.2.2019.12.19.06.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:38:35 -0800 (PST) From: luca.boccassi@gmail.com To: Flavio Leitner Cc: Maxime Coquelin , dpdk stable Date: Thu, 19 Dec 2019 14:33:53 +0000 Message-Id: <20191219143447.21506-86-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: fix IPv4 checksum' has been queued to LTS release 17.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 17.11.10 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/21/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. Thanks. Luca Boccassi --- >From 42c20078cdbbbe86e4d4735f6d60b1109e1d8da0 Mon Sep 17 00:00:00 2001 From: Flavio Leitner 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 Reviewed-by: Maxime Coquelin --- 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 de8e4c57e4..b302c384d4 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -221,6 +221,7 @@ 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.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:29.781624575 +0000 +++ 0086-vhost-fix-IPv4-checksum.patch 2019-12-19 14:32:26.205299809 +0000 @@ -1,8 +1,10 @@ -From 84c39beb2fdbef86b917a18ade8d2e2baa3de732 Mon Sep 17 00:00:00 2001 +From 42c20078cdbbbe86e4d4735f6d60b1109e1d8da0 Mon Sep 17 00:00:00 2001 From: Flavio Leitner 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 @@ -19,7 +21,6 @@ Thus force the csum field to always be zero. Fixes: b08b8cfeb2ae ("vhost: fix IP checksum") -Cc: stable@dpdk.org Signed-off-by: Flavio Leitner Reviewed-by: Maxime Coquelin @@ -28,12 +29,12 @@ 1 file changed, 1 insertion(+) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c -index eae7825f04..cde7498c76 100644 +index de8e4c57e4..b302c384d4 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c -@@ -445,6 +445,7 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr) +@@ -221,6 +221,7 @@ 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 *, + 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);