Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3678263lfo; Mon, 23 May 2022 11:09:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlUZfAbQ8262kWlZD4ZfisE1kBaRmvF4xRxFSHgoO4YnE0met5OWZ1fO8c6B1qhCe/2rFl X-Received: by 2002:a17:90b:1d90:b0:1df:d0ae:1443 with SMTP id pf16-20020a17090b1d9000b001dfd0ae1443mr254025pjb.122.1653329389177; Mon, 23 May 2022 11:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653329389; cv=none; d=google.com; s=arc-20160816; b=KdJMvKblvoJ6tk3JdbUumw1UOOywNxZWSopxuNiiMa5iOXIUy1R20q8cxkGTlACpRH PgjA4ZHXW9BgXwvwJbMA2zrh8YEP119JJMKY6Wri0qVngtMglMl3qCfUQrcjEwZaZh3V eYEhkbSNYsshB2ER1UaSyqBXxY261saU9rYLoIbOwYWyLU7lMy4FDFSsRgoI8SK4pGOu dkIFBGoWqG8xe/b5xZ+JH4gpML27WLN/+gSHSxIYeC7Eqv4Olpt6aS0SePXQQf5lo5Tc r4EcHlC5ne/rLHrDPeo9erMWxaHWqM+73Yu8EhablhJlo96rf4xkN0mI5sUPPKTseTOl iuuw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nqqn03prTh41E4/zh6G3Q+OLBmY96uUxAx+WX/QNRFI=; b=WyWcq/k0oV2w2sIQuzYYnLk21/pZ3CEO9kfwwp/vnfzulySzCQLu03GVH+WGWG+636 fkqdbml31g2WOzks8hOqaR8QcK5j1GprGlQF4NdDsPnTKkyaYB37R59W5OhXijqJXdyc uicwIaoMPMqdj0VhEAHWAzBT6ZBFM4OCYn7NfcCAJpfuZudvE5XgMkEGvRz4DwteG2Hn kBgHMa4hJsXjFvGddrvgVZf2AwnRz6kCBzV5NniPJZVqxE2JAMZb7GlaJ/E54ikhufoI 6gNR4uoi4ZUY2v61s5yKqSzbi2hu6954K7D1Df5U3v8m4T9RWgIHQB7bo9NUnoKFtNeo g3Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bboBFDnC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id ie17-20020a17090b401100b001cab382d4e3si19686pjb.49.2022.05.23.11.09.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:09:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bboBFDnC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7628F1078AC; Mon, 23 May 2022 11:09:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242525AbiEWSAK (ORCPT + 99 others); Mon, 23 May 2022 14:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241037AbiEWRcl (ORCPT ); Mon, 23 May 2022 13:32:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DF8077F05; Mon, 23 May 2022 10:27:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EF3A6B81202; Mon, 23 May 2022 17:27:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33E3BC385A9; Mon, 23 May 2022 17:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326841; bh=/Vp/mTzC2zQzuZMpQFRBDEVKDe4ulklZbwulRP4GhAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bboBFDnCpCarytOdCTzLF9/gbSHRQsdVFDEI2xXaqd7ehBNs6ALUuuI4b1DsQiN4b nP7qzTn+LEtlHsWio9FwyNp0REQGeoPdIkRYF/ZWcUWkc5kGXNbj0J2qoBKBtKKAPo Urwnhx1CJ4zGs4o40gSLZZwld+TL+Kv0niZmkjPY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Elder , "David S. Miller" , Sasha Levin Subject: [PATCH 5.17 076/158] net: ipa: certain dropped packets arent accounted for Date: Mon, 23 May 2022 19:03:53 +0200 Message-Id: <20220523165843.595929416@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165830.581652127@linuxfoundation.org> References: <20220523165830.581652127@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Elder [ Upstream commit 30b338ff7998b6ed7a90815870cd5db725f87168 ] If an RX endpoint receives packets containing status headers, and a packet in the buffer is not dropped, ipa_endpoint_skb_copy() is responsible for wrapping the packet data in an SKB and forwarding it to ipa_modem_skb_rx() for further processing. If ipa_endpoint_skb_copy() gets a null pointer from build_skb(), it just returns early. But in the process it doesn't record that as a dropped packet in the network device statistics. Instead, call ipa_modem_skb_rx() whether or not the SKB pointer is NULL; that function ensures the statistics are properly updated. Fixes: 1b65bbcc9a710 ("net: ipa: skip SKB copy if no netdev") Signed-off-by: Alex Elder Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ipa/ipa_endpoint.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 68291a3efd04..2ecfc17544a6 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1169,13 +1169,12 @@ static void ipa_endpoint_skb_copy(struct ipa_endpoint *endpoint, return; skb = __dev_alloc_skb(len, GFP_ATOMIC); - if (!skb) - return; - - /* Copy the data into the socket buffer and receive it */ - skb_put(skb, len); - memcpy(skb->data, data, len); - skb->truesize += extra; + if (skb) { + /* Copy the data into the socket buffer and receive it */ + skb_put(skb, len); + memcpy(skb->data, data, len); + skb->truesize += extra; + } ipa_modem_skb_rx(endpoint->netdev, skb); } -- 2.35.1