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 02E054554D; Tue, 2 Jul 2024 16:48:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B61341132; Tue, 2 Jul 2024 16:47:03 +0200 (CEST) Received: from smtp-fw-80009.amazon.com (smtp-fw-80009.amazon.com [99.78.197.220]) by mails.dpdk.org (Postfix) with ESMTP id A5E1340EF0; Tue, 2 Jul 2024 16:47:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1719931622; x=1751467622; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=VCaz6TQ4nxlr09Hj3eIhRgMF6E9g3Pf24JNUkhqn64E=; b=eIRnlTDqwQB7MzT1HrCvkkBYkagbTb8g6xrThFtIuRguMXnT7YL7EEdu UpMy3Ahb95SGKedQjhA9MpLEqPv2D9B0t7hWRZaE8uKCX4sM5cd0wm/tm 0zkfH54Krj7+bxENkFVLZ4fdikFKy02dyk9xXuffPs9YkjB7H35dkb6Qr E=; X-IronPort-AV: E=Sophos;i="6.09,178,1716249600"; d="scan'208";a="101515276" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.25.36.210]) by smtp-border-fw-80009.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2024 14:47:00 +0000 Received: from EX19MTAEUB002.ant.amazon.com [10.0.43.254:28976] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.21.226:2525] with esmtp (Farcaster) id eea8df79-af67-48a6-bbb0-409bf5eb628e; Tue, 2 Jul 2024 14:46:59 +0000 (UTC) X-Farcaster-Flow-ID: eea8df79-af67-48a6-bbb0-409bf5eb628e Received: from EX19D007EUA001.ant.amazon.com (10.252.50.133) by EX19MTAEUB002.ant.amazon.com (10.252.51.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.34; Tue, 2 Jul 2024 14:46:59 +0000 Received: from EX19MTAUWB001.ant.amazon.com (10.250.64.248) by EX19D007EUA001.ant.amazon.com (10.252.50.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.34; Tue, 2 Jul 2024 14:46:58 +0000 Received: from HFA15-CG15235BS.amazon.com (10.85.143.173) by mail-relay.amazon.com (10.250.64.254) with Microsoft SMTP Server id 15.2.1258.34 via Frontend Transport; Tue, 2 Jul 2024 14:46:57 +0000 From: To: CC: , Shai Brandes , Subject: [PATCH 13/15] net/ena: fix wrong handling of checksum Date: Tue, 2 Jul 2024 17:46:24 +0300 Message-ID: <20240702144626.14545-14-shaibran@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240702144626.14545-1-shaibran@amazon.com> References: <20240702144626.14545-1-shaibran@amazon.com> MIME-Version: 1.0 Content-Type: text/plain 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 From: Shai Brandes This change fixes an issue where a non tcp/udp packet can be indicated to have an invalid csum. If the device erroneously tries to verify the csum on a non tcp/udp packet it will result in false indication that there is a csum error. This change make the driver ignore the indication for csum error on such packets. Fixes: 84daba9962b5 ("net/ena: add extra Rx checksum related xstats") Cc: stable@dpdk.org Signed-off-by: Shai Brandes --- doc/guides/rel_notes/release_24_07.rst | 1 + drivers/net/ena/ena_ethdev.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst index 24bb91ad46..ec960d93cc 100644 --- a/doc/guides/rel_notes/release_24_07.rst +++ b/doc/guides/rel_notes/release_24_07.rst @@ -80,6 +80,7 @@ New Features cleanup and lay the groundwork for hot-unplug support. * Removed an obsolete workaround for a false L4 bad Rx checksum indication. * Fixed an invalid return value check. + * Fixed Rx chcecksum inspection to check only TCP/UDP packets. * **Update Tap PMD driver.** diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 67a1d86f9a..a18c94df28 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -669,7 +669,8 @@ static inline void ena_rx_mbuf_prepare(struct ena_ring *rx_ring, packet_type |= RTE_PTYPE_L3_IPV6; } - if (!ena_rx_ctx->l4_csum_checked || ena_rx_ctx->frag) { + if (!ena_rx_ctx->l4_csum_checked || ena_rx_ctx->frag || + !(packet_type & (RTE_PTYPE_L4_TCP | RTE_PTYPE_L4_UDP))) { ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN; } else { if (unlikely(ena_rx_ctx->l4_csum_err)) { -- 2.17.1