From patchwork Fri Apr 5 12:49:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 139121 X-Patchwork-Delegate: thomas@monjalon.net 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 7F89743E01; Fri, 5 Apr 2024 14:52:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70FDE402D4; Fri, 5 Apr 2024 14:52:32 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 0EEB5402CE for ; Fri, 5 Apr 2024 14:52:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712321550; 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=Q74U4Dl1y7BVScLXtkoX46h75j1d63WJeFsz0HwlsqCIVtWJHrA7BvYIopAmiLee/TxqAN V/43LX3xVe9FiHhEH+KXiUP/diNzZyWZL3bcB6EAs75Q8AGX3B8Q0HSJV/Gu561eA4D2tj mi9n72s7655VVWYCm4yGaNOV6FJmeBI= 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-647-8m9PwIpsMiakzIrjjM1NmA-1; Fri, 05 Apr 2024 08:52:27 -0400 X-MC-Unique: 8m9PwIpsMiakzIrjjM1NmA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 EB82685A5B9; Fri, 5 Apr 2024 12:52:26 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E088200A386; Fri, 5 Apr 2024 12:52:25 +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 , Tomasz Kulasek , Konstantin Ananyev Subject: [PATCH 4/8] app/testpmd: fix outer IP checksum offload Date: Fri, 5 Apr 2024 14:49:43 +0200 Message-ID: <20240405125039.897933-5-david.marchand@redhat.com> In-Reply-To: <20240405125039.897933-1-david.marchand@redhat.com> References: <20240405125039.897933-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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;