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 0F65BA0C41; Tue, 3 Aug 2021 03:33:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 99C5640E32; Tue, 3 Aug 2021 03:33:43 +0200 (CEST) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by mails.dpdk.org (Postfix) with ESMTP id 0E2004069C for ; Tue, 3 Aug 2021 03:33:43 +0200 (CEST) Received: by mail-qk1-f180.google.com with SMTP id 14so278920qkc.4 for ; Mon, 02 Aug 2021 18:33:42 -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=3EdB/CtMHz+MDkmlPbnQXD4DUuVksZ++TDXLbxUGgEo=; b=MQSi/nSOTIg806PVCWABA2X+ahe/YTO7L5Cb1JY0eutNF0AoTjrtf9giyJK2Ct0SDH Lwn+ArxPqIcV+CJUlqzZu0caeacAwk99RXA7TI0l+oFJs3724eeyIQt/tAbZi2t4hTor 9H2pGI5mxSg6MhjITV9UUCYrJLZE1KW3pWiAM= 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=3EdB/CtMHz+MDkmlPbnQXD4DUuVksZ++TDXLbxUGgEo=; b=uC6nhnydU4/1I/racT4TGh9ZMJFQkaJjMTGBK+zD4gNkAfc3y01Xvrc5LinKjHo1HH gzeIJ5UfK+m7dzpoZjovu/CYobLp6CZE35p4YFK/6NxM30l6rVDx3j8kxtyQ/OIsp1K6 qRMBdvkLWyR1rjOzFYMkcNGz3oLJ7Ezs/FZ9yDf3El3rk8oBGYyhw1TuLvhrWVcm62tG WFrBsFgAMsJ4lvSDom15eGno8GB3tW/ewZn5wBnVRs6BIl9XVUFYCsY9PxKdr7gTWd7S QaucT4CHDFSz60SqBs+eMaFoPtsWmiS3DPHCOnAdiDgV9mx17XOMIRbEEbFWFj98cbUl +2/A== X-Gm-Message-State: AOAM53374RZ5lj/5/DiouCYlXkjq0mfa4C6f9Z6d/cKZSUfcqKZ+/nkE ao/Ga07bWHB/sSLofR6JrMBZuCbDFWNK5v2JO0I3kg== X-Google-Smtp-Source: ABdhPJymT6BZumNNvn+OvDP8voJvfM4BJYh0SR8Qq5ubpO9PiVbnpKP72tKt8sR54qn5UQbbmoFZZWUoZ8G/533pCD0= X-Received: by 2002:a37:e10c:: with SMTP id c12mr18394988qkm.333.1627954422318; Mon, 02 Aug 2021 18:33:42 -0700 (PDT) MIME-Version: 1.0 References: <20210802180011.7183-1-getelson@nvidia.com> <20210802181316.7676-1-getelson@nvidia.com> In-Reply-To: <20210802181316.7676-1-getelson@nvidia.com> From: Ajit Khaparde Date: Mon, 2 Aug 2021 18:33:26 -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="000000000000125fb705c89dad6e" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH v2] 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" --000000000000125fb705c89dad6e Content-Type: text/plain; charset="UTF-8" On Mon, Aug 2, 2021 at 11:13 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") > Bugzilla ID: 768 > > Signed-off-by: Gregory Etelson Acked-by: Ajit Khaparde > --- > v2: add Bugzilla ID > --- > 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 > --000000000000125fb705c89dad6e--