From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Flavio Leitner <fbl@sysclose.org>, dev@dpdk.org
Cc: Tiwei Bie <tiwei.bie@intel.com>,
Obrembski MichalX <michalx.obrembski@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] vhost: fix IPv4 csum calculation
Date: Thu, 24 Oct 2019 16:32:43 +0200 [thread overview]
Message-ID: <4dca815a-f0dc-db2d-638d-6e5be43fc8bc@redhat.com> (raw)
In-Reply-To: <20191024142814.10979-1-fbl@sysclose.org>
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 <fbl@sysclose.org>
> ---
> 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 <maxime.coquelin@redhat.com>
I'll add the Fixes tag while applying.
Thanks!
Maxime
next parent reply other threads:[~2019-10-24 14:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191024142814.10979-1-fbl@sysclose.org>
2019-10-24 14:32 ` Maxime Coquelin [this message]
2019-10-24 16:31 ` Flavio Leitner
2019-10-24 16:32 ` Maxime Coquelin
2019-10-24 16:29 ` [dpdk-stable] [PATCH v2] " Flavio Leitner
2019-10-24 17:40 ` Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4dca815a-f0dc-db2d-638d-6e5be43fc8bc@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=dev@dpdk.org \
--cc=fbl@sysclose.org \
--cc=michalx.obrembski@intel.com \
--cc=stable@dpdk.org \
--cc=tiwei.bie@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).