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 B3A4AA32A2 for ; Thu, 24 Oct 2019 18:31:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8E5421EB88; Thu, 24 Oct 2019 18:31:26 +0200 (CEST) Received: from sysclose.org (smtp.sysclose.org [69.164.214.230]) by dpdk.org (Postfix) with ESMTP id 06B8A1EB5E; Thu, 24 Oct 2019 18:31:22 +0200 (CEST) Received: by sysclose.org (Postfix, from userid 5001) id 5F9752CEB; Thu, 24 Oct 2019 16:31:21 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 sysclose.org 5F9752CEB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysclose.org; s=201903; t=1571934681; bh=73FOVhEErCxbrcF0djvRO3vteYP+3+qiavkSuQoLdOQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HLtzVCcoZKzSSuf44Hs6l4Hg4QRK1TXI51suInuXOrKMWy6XjSNpvyu3gKZ3e6o/N 0Gx+j8JNN+c57ZAJC/E4Fwf56vc9mMWQJmEx/lIpYHL6+HgNKBrdvqEshDeSgrMStz /+UgFVMDbxLEol6c4upDjaYgwO/p2hsHQBPKxG9kwnkzuFpMxYGzXbLAjveYmgrx7/ +bSp44KH+nNLYc73OLAYa+I6H3yJmrtTaJCQ0ExF+yzbCrS2p3BiL+Q6N8Cfnklu3X axIHqTzwK6aH0H+eoKu/UfY+V8Z2fApAZK83y/pr/jge+m9Z9V3iMEqwIes2lxZx2p YAjO8XZnf4w4g== X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.sysclose.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from p50.lan (unknown [177.183.215.210]) by sysclose.org (Postfix) with ESMTPSA id BBBBE2C6C; Thu, 24 Oct 2019 16:31:19 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 sysclose.org BBBBE2C6C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysclose.org; s=201903; t=1571934680; bh=73FOVhEErCxbrcF0djvRO3vteYP+3+qiavkSuQoLdOQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GxnkPguRuR8fjzmf7ugi9vJiNSNm9x0D+HOFOlM57A3sRLl9UyfYUKnKFdLBl123X /ej1DUheRBA2tK5SUzGmiLpwM4bHJQTX7JLEqi2zlzdU2oLYW9fB+erOHawNqL0F8/ ax8q39AyK9HKJNV9rfHh9GRd+MXDvWoqLN9w2rOjjkfrif/cfkm1rt3elir6EmrCv0 TvAI3JujQaK8kVWkGNAMGM4rNAXRZ2wH93kJ5hawzKafAQDtxE0lODTYXEKYHO5tDI R5+VfuUyQPWzZ9I0zrYv/c9XegvkRGrVHu3wrXLxQdFBdFPoronmOU45opXohRyvp4 7i3Q/jUvmYwRg== Date: Thu, 24 Oct 2019 13:31:15 -0300 From: Flavio Leitner To: Maxime Coquelin Cc: dev@dpdk.org, Tiwei Bie , Obrembski MichalX , "stable@dpdk.org" Message-ID: <20191024133115.183bd394@p50.lan> In-Reply-To: <4dca815a-f0dc-db2d-638d-6e5be43fc8bc@redhat.com> References: <20191024142814.10979-1-fbl@sysclose.org> <4dca815a-f0dc-db2d-638d-6e5be43fc8bc@redhat.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [PATCH] vhost: fix IPv4 csum calculation 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" On Thu, 24 Oct 2019 16:32:43 +0200 Maxime Coquelin wrote: > Hi Flavio, > > On 10/24/19 4:28 PM, Flavio Leitner wrote: > > 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. > > I think we need Fixes tag: > > Fixes: b08b8cfeb2ae ("vhost: fix IP checksum") > Cc: stable@dpdk.org > > Also adding stable in Cc. > > > > Signed-off-by: Flavio Leitner > > --- > > 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 eae7825f04..cde7498c76 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) > > ipv4_hdr = rte_pktmbuf_mtod_offset(m_buf, struct > > rte_ipv4_hdr *, m_buf->l2_len); > > + ipv4_hdr->hdr_checksum = 0; > > ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr); > > } > > > > > > Other than that: > > Reviewed-by: Maxime Coquelin > > I'll add the Fixes tag while applying. Not sure if you will send to stable, so I did v2 just in case. Feel free to drop either one if you took care of those items already. Thanks! fbl