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 E3279A0A02; Tue, 27 Apr 2021 15:58:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C39D41254; Tue, 27 Apr 2021 15:58:26 +0200 (CEST) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mails.dpdk.org (Postfix) with ESMTP id ECB4B406A3 for ; Tue, 27 Apr 2021 15:58:23 +0200 (CEST) Received: by mail-wr1-f50.google.com with SMTP id j5so58621238wrn.4 for ; Tue, 27 Apr 2021 06:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WdnoC2V6KCWhpBILoO1Y+5wep/dMmiSUiNQ7fW6rD2k=; b=hjtcN+WPTQg1brME+hk+RkEpCtZK+bAqd6wpCqWkx0DB7gW25m42+IwuhuzrFNrD+h nHRgltUlt0DvbrWcrSME+Gj+Pj1SA9E9MQ//k0W1crKkVHB/jH9eFEzMGxL0mlQgsyFf SwsfQhXUTQQfWUf87cXsymWtubvEsZPXA/eO++8aLFY0GehhoPnB5P5ZbOCGizMPEAkB 9/F1U1PYvQ5FBGZwDvFlOX5nVGxahVPjeGoXjqfTDKKp64ldMvBgvMghGQjCKNDPeK5d SlT+wemq+lypfD8BdGaGPYPlYqFT7g/9Z8R1uijEkUb+3tmwk9Nl1eq25oJyp0Iea61N dFVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WdnoC2V6KCWhpBILoO1Y+5wep/dMmiSUiNQ7fW6rD2k=; b=gXzsPNa9gTqGvMzgyKuiNrkUuKBkARyAKGEqDr2q+y5iLs/4sf/OeCiZGxtmJGyJFn s9jRRUP/8/QlpGwJKSV3dv/1kbnTN3jInLKeANimIHs3NyErR4hKOw7lfrjfrwzSeNL3 B3yOoZas82Yrhbq6p1y6TXf+oH2AB3nznmeLPx4A/WQvoPt3uUjAfbXzgGIXx0jmfzL7 zjSvjGYZ6dDnZAYAESIN4Gj3d+Nb+e/Viorvk5vA9pkNRmsq2lsx9IY6jpROW9ZfiIiW EdJH+d84P9eQD1Envi/+MoWGeosrwKt9DqeZZOnhJYPAX+vKMwofyol5JQLYFi8pD8ds PgXg== X-Gm-Message-State: AOAM531yiYLW3mvkiSoiCoicLio9ioUCZIXj5ccdnlrUXj2m+cV+5DRy 5L1pUxd36diYMRX2uJOiRg1P8IqKWrCoDw== X-Google-Smtp-Source: ABdhPJyDiNvOSeRQiY3lpA2f5rrPnQ4x8g1GriWgTxIx+ouCRuln7Xy0oU/LGg8p2aSxZnwiPcxXNg== X-Received: by 2002:a5d:43c1:: with SMTP id v1mr10974663wrr.248.1619531903771; Tue, 27 Apr 2021 06:58:23 -0700 (PDT) Received: from gojira.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id h9sm21072213wmb.35.2021.04.27.06.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Apr 2021 06:58:23 -0700 (PDT) From: Olivier Matz To: dev@dpdk.org Cc: Keith Wiles , Hongzhi Guo , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Thomas Monjalon , stable@dpdk.org Date: Tue, 27 Apr 2021 15:57:52 +0200 Message-Id: <20210427135755.927-2-olivier.matz@6wind.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210427135755.927-1-olivier.matz@6wind.com> References: <20210427135755.927-1-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 1/4] net/tap: fix Rx cksum flags on IP options packets 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" When packet type is IPV4_EXT, the checksum is always marked as good in the mbuf offload flags. Since we know the header lengths, we can easily call rte_ipv4_udptcp_cksum() in this case too. Fixes: 8ae3023387e9 ("net/tap: add Rx/Tx checksum offload support") Cc: stable@dpdk.org Signed-off-by: Olivier Matz --- drivers/net/tap/rte_eth_tap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 68baa18523..e7b185a4b5 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -350,7 +350,7 @@ tap_verify_csum(struct rte_mbuf *mbuf) /* Don't verify checksum for multi-segment packets. */ if (mbuf->nb_segs > 1) return; - if (l3 == RTE_PTYPE_L3_IPV4) { + if (l3 == RTE_PTYPE_L3_IPV4 || l3 == RTE_PTYPE_L3_IPV4_EXT) { if (l4 == RTE_PTYPE_L4_UDP) { udp_hdr = (struct rte_udp_hdr *)l4_hdr; if (udp_hdr->dgram_cksum == 0) { @@ -364,7 +364,7 @@ tap_verify_csum(struct rte_mbuf *mbuf) } } cksum = ~rte_ipv4_udptcp_cksum(l3_hdr, l4_hdr); - } else if (l3 == RTE_PTYPE_L3_IPV6) { + } else { /* l3 == RTE_PTYPE_L3_IPV6, checked above */ cksum = ~rte_ipv6_udptcp_cksum(l3_hdr, l4_hdr); } mbuf->ol_flags |= cksum ? -- 2.29.2