From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0299CA0C4A; Wed, 7 Jul 2021 11:14:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81826406FF; Wed, 7 Jul 2021 11:14:38 +0200 (CEST) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mails.dpdk.org (Postfix) with ESMTP id DFA10406B4; Wed, 7 Jul 2021 11:14:36 +0200 (CEST) Received: by mail-wm1-f47.google.com with SMTP id n33so1352427wms.1; Wed, 07 Jul 2021 02:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7o/p62y6rba/4OVBy4xLRGgYtGMYKDzBT5JXdnBNR5I=; b=F15l17vQR6aqHK8XYm+F66abUyCYnSmhvwwaTWs1RA42F8aHg1OG1GJiRog/LlHjj0 p0TtuuvlZPUlEIG+TFGOZyKCogQjIpQGIPlgyYdKlWZaoq4bAm0z6kpC9uQ4TBRSmqEB N8roBcYDfjttygZiFuLxHeCvu26vkhZblyhaAb6UvSdnDr1itmPvfTRMuodNDzz2jTYr qjxIwxvjm7ZZ9SZQ4w4Ktue6LzqGtGP0mPZ5+OCek84u3S2FaN1X30XP5A5Z2HEBjXto TPtRMFEIpCSHRnpMa/kncLl/GkBJjLTb/wBnrqYE2olKTaMiS8JIfT3Bx9pAAkoo2j0m 7e/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7o/p62y6rba/4OVBy4xLRGgYtGMYKDzBT5JXdnBNR5I=; b=dHLvbv0zYysm/yU39iWvsKtjCnobiF5YYTLf/Hek3LnuATRyjl3KenHxiXeilTv2lA ufghV/6Yo4oNCzGlGZB3r8lkM6nXGuJJV61t1KNWNMUb8m2JN22stDEGJpczozSphjCA mgEvn/qkSpbdbxKsQesNQOu5MYs2eSRTXd3LeFL/5ezlgvVjLqlkWCXwxtWU0euK9BP2 6oGf1V//ImSPGdonD8BiKXXyuLxfAzkMNxXQ26SGv2nCSAaQFwBdJSXciGo8Dsqq27Jz zXD76CvGIUlKyRNypcZIGZusRLZu4xfOL7Ulg9fuoZHPmBVyo12QS+enzG7+EFrvrGT/ 4YQw== X-Gm-Message-State: AOAM532/MGxCASRzKEWfUkxWI8g90a/j/MQ40X7N12IOS8vlaMpCuEle pyc6vY5p3MI2tm4dGCkSKUKAFufHhbuasDr+KGc= X-Google-Smtp-Source: ABdhPJw98aqYuqzZIrQ3hc15LZqEAeUfJSP+SkYlZUwzcr4+pgeu+ddj7L9kRSt3FXrlPaBcoiJ8CNwwKmBaGkjOSpg= X-Received: by 2002:a7b:c451:: with SMTP id l17mr24795360wmi.20.1625649276606; Wed, 07 Jul 2021 02:14:36 -0700 (PDT) MIME-Version: 1.0 References: <20210630110404.21209-1-mohsin.kazmi14@gmail.com> In-Reply-To: From: Mohsin Kazmi Date: Wed, 7 Jul 2021 10:14:25 +0100 Message-ID: To: Olivier Matz Cc: dev@dpdk.org, ray.kinsella@intel.com, stable@dpdk.org, Tomasz Kulasek , Konstantin Ananyev , Thomas Monjalon Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH v2] net: prepare the outer ipv4 hdr for checksum X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Olivier, Thanks for the review. Please find the comments inline below: On Wed, Jun 30, 2021 at 3:09 PM Olivier Matz wrote: > Hi Mohsin, > > Hope you are fine! > Please see my comments below. > > On Wed, Jun 30, 2021 at 01:04:04PM +0200, Mohsin Kazmi wrote: > > Re: [PATCH v2] net: prepare the outer ipv4 hdr for checksum > > I suggest to highlight that it this is the Intel-specific tx-prepare > function in the commit title. What about: > net: fix Intel-specific Tx preparation for outer checksums > > I'll update the commit title as suggested. > Preparation the headers for the hardware offload > > misses the outer ipv4 checksum offload. > > It results in bad checksum computed by hardware NIC. > > > > This patch fixes the issue by setting the outer ipv4 > > checksum field to 0. > > > > Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") > > Cc: stable@dpdk.org > > > > Signed-off-by: Mohsin Kazmi > > Acked-by: Qi Zhang > > --- > > > > v2: > > * Update the commit message with Fixes. > > --- > > lib/net/rte_net.h | 12 +++++++++++- > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > diff --git a/lib/net/rte_net.h b/lib/net/rte_net.h > > index 434435ffa2..e47365099e 100644 > > --- a/lib/net/rte_net.h > > +++ b/lib/net/rte_net.h > > @@ -128,8 +128,18 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf > *m, uint64_t ol_flags) > > if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | > PKT_TX_TCP_SEG))) > > return 0; > > I think this test should be updated too with PKT_TX_OUTER_IP_CKSUM. > Thanks. Yes, I'll update it too. > > > > > - if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6)) > > + if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6)) { > > inner_l3_offset += m->outer_l2_len + m->outer_l3_len; > > + /* > > + * prepare outer ipv4 header checksum by setting it to 0, > > + * in order to be computed by hardware NICs. > > + */ > > + if (ol_flags & PKT_TX_OUTER_IP_CKSUM) { > > + ipv4_hdr = rte_pktmbuf_mtod_offset(m, > > + struct rte_ipv4_hdr *, > m->outer_l2_len); > > + ipv4_hdr->hdr_checksum = 0; > > + } > > + } > > What about outer L4 checksum? Does it requires the same than inner? > I am using XL710 for my testing with i40e dpdk driver. AFAIK, It doesn't support outer l4 checksum. I am not sure if other Intel NICs support it. > > > > /* > > * Check if headers are fragmented. > > -- > > 2.17.1 > > >