From patchwork Fri Jun 11 19:05:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 458508 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp1209796jae; Fri, 11 Jun 2021 12:06:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAXv0Mv6/PDWISoEmblAeq4LHkLpoHYBsr2Kv6nXGoKXmEouqUIoX2pJpqgGqdC2jZCu4H X-Received: by 2002:a17:906:5049:: with SMTP id e9mr4939727ejk.30.1623438367400; Fri, 11 Jun 2021 12:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623438367; cv=none; d=google.com; s=arc-20160816; b=lg2ByuBHgSthPmoCcYuX2vk0itk6kL6tLOyPBX43mvyYtCCGN44fC4b9+vJFN7nwsw A2q1Ifju8zToO4nwyYBlLLTxrGB7ztS8OVXlZQIxLYD/fUoKZweWrfry9I0Y9GgkYBGX PweWJvzBh4ILrYTqnyVazfBW1V5iFqbizU4bsBdPQElgKDQ5ODVUtOC5zqilVqY5QTBs 8V+qjUCq8peU7ixjReaKH8uWpd/VpwIkYjS4vcFScc5suzxBP7m1F6DmPL+jl40Nw1ap DHRqoqposwC02vDlRta/hMNOzF8iP+V4+3iSBL/AHelNo6j8SGO/ZkxrRRQ5xKy5Y1e2 uMpA== 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=vZEwEVBDEvCxZgVoTN4odpB95bOFDOiTrujBE+grmHw=; b=kPYc6RDTrt1SxgsnuJ2iMHgFvQUSngTJw2bTfxd07oWNUX3MctRF9v6Pd5tbBKqVuf S8V+DiYK1aAsq+XrMo1cDFTBTu1qSLegnvY6NZ1V9+gMtsLoxn1Zto0h33bioB9GZlC5 0NPW82by6AJh32Bna6PczHlUbT2ExmRs9kmJFBEwqp//ycWPGleJDVXndPj0fOWWtrYg c0IKHkkYd7V60mfKJH5Glwkj1VNB8yMji83oZD+QQZVbe1K1Aq9a+257JLPfG4yBnkrd GVsPdbtUMZQ65PKrFvGbJI1MVZuCMFM0wgCW61y6JykdyEOfHBUYQhgdPTDda3jNVEm7 +X8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GODL4EQk; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 y12si5229320ejc.650.2021.06.11.12.06.07; Fri, 11 Jun 2021 12:06:07 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=GODL4EQk; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S231164AbhFKTHh (ORCPT + 8 others); Fri, 11 Jun 2021 15:07:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbhFKTHf (ORCPT ); Fri, 11 Jun 2021 15:07:35 -0400 Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15479C0617AF for ; Fri, 11 Jun 2021 12:05:36 -0700 (PDT) Received: by mail-il1-x134.google.com with SMTP id i13so6118747ilk.3 for ; Fri, 11 Jun 2021 12:05:36 -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=vZEwEVBDEvCxZgVoTN4odpB95bOFDOiTrujBE+grmHw=; b=GODL4EQkGQXW7NnrcMbNEp9Q7LZU1Uas5K0o2f6nyIiJdB/Vy0H9OKhwx9CUrxvv+D bbReoR4eQEW81BQQL/T3CFaG5cYhqpshijVgZYecg8EyCu5Bqictl7u16lArAH+VC3jq lo8mXnF7nSj+82us+iIUwuktPkS1dzZaMlxlYPSXNW+ml5n6HMLW1YYRInRmmJWX9y73 xRqfUla7wO8cOGtGQPgLbLp68swLewAPgMosWlZYJ3jKO15w2FtGiD2HVJuPtUZ8Jhu6 goBLUyOeiNM+kshrpEy7lB2EsBo9tphJLgnjkj61/EwCcb2gMSsaoVhAPIiVOthIdxH8 DLTA== 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=vZEwEVBDEvCxZgVoTN4odpB95bOFDOiTrujBE+grmHw=; b=dMwj1HD/mAuNliK0AcGWgS7lFEaeOovtnBHqfmy037rfr8pFhPa5EgeCyH825UV0y0 ib4yMg8wyxjZCNVt6V3ZRoF4SV0X7XizYHnMokE8FBe1Ccl7XEIauKdkoY1K6XAVyLGs P9UYOb+tVlBW/FsA/3e0LRH/2gucBMc3z9P6vJZlcwTbc3wkoM/rBCx3PPSu2wBomHin sTnoDQWmyu7IV2Dud5uHrvTrgFndxBlx2kI0AiS0C59agg2FqNOkMf4rYERke579wHTP syfJU60J3iPBYHnlpPqxJx47BXRcLxZoR6W+Q87NSRE4UFpVLFT0LOk8tZ4MMk72I8pV ZxrA== X-Gm-Message-State: AOAM533nsqqIP9KXzMLWkIoD53ETkKJVbWxseBjG5531fKD1JHQGqZm6 CQo0xOyyGzXHQHh5bI7KCRWvmg== X-Received: by 2002:a05:6e02:1153:: with SMTP id o19mr4404755ill.136.1623438335567; Fri, 11 Jun 2021 12:05:35 -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 p9sm3936566ilc.63.2021.06.11.12.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 12:05:35 -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 1/8] net: qualcomm: rmnet: use ip_is_fragment() Date: Fri, 11 Jun 2021 14:05:22 -0500 Message-Id: <20210611190529.3085813-2-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210611190529.3085813-1-elder@linaro.org> References: <20210611190529.3085813-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In rmnet_map_ipv4_dl_csum_trailer() use ip_is_fragment() to determine whether a socket buffer contains a packet fragment. Signed-off-by: Alex Elder --- drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.27.0 diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c index cecf72be51029..34bd1a98a1015 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c @@ -50,8 +50,9 @@ rmnet_map_ipv4_dl_csum_trailer(struct sk_buff *skb, __be16 addend; ip4h = (struct iphdr *)(skb->data); - if ((ntohs(ip4h->frag_off) & IP_MF) || - ((ntohs(ip4h->frag_off) & IP_OFFSET) > 0)) { + + /* We don't support checksum offload on IPv4 fragments */ + if (ip_is_fragment(ip4h)) { priv->stats.csum_fragmented_pkt++; return -EOPNOTSUPP; }