From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 9CE48A0547;
	Mon, 18 Oct 2021 05:00:09 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 0BC9E40DDE;
	Mon, 18 Oct 2021 05:00:09 +0200 (CEST)
Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com
 [209.85.215.182])
 by mails.dpdk.org (Postfix) with ESMTP id BA09840041
 for <dev@dpdk.org>; Mon, 18 Oct 2021 05:00:07 +0200 (CEST)
Received: by mail-pg1-f182.google.com with SMTP id c4so7507080pgv.11
 for <dev@dpdk.org>; Sun, 17 Oct 2021 20:00:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20210112.gappssmtp.com; s=20210112;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=5RJATqAl+nXW7D6hWSLIoooznxVGZpgOYJleAZsAZnk=;
 b=z8Pv8EwVBm+5pAqvQNT5RG5i9U9LDxbn8EsXe8Tl0zLWOe9Equva5ygwZv+27HeGqa
 dwX4eh6vVfPmLy6AATRCER75RFtp+8MV9IjDy03RyM78TVcIu1IE4NrfUT0Mh8YtjfXF
 meegiKKme4T3p9Y9+yJY3zK5Wvyoivo+8aj25+PytwpDJ+QVYc0Nh7FYTP5T/LaNvK4t
 BXYL3v+2kD3ZSWydStVsmDMJNMtMdmMhF1QKKq8h3ds8oV3oUZvf2xzNEzZf/nXv58q0
 SM3QSTkBDDdrp/yfuxeQ1kGqWh6TeoihJW7ewo1oOt25Kqsu5lf20vfu8dRaxvinkGy0
 ATXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=5RJATqAl+nXW7D6hWSLIoooznxVGZpgOYJleAZsAZnk=;
 b=Wk9ZqMEMn93udf+Wk2I5EyM/OS6az+RUFEq+CTlFyh6iahFgBx/02dR9sP8Lox+sdU
 4+sF22JJv0ERvrmF0w2sOVV6IScuHbPk8uNpvx8hooxvqK+Aq3ykG7WoyzudkP36zj3d
 jq16jtLO8UYEVtFJGWSkGTFTbCe/0fxlWhxC5iazHfPEyKkL96GIyka9PNeqsvTzB387
 KneuQccQIWOSaVviZ/SbU0lhuk83RSVHTGg5J6mkHrwLaGfzjdnjLKMA+2ho1ML3f2uE
 fHZSo8SC4/Gm3uqpDqzKYoFspSkcaCTk+tnyVipuITivgVWpu0J+eu+YkHmj5lDvfwxt
 gN3w==
X-Gm-Message-State: AOAM531DZ1+sP5aXkVfs1bhMXrFMMGD+P5rMDbnHkA/zIvIJWfT/iLu3
 Th6I3CFsDVkegqQjsSbHlkxbOiK/9YBOIg==
X-Google-Smtp-Source: ABdhPJzzzQMeQVUgWrzi6ueCiNTHcSOlcf0ltb2xy1dibGiaLUhjJe52ypNeRkzed1ly1oMkQIS13w==
X-Received: by 2002:a63:af07:: with SMTP id w7mr21240123pge.202.1634526006900; 
 Sun, 17 Oct 2021 20:00:06 -0700 (PDT)
Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123])
 by smtp.gmail.com with ESMTPSA id x40sm838506pfh.83.2021.10.17.20.00.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 17 Oct 2021 20:00:06 -0700 (PDT)
Date: Sun, 17 Oct 2021 20:00:03 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: Xiaoyun Li <xiaoyun.li@intel.com>
Cc: ferruh.yigit@intel.com, dev@dpdk.org, stable@dpdk.org
Message-ID: <20211017200003.2bfbcf8c@hermes.local>
In-Reply-To: <20211015051306.320328-1-xiaoyun.li@intel.com>
References: <20211015051306.320328-1-xiaoyun.li@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix l4 sw csum over multi
 segments
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Fri, 15 Oct 2021 13:13:06 +0800
Xiaoyun Li <xiaoyun.li@intel.com> wrote:

> +		/* When sw csum is needed, multi-segs needs a buf to contain
> +		 * the whole packet for later UDP/TCP csum calculation.
> +		 */
> +		if (m->nb_segs > 1 && !(tx_ol_flags & PKT_TX_TCP_SEG) &&
> +		    !(tx_offloads & UDP_TCP_CSUM)) {
> +			l3_buf = rte_zmalloc("csum l3_buf",
> +					     info.pkt_len - info.l2_len,
> +					     RTE_CACHE_LINE_SIZE);
> +			rte_pktmbuf_read(m, info.l2_len,
> +					 info.pkt_len - info.l2_len, l3_buf);
> +			l3_hdr = l3_buf;
> +		} else
> +			l3_hdr = (char *)eth_hdr + info.l2_len;
>  

Rather than copying whole packet, make the code handle checksum streaming.