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 084C7A0A0F; Wed, 30 Jun 2021 15:52:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 11AF54127A; Wed, 30 Jun 2021 15:52:32 +0200 (CEST) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id 6D5BC41221 for ; Wed, 30 Jun 2021 15:52:28 +0200 (CEST) Received: by mail-wr1-f46.google.com with SMTP id j2so3711617wrs.12 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=Cbj9GZhL1QFaKe+0YMsxsdRA//+cdh1nn50bTY9lsNxGmp2qkYj0fJjqyAO0F+xW/B yb5WDhy0Z7FWsmhjOzBBlBmgYfZML7K13xbnv8lrylVtuFnZI9XK2e3LGivVep4QhfSJ uqNXjl+2kfqhjYXVkhBJsgPCnffTBexXXhULmizVgniDiS8YvTpFtsvupSzgpcnZS/w3 tzdcZ79zU4r7CvPjtV7ZZJEB1XxhW2WTNxN0SJVcZGh5i3y3G6xd0ubxGUwb98k9iWRe wPs/5d+tWSecjquAewQa8PUvFdp3YRgj1m4y3QN5WhTGpGxCh8tpoRWXP+EYj24l3AkY fUXw== X-Gm-Message-State: AOAM533/R+51s7WKJpGtlYWktVulhW/FjZXNljLdIp2ESZVolh0nkp8u MozkKfXTUpvfJDYey9GPnBivQzQvQXo2Pw== 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-dev] [PATCH v2 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 | 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