From patchwork Thu Apr 18 08:20:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 139483 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F66D43E9E; Thu, 18 Apr 2024 10:21:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D8B640E4A; Thu, 18 Apr 2024 10:20:50 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id C2DB740E4A for ; Thu, 18 Apr 2024 10:20:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713428446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c3GedpwcYQJZk2gAzze9YP4qRF038eYSTIN6ghJ5eZ4=; b=NK7eu5rNzrMiy1A4hfR3T3Cj6PuZiyylSo91+AflaWaAaXuGgpaJ4W5iX1JzE5RUMPqPh4 /biWoN82hkfyht71+GMxOhdGu3C3iVE4x5dyldexYfwtOfy0uyeypmiJeFI0iyC/EcjD6u q/hqyJw9ohOw6PCAJ+Cr8aMFWGMJTPU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-160-lAWfAnbeMp2B7rZyhSg2Fg-1; Thu, 18 Apr 2024 04:20:42 -0400 X-MC-Unique: lAWfAnbeMp2B7rZyhSg2Fg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 941B3801855; Thu, 18 Apr 2024 08:20:40 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9482C40357A7; Thu, 18 Apr 2024 08:20:38 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@amd.com, stable@dpdk.org, Aman Singh , Yuying Zhang , Olivier Matz , Konstantin Ananyev , Tomasz Kulasek Subject: [PATCH v3 3/7] app/testpmd: fix outer IP checksum offload Date: Thu, 18 Apr 2024 10:20:17 +0200 Message-ID: <20240418082023.1767998-4-david.marchand@redhat.com> In-Reply-To: <20240418082023.1767998-1-david.marchand@redhat.com> References: <20240405125039.897933-1-david.marchand@redhat.com> <20240418082023.1767998-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Resetting the outer IP checksum to 0 is not something mandated by the mbuf API and is done by rte_eth_tx_prepare(), or per driver if needed. Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") Cc: stable@dpdk.org Signed-off-by: David Marchand --- app/test-pmd/csumonly.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 6711dda42e..f5125c2788 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -583,15 +583,17 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info, uint64_t ol_flags = 0; if (info->outer_ethertype == _htons(RTE_ETHER_TYPE_IPV4)) { - ipv4_hdr->hdr_checksum = 0; ol_flags |= RTE_MBUF_F_TX_OUTER_IPV4; - if (tx_offloads & RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM) + if (tx_offloads & RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM) { ol_flags |= RTE_MBUF_F_TX_OUTER_IP_CKSUM; - else + } else { + ipv4_hdr->hdr_checksum = 0; ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr); - } else + } + } else { ol_flags |= RTE_MBUF_F_TX_OUTER_IPV6; + } if (info->outer_l4_proto != IPPROTO_UDP) return ol_flags;