Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1408526pxj; Sat, 12 Jun 2021 07:43:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgDPdBujzAjmg2tE0FNRP5u5TIrKS5IOT+BdYaZ5ZCXFwEqZYNGsxTbYE97Tf4vLELrh5b X-Received: by 2002:a17:906:7188:: with SMTP id h8mr8141544ejk.529.1623509009296; Sat, 12 Jun 2021 07:43:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623509009; cv=none; d=google.com; s=arc-20160816; b=0ulREBCNnsw4Bi9F1lizgJTs99gSPjrqeCa+uufK4CUF1i4GrPoI0qikCcetB+C4c2 Kid2wNFu5RyWUm1CKovBomk5Vj1pVOoeYFYs/GSOdG4cR8ffABcxAWdQ+zifSPNsIBs7 ZoT7NrLnTLT1STdDnai6e1amHX+6TV3GCLCJPyv5saFbglIxOqH4SsYtiDQNQb8yzYMx LhUn0GEX/IK3LRzwqC15fWbNltGgSJOmt1PTerMK1p1dCYBdr20Es75Mt2/2V9nPHFMD Iz6Sqm89WgbPgh4ahE9yO1ZdMRLqifluQsmZDc5UPIsFd6A7Ah5tK7GO3USRVvQrfqx4 l2Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LC9SvpQ/Uxhg0GO1cMqQXuwzbE3v2RjkJ7G/fhbU/Z8=; b=vhnZJj6i41HbO4ReQGV4TAN3iyfyxYMV+iknFzSFWmL+on3yxXEVGw0MbMO+RCG+gq AYYVKz+qOYq/h2Xrm5C+TFfpONES62NJ7J/7G0I8e3Q1WXE2QpLu+7YC1urxRT+BZdrH jHIwvIXMjsgje0pWJWwJ3YulS9BTxOW2m7vNAcK8UKsF/A6ao3B3WvgE7S3clzgI7fj3 UrJAt+uVAeixGZJ2+uL4GmmSqSvGmN/eOYn5LOrvu8/yt1DQuxosMU8TNUhJooZUHb4R MhoVVNiDQiWey2R2uWgHaMjo9bIHGTUllr7c/mxQKZ0po2JrFOeqq/a+/tlTWx+AOGpk +xRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HRrIfU2N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv25si7411133ejb.507.2021.06.12.07.43.06; Sat, 12 Jun 2021 07:43:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HRrIfU2N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231479AbhFLOks (ORCPT + 99 others); Sat, 12 Jun 2021 10:40:48 -0400 Received: from mail-io1-f53.google.com ([209.85.166.53]:45639 "EHLO mail-io1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231478AbhFLOkq (ORCPT ); Sat, 12 Jun 2021 10:40:46 -0400 Received: by mail-io1-f53.google.com with SMTP id k5so24915626iow.12 for ; Sat, 12 Jun 2021 07:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LC9SvpQ/Uxhg0GO1cMqQXuwzbE3v2RjkJ7G/fhbU/Z8=; b=HRrIfU2NNwbt/T1Aemqlv+f2Xej+RwSv/MeoPgIqoPaMIOBE6iL1XEcTKsDfMgWeVu 5h2/usTr/2oL62fd6HaJuz/YeVB5PyQCW1CKGl4fkp6ODbjURk3nJam6Xf6FElB1LBr5 Ce3sSaKo6mzxz/deimuGU/UzsCcARcEz/RLCSb6m2n8pT/d1fbVDjD2eXEIJ8wtO8FGA UxLi9yKXxgUheSvoba3EZ5DZXgiYfK7hvGT0gJp4lBx9CG3umMi2/sRfNqrKBljM/hpr lfa9ljIggY8SzHCCGt4LuP0M0NzpvWlywmVHZg38qmTqawy+1NXscfkp7C+LkKh4HOo7 kDuA== 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=LC9SvpQ/Uxhg0GO1cMqQXuwzbE3v2RjkJ7G/fhbU/Z8=; b=EQOPIEhaV8z6CGiBibAd3zhkp6Q1ZQWseeZhTPYoFnwGEQFHwaHpwCFSV74VTtXBqX wl9smGa/wy8cvCmJW6kA1277hYA2smSSxn2YJbZeKvmSUKIMt/c29xSQLIle/cgAhmVV 5M0er0AtVOEZJKzf1k2OZkoQ32bp90dn8BzvfnUeiZu9R1CQI38KvjP6XSQ3PbCM3gsw JHlo7dLbhSpCe7togF2/6ksMWguuc+WZXWZ+ge0clHYgYRvCa7TBrgfg96tJQ/J8M6nF tZ5YyTWNsH9WXuUjqhyEs9p/7UhBnQ0m3gLtHaqjfxtsJPTqjVnggdLWuts0nk/QPRlB 5Hgw== X-Gm-Message-State: AOAM530lbe2cL5Lydzz5NETah8KBSOlxFoc4vMaVKvdkqg+nUFikF2M/ 8yk/QT585Vt2QolQ5yELKwyuWl3RgrtCd/7q X-Received: by 2002:a5d:9916:: with SMTP id x22mr7217178iol.160.1623508666642; Sat, 12 Jun 2021 07:37:46 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id k4sm5126559ior.55.2021.06.12.07.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Jun 2021 07:37:46 -0700 (PDT) From: Alex Elder To: subashab@codeaurora.org, stranche@codeaurora.org, davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 8/8] net: qualcomm: rmnet: IPv6 payload length is simple Date: Sat, 12 Jun 2021 09:37:36 -0500 Message-Id: <20210612143736.3498712-9-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210612143736.3498712-1-elder@linaro.org> References: <20210612143736.3498712-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We don't support any extension headers for IPv6 packets. Extension headers therefore contribute 0 bytes to the payload length. As a result we can just use the IPv6 payload length as the length used to compute the pseudo header checksum for both UDP and TCP messages. Signed-off-by: Alex Elder --- drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c index ed4737d0043d6..a6ce22f60a00c 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c @@ -114,7 +114,6 @@ rmnet_map_ipv6_dl_csum_trailer(struct sk_buff *skb, __sum16 *csum_field, pseudo_csum; __sum16 ip6_payload_csum; __be16 ip_header_csum; - u32 length; /* Checksum offload is only supported for UDP and TCP protocols; * the packet cannot include any IPv6 extension headers @@ -134,11 +133,9 @@ rmnet_map_ipv6_dl_csum_trailer(struct sk_buff *skb, ip_header_csum = (__force __be16)ip_fast_csum(ip6h, sizeof(*ip6h) / 4); ip6_payload_csum = csum16_sub(csum_trailer->csum_value, ip_header_csum); - length = (ip6h->nexthdr == IPPROTO_UDP) ? - ntohs(((struct udphdr *)txporthdr)->len) : - ntohs(ip6h->payload_len); pseudo_csum = csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, - length, ip6h->nexthdr, 0); + ntohs(ip6h->payload_len), + ip6h->nexthdr, 0); /* It's sufficient to compare the IP payload checksum with the * negated pseudo checksum to determine whether the packet -- 2.27.0