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 D6FF8A034E for ; Tue, 22 Feb 2022 19:12:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 407EB41C3C; Tue, 22 Feb 2022 19:12:42 +0100 (CET) Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by mails.dpdk.org (Postfix) with ESMTP id C25B3426D5 for ; Tue, 22 Feb 2022 19:12:39 +0100 (CET) Received: by mail-ej1-f47.google.com with SMTP id vz16so45531467ejb.0 for ; Tue, 22 Feb 2022 10:12:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=14NUlgp7/uwht08EEffkISHQVyhpeQZpdRvDSsgGcy4=; b=2R+AJZAfGma7fZBZysmBJjAxRkOcdofVYVvYVjIf1CnnLcRLfle6UihPzuo2IyuLZX 3etTb0PST6iilTw7irrDhPSxVSEC2As17vvY06ksJ6/Z99PcWRMAaV4ZnW8BLlGunX5T rwZVQ6SGCoxhuFzoaV4vHlGNo88GpyQRxVSL9n29zJlpLdb3ACotRSLOxHuuqQei/GK8 B/mCuKdglrkahjbrEbZBzR2hMHli6tU4U8ANb6IBtOaE+/re4OVbfYtBM3nmXG/I8eOo VTFug1dOd0rEaWQr6B5DeIXgwRebZI1pUAVIyvsulhKXP6k45cVPboyWH3IG0ol9xgdL iIhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=14NUlgp7/uwht08EEffkISHQVyhpeQZpdRvDSsgGcy4=; b=woBoPT8V/vsgslMtKYWUg4d7JqTapJVR+A8YtuYzT4Xo61H6aeDloWeQsQhxqgJn7R HE0arXzGkE2RkTopIGq2JwVUD/bhcad8A4L8XJ+YvZWmjaXttzL/DXxboNg2vaEuxpVi LXWGPnO7jBeTZbtFLo238O3nrkgQc//VZPjuosR6xMK+S1/QGSP7ATDQIVgpTuBn7o3U nRz68LMp4eaAwCSWE/eU7aW9y/bHUpgGJY5bF4AyUSITPt3xaWCognTfrRe33ry9dmP4 YWzMnmQBLdc9wIav0V7Wu2/imw+gRYtG4CgxYaAp/mcf/50IHXd3iB2btAHqvNL/Lrw+ BI+Q== X-Gm-Message-State: AOAM533uBX9r2OUAMqeCZ3Zjz8Rn3H86YNKTwiz19LBByvzOKtUBOT66 ML5HGpbbBxqMF0Z/FETM7td2dA== X-Google-Smtp-Source: ABdhPJwsGFsuBfTAJbZyBNXkPsiRyuDgMy60nSMQ5twEywMxvN9t7NMVAQ2AyXptTyNEoUsz4z9MWw== X-Received: by 2002:a17:906:8681:b0:6ce:d45f:1689 with SMTP id g1-20020a170906868100b006ced45f1689mr19874240ejx.183.1645553559474; Tue, 22 Feb 2022 10:12:39 -0800 (PST) Received: from DESKTOP-U5LNN3J.localdomain (89-79-181-52.dynamic.chello.pl. [89.79.181.52]) by smtp.gmail.com with ESMTPSA id y21sm10610153eda.38.2022.02.22.10.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 10:12:38 -0800 (PST) From: Michal Krawczyk To: dev@dpdk.org Cc: shaibran@amazon.com, upstream@semihalf.com, Michal Krawczyk , stable@dpdk.org Subject: [PATCH v2 20/21] net/ena: don't indicate bad csum for L4 csum error Date: Tue, 22 Feb 2022 19:11:45 +0100 Message-Id: <20220222181146.28882-21-mk@semihalf.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220222181146.28882-1-mk@semihalf.com> References: <20220222160634.24489-1-mk@semihalf.com> <20220222181146.28882-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Some HW may invalidly set checksum error bit for the valid L4 checksum. To avoid drop of the packets in that situation, do not indicate bad checksum for L4 Rx csum offloads. Instead, set it as unknown, so the application will re-verify this value. The statistics counters will still work as previously. Fixes: 05817057faba ("net/ena: fix indication of bad L4 Rx checksums") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk --- drivers/net/ena/ena_ethdev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 9f29cf04ac..0861206ea4 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -583,7 +583,13 @@ static inline void ena_rx_mbuf_prepare(struct ena_ring *rx_ring, } else { if (unlikely(ena_rx_ctx->l4_csum_err)) { ++rx_stats->l4_csum_bad; - ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_BAD; + /* + * For the L4 Rx checksum offload the HW may indicate + * bad checksum although it's valid. Because of that, + * we're setting the UNKNOWN flag to let the app + * re-verify the checksum. + */ + ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN; } else { ++rx_stats->l4_csum_good; ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD; -- 2.25.1