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 9AA7BA052B; Tue, 28 Jul 2020 11:29:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1C8AD1BFF4; Tue, 28 Jul 2020 11:29:10 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id CEDE41BFF3 for ; Tue, 28 Jul 2020 11:29:08 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id r2so12492333wrs.8 for ; Tue, 28 Jul 2020 02:29:08 -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:user-agent; bh=X8ITc5QxkwTWc8dfzI0lsuB3WQAnRy8imJONsy/WTII=; b=hfk7Zo0bzywUjsuIrwLgB/a7UtpRaQ80gyLaivuIHFf2Cvdb2FIWGXHn00FXHhITqh yD6oGrZpoiLb3C4Waymsxambf4khE5DhTrT4a6jxh+30CpJCX/DEesBchsvuuQYjsMkv CyG0d2i2hk9efJasoKfC7860tUe7ANkSfHr3X1cCaVD9U5Vi2mvd8V7gZqd2feHeUsim mrbqR2VBD8g/PvMwC6NB5jy1VkEzxuvFVTKqPukZfl+XsVBG9AXCMiV8dhluGd/M5yXE 2h+30tQyo0QCimmgIYPDSkg0cR3S00SRZ7qN8qm6XyEJvufi/yXBJmRQPoPo0M5oHWYK gGDw== 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:user-agent; bh=X8ITc5QxkwTWc8dfzI0lsuB3WQAnRy8imJONsy/WTII=; b=gWGagJi2ZPqO5VesUUKsykIQWOUQtjcauipnjo2fKybjGT2K0vejCvMHY1M58lVuHO GaXIsT2fMRLtya/hzfoittSEIjnhEiFwQAgWMTmfXUfDo1VxiZfBX+CRuGvCdwk8wD9X +HWACbYcotYz/ZtOMWpxSIf6/ADPfhgj1+GpYVEj3/bZNjA7Wil5gCzrG+szXEoWa1H6 THzlWHoHAq8due09F0zSDvugUCXER/FefbuoBS9HoGefxi1zlSZc6UoVBKjY67P9AZNQ O26gBzb15hM+rToF3y6eQQd883lpWFFWMY5Xbls+wA8evyVSwLGNoDDeuM2TkHL/zTJK MqPw== X-Gm-Message-State: AOAM532kA4NgSRzM+p8P1FGleFTf5PwAhv/ymR8jO0zd0DXK5L53fJQa ODV9R4Vn3+LBBpp3CSvVBZXJ5g== X-Google-Smtp-Source: ABdhPJyrRmyj7yMN/13FlBtrS/YPeQPILTDJXtB2+B6twSDQZiJks9gxqp+Wq62UFIY8kRR4nEm69g== X-Received: by 2002:adf:ef4c:: with SMTP id c12mr22732375wrp.44.1595928548416; Tue, 28 Jul 2020 02:29:08 -0700 (PDT) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id r16sm16603835wrr.13.2020.07.28.02.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 02:29:07 -0700 (PDT) Date: Tue, 28 Jul 2020 11:29:07 +0200 From: Olivier Matz To: Yuying Zhang Cc: dev@dpdk.org, qi.z.zhang@intel.com, qiming.yang@intel.com, Ferruh Yigit , arybchenko@solarflare.com Message-ID: <20200728092907.GT5869@platinum> References: <20200728085531.204296-1-yuying.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200728085531.204296-1-yuying.zhang@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH v1] net: fix TSO packet checksum incorrect X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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, On Tue, Jul 28, 2020 at 08:55:31AM +0000, Yuying Zhang wrote: > The ol_flags check lacks of PKT_TX_IPV6 which causes checksum > flag configuration error while IPv6/TCP TSO packet is sent. > This patch fixes the issue using PKT_TX_OFFLOAD_MASK. > > Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well") > > Signed-off-by: Yuying Zhang > --- > lib/librte_net/rte_net.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h > index 1edc283a4..4b617ab4c 100644 > --- a/lib/librte_net/rte_net.h > +++ b/lib/librte_net/rte_net.h > @@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) > * Mainly it is required to avoid fragmented headers check if > * no offloads are requested. > */ > - if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK))) > + if (!(ol_flags & PKT_TX_OFFLOAD_MASK)) > return 0; > > if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6)) > -- > 2.25.1 > I think the PKT_TX_TCP_SEG flag is missing in the test above, it should be like this: if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG))) It would be more precise than having the whole list of offload flags. The reason is because in case of TSOv4, there is always the flag PKT_TX_IP_CKSUM, so this test is always wrong and we continue in the function. In case of TSOv6, there is neither PKT_TX_IP_CKSUM nor PKT_TX_L4_TCP (which is not mandatory, the doc says that PKT_TX_TCP_SEG implies PKT_TX_L4_TCP). Thanks for spotting this. Can you please submit a v2 with PKT_TX_TCP_SEG? Olivier