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 84DD2A0A0F for ; Wed, 30 Jun 2021 15:52:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 796AD4126F; Wed, 30 Jun 2021 15:52:29 +0200 (CEST) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mails.dpdk.org (Postfix) with ESMTP id 6522140040 for ; Wed, 30 Jun 2021 15:52:28 +0200 (CEST) Received: by mail-wr1-f47.google.com with SMTP id l8so3699036wry.13 for ; Wed, 30 Jun 2021 06:52:28 -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=r0c+JEWF44KsZ3Jo9Za0B/o6DO1SFW7AcGoN6uYcS6w=; b=DLkhOzdhV+mOhBsg5zcG1ZFbGdE+9a5jYTa6fBh5DX6WQ6QTeYZiLZiImT1QYjqbRC JgflF46gzNkA99ehlSrrjeEBgs6abUte7JtgV58LpFIC7Kw2TtQWQ1qztDCwY7mM0X0Z acLqjOxOxL5y1Njf6mzf/R0sKk6RfmLGUKzrEuHqtpUQ08bBv6Zyw9kwgB+xhOmOiO7T V+LfonsogPkS5WSKZ+2ryIx11e1GB3cBBf+ADFg3UyIfJL5qgkPXy/7LpBsiHmm1osOi a3n1s2AQW+VnYPQVhMelm1aNuIW0lSR6sdYp7gqqa2iCr3bC/YnqA8pGbb6knat6lgop jdcw== 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=r0c+JEWF44KsZ3Jo9Za0B/o6DO1SFW7AcGoN6uYcS6w=; b=QbGHjdLPATM6iI+z5ezB6F0dnpGsNFQkfG1sbrXvu/i+v4I4SE+zG3eCFQQaMWYJuG PppbU0Shy4lLFFjZpouB4gC5oE2D2/hgl3VFr31VE6RR2puojD9T0xYmxSC3EHfgQQ80 H161MAmX+tH49Baz/Nm2RAZjXITM3X+0C4+PDxvcJc2EysgTr+pMJERoiWOUyHnAu5i5 /0ysodDinM9abIriLxzwhX7xSY7yD4ghimR1GC6idUj9AMGLZyikl9V+0b3bOOfRQ+Xc 2I1n9cruzHLefR17WEiAFolJQHoJHNkxs5SpOLiHSpkZUJKCcMovakwJAMsnFp6TowTi yuaQ== X-Gm-Message-State: AOAM5334clVVy2NAwztASHAmBp0TdmDnYvlcOxqe8V1ySGY/T+rPz9cy 4+iJXmbDZ6rrXkdMvzw98/W+JA== X-Google-Smtp-Source: ABdhPJxgB+xAgNUE3Uq/1GcRcc+UtQY2vSMfpXFvQ8hGdQq9FklD3RJiJRJ3ptLZmFEhuxab9Hm4Yg== X-Received: by 2002:a5d:6b82:: with SMTP id n2mr38760387wrx.206.1625061148173; Wed, 30 Jun 2021 06:52:28 -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 g15sm193026wrs.50.2021.06.30.06.52.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 06:52:27 -0700 (PDT) From: Olivier Matz To: dev@dpdk.org Cc: guohongzhi1@huawei.com, keith.wiles@intel.com, mb@smartsharesystems.com, thomas@monjalon.net, ferruh.yigit@intel.com, andrew.rybchenko@oktetlabs.ru, stable@dpdk.org Date: Wed, 30 Jun 2021 15:51:55 +0200 Message-Id: <20210630135158.8108-2-olivier.matz@6wind.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210630135158.8108-1-olivier.matz@6wind.com> References: <20210427135755.927-1-olivier.matz@6wind.com> <20210630135158.8108-1-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v2 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 5735988e7c..5513cfd2d7 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -342,7 +342,11 @@ tap_verify_csum(struct rte_mbuf *mbuf) rte_pktmbuf_data_len(mbuf)) return; } else { - /* IPv6 extensions are not supported */ + /* - RTE_PTYPE_L3_IPV4_EXT_UNKNOWN cannot happen because + * mbuf->packet_type is filled by rte_net_get_ptype() which + * never returns this value. + * - IPv6 extensions are not supported. + */ return; } if (l4 == RTE_PTYPE_L4_UDP || l4 == RTE_PTYPE_L4_TCP) { @@ -350,7 +354,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 +368,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