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 81515A0C3F for ; Wed, 30 Jun 2021 16:09:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6DDD141273; Wed, 30 Jun 2021 16:09:56 +0200 (CEST) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mails.dpdk.org (Postfix) with ESMTP id B827740040 for ; Wed, 30 Jun 2021 16:09:54 +0200 (CEST) Received: by mail-wm1-f45.google.com with SMTP id r3so2194990wmq.1 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=itkLrGhIV+8HtYuEGHCAT2EkP26pJEWUkqlWaKiRNwxDd7U795Nc0d8kNo/v8ZCcx2 Cuq8F5Gz8InmCc0MHDgtDL8SuSTOnfTRJA4kWgUAMM52Wq59IvBNEF9LPBN/N3rYNSfE YSpNz1H0H9A77CoBhasD+YsC0Zj9M81HuYldCONDgVjPi8nP9T6ZuPx0fFt+Hry+518B /BAkXXrIB82LLHxfM+MZ/XQb8AOmwdqvVOr8UTyfmaDlpSoUlrQDU0QERKMK4oNAwMxn ocSo8fAoL7g0eM2sGILXgsI1l8H29zXuRT6rELbAS21WUI/yXahqrUEyHXIVNMBqhHaR k9AA== X-Gm-Message-State: AOAM531ZBU0B+Oha1FHigZthJpgRFpuog3RYnOD/Gm5dyTlkffu5Sx1Y wvrJmlj55gJffG/xvp/4iCfO8w== 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-stable] [PATCH v2] net: prepare the outer ipv4 hdr for checksum X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 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 >