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 4D68BA0A02 for ; Tue, 27 Apr 2021 15:58:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4460741262; Tue, 27 Apr 2021 15:58:27 +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 EFCC541243 for ; Tue, 27 Apr 2021 15:58:23 +0200 (CEST) Received: by mail-wr1-f50.google.com with SMTP id h4so50538872wrt.12 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=GVMPqH98hizJMZdg9HpbBc+ILkU28B0CG/pvY+XYt0F9dSdp5n5Ce5+Rp5Q8H4A14D nn6nlK5BbnB/vFf+B50a4AkSspgFm0i8HMZXmIHt1FKxA4sxq9uz6XNjzfWZ9FreqxTh MMmPXjiba468xVZyg44ZgP/+EanFKra28CWsh+ZR28pWAMHoYwzwsURf11R5Z2mxV0dP O0qqzf6ik0zuypFIBwgyJrj0yG3gtnBVmhlTJi5SbB/YJIm9KPQlNOGueBAhgStso6D/ Zlbu9LP/lVWXnwISMgDr0tS9Ph00qVBqFHgCDxbzw8FjlrGXxaE5pJqeD4wwqpQhgB3L +fKQ== X-Gm-Message-State: AOAM530/X1sqacvbW1YXr1P5urxOnhhvtxYsxkwSXOHHn8SLx5oU/3Bx pz1Qh0hteuOQMlKKcn1FBWY5Dg== 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-stable] [PATCH 1/4] net/tap: fix Rx cksum flags on IP options packets 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 Sender: "stable" 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