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 0BFF6A0A0F; Wed, 30 Jun 2021 16:09:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C15740141; Wed, 30 Jun 2021 16:09:55 +0200 (CEST) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id B90FC40141 for ; Wed, 30 Jun 2021 16:09:54 +0200 (CEST) Received: by mail-wm1-f54.google.com with SMTP id w13so2169007wmc.3 for ; Wed, 30 Jun 2021 07:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=T3+47ydzFNFc9nXK5//RllWhabPfiA43lNA9cYfZpjY=; b=ipmEEs9Tvdf/SsUX/3R5PzCOmWFbAt2JPr4CvSAbmNJFmpBWHBnnjlUv2UK1SxQD9s Q7LXGGbE7wwpYRLooKLZhTHMwRpuJq+jm9CUCRwj8E6Ajf4vEXe/InGX/LFYfQkoEc2s BXu/UBiRO/RgjT6yKUTZRDsd07czW2tQRhl4HK3EhiVfq0KJZ2qPOdMnCGqQwSGoT9hw THCOREPMs9gykGkjEsMDcq5TfqHN1Yv8LCdH2VPRewRfRiYhFV3dXbBp6J6Ao8JaG/9K T9LfnUDcVk6ky2BnxXKhA+cr6qZ4/z1EqhjBv+Bqpsbmh6MLiBeShxSofpJvl6PzeDQk uoKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=T3+47ydzFNFc9nXK5//RllWhabPfiA43lNA9cYfZpjY=; b=WeG6mM12OKo3bJT3DCZeusadc+02FgDVHuJtQWb6a6jysczKY+K6NQdpKYJPF/JkwV PF0a34POoiCv1usn4l/pIQ3t3DncVhFGIdsMD7sXwTCT85xLLlM88sDIj9iARqW/ujPJ cWZv6QNn/mjs2pH5tkRJ5scV79iB8Wfu7uWouGrWIQY6I9DLM4DUFv868UPpKDA9Pfjv 2RApU2zRPpy8ggxPBxnjg5nvIBHpt8lGF9LUsP2kLRU1Yg3GEsFg6Pra8ak5e7zhdUGI l0UKVxk3nkua3wIkcqHxXlrZ5DOo2oLACDoEkeBqygrGwTrKQo27RQTMC+DQM3Xuh/X2 o8VQ== X-Gm-Message-State: AOAM53044M4vYWMTwnYYe+gDdV5hI1gJpuFgGwbyiWlTaZujWQI215hM lvN2l7B4AipSDKYLXj2xy41rrg== X-Google-Smtp-Source: ABdhPJyZf8ooQLUiEgjYyCQKLlWXBl3N6+9J2Zx6au5i+HbqOGAV6txaNbUwMFmZqw/klLc8qJjv5A== X-Received: by 2002:a1c:19c1:: with SMTP id 184mr38393839wmz.92.1625062194385; Wed, 30 Jun 2021 07:09:54 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id d186sm7495230wmd.14.2021.06.30.07.09.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 07:09:53 -0700 (PDT) Date: Wed, 30 Jun 2021 16:09:53 +0200 From: Olivier Matz To: Mohsin Kazmi Cc: dev@dpdk.org, ray.kinsella@intel.com, stable@dpdk.org, Tomasz Kulasek , Konstantin Ananyev , Thomas Monjalon Message-ID: References: <20210630110404.21209-1-mohsin.kazmi14@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210630110404.21209-1-mohsin.kazmi14@gmail.com> 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 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 > 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. > > - 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? > > /* > * Check if headers are fragmented. > -- > 2.17.1 >