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 BB1B6A0C41; Mon, 2 Aug 2021 20:05:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5465D41147; Mon, 2 Aug 2021 20:05:06 +0200 (CEST) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by mails.dpdk.org (Postfix) with ESMTP id 52E3E40140 for ; Mon, 2 Aug 2021 20:05:04 +0200 (CEST) Received: by mail-qk1-f170.google.com with SMTP id 129so17444339qkg.4 for ; Mon, 02 Aug 2021 11:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IhG3PSFadUjsw97HnPnARwAqKT/Cxi1SiUJLZ4hnWQE=; b=JUFqyWVJRdL2cPX5Tn+Gy28CvBndGS3QnQ5RTPI0tQes9VDfCs/5ZW9ICRd9gb+tjW TjTURRFzjooDgKK/FLd4PtM8VMfkTIrrtTSyXiO3AB3PG49Lt8pROvftshbAzoFEutB7 TRG8bAXmicemtfXyeRi83JL7DR+lh3RYxah0o= 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=IhG3PSFadUjsw97HnPnARwAqKT/Cxi1SiUJLZ4hnWQE=; b=NjlWyuzdNRL8niZ5P2HAVvxVhCfuO0J2CtaI5fksj3yd5kIR7GTpbHK8lDTComj0hD edxx1bqwBOvuL+XaFPIUbsIp5rqH9LING6MJwAM8fT4VBOT7dYiu92XEf/buaJeh1ZrH Co5EAzOCflP5zf6ZvBpty1U+FITS+7hHN9gcLgiitHBkFsNU4U5TAORdMrY1WZKJ8BkX BtrNaUHtR2YARAes/tTbKW64V1uCb4+bkRZPrUwnRJkNrKSBb3M/40fNPv727nfDN0+A 5oqpnmQIYFo32Zo473XbHY1Mq+EM0ehIvRl+oAh1ak8O1jLPlNsZ5aPG3E8rXYMvxqUT FqJg== X-Gm-Message-State: AOAM531LRBudQ2RL6hFWBE9xjq4dQsjf7v2nUEMb0gZ9WV7eH5zJd5Hd Zjy7XwMjltBcAnnF5jlWP2dUhQC9o9gU6bL2nIwZ6A== X-Google-Smtp-Source: ABdhPJzbJPUY+4SwUCJs52BHS7gGhyknSR3VspAzBPtjU6oJN2dIxRUi+Ax9Byoa8MH4Hegvuwym4j5pOrXgrPExKkw= X-Received: by 2002:a37:394:: with SMTP id 142mr17028808qkd.423.1627927503518; Mon, 02 Aug 2021 11:05:03 -0700 (PDT) MIME-Version: 1.0 References: <20210802180011.7183-1-getelson@nvidia.com> In-Reply-To: <20210802180011.7183-1-getelson@nvidia.com> From: Ajit Khaparde Date: Mon, 2 Aug 2021 11:04:47 -0700 Message-ID: To: Gregory Etelson Cc: dpdk-dev , yux.jiang@intel.com, Matan Azrad , Raslan Darawsheh , Slava Ovsiienko , Xiaoyun Li , Ori Kam , Olivier Matz Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000097051705c89768b4" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix IPv4 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" --00000000000097051705c89768b4 Content-Type: text/plain; charset="UTF-8" On Mon, Aug 2, 2021 at 11:00 AM Gregory Etelson wrote: > > UDP protocol reserves 0 checksum value for special purposes. > Other protocols, like IPv4, TCP and SCTP must calculate checksum value > in software or offload checksum calculation to hardware. > > If IPv4 TX checksum offload was off and header checksum was set to 0, > testpmd csum engine did not calculate checksum value for IPv4, TCP and > SCTP. > > The patch always calculates IPv4, TCP and SCTP TX checksums if it is > not offloaded. > > Fixes: b2a9e4a855d0 ("app/testpmd: fix Tx checksum calculation for tunnel") > > Signed-off-by: Gregory Etelson I think this fixes Bug 768? If yes, please add the tag "Bugzilla ID: 768" to the commit. > --- > app/test-pmd/csumonly.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c > index bd5ad64a57..607c889359 100644 > --- a/app/test-pmd/csumonly.c > +++ b/app/test-pmd/csumonly.c > @@ -487,7 +487,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info, > } else { > if (tx_offloads & DEV_TX_OFFLOAD_IPV4_CKSUM) { > ol_flags |= PKT_TX_IP_CKSUM; > - } else if (ipv4_hdr->hdr_checksum != 0) { > + } else { > ipv4_hdr->hdr_checksum = 0; > ipv4_hdr->hdr_checksum = > rte_ipv4_cksum(ipv4_hdr); > @@ -519,7 +519,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info, > ol_flags |= PKT_TX_TCP_SEG; > else if (tx_offloads & DEV_TX_OFFLOAD_TCP_CKSUM) { > ol_flags |= PKT_TX_TCP_CKSUM; > - } else if (tcp_hdr->cksum != 0) { > + } else { > tcp_hdr->cksum = 0; > tcp_hdr->cksum = > get_udptcp_checksum(l3_hdr, tcp_hdr, > @@ -535,7 +535,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info, > if ((tx_offloads & DEV_TX_OFFLOAD_SCTP_CKSUM) && > ((ipv4_hdr->total_length & 0x3) == 0)) { > ol_flags |= PKT_TX_SCTP_CKSUM; > - } else if (sctp_hdr->cksum != 0) { > + } else { > sctp_hdr->cksum = 0; > /* XXX implement CRC32c, example available in > * RFC3309 */ > -- > 2.32.0 > --00000000000097051705c89768b4--