Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp679421iob; Fri, 13 May 2022 10:02:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc4DfCZgEQI57SimhwD+wCygK3+Pc6wFdy9yR0WZVFkJByBn+1fdbtQ8iwkBc4qwHW3/K+ X-Received: by 2002:a17:907:97c3:b0:6f9:971b:9dc0 with SMTP id js3-20020a17090797c300b006f9971b9dc0mr5038507ejc.269.1652461357232; Fri, 13 May 2022 10:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652461357; cv=none; d=google.com; s=arc-20160816; b=WRlJdq+lOQyftS2xK4JRk4ySfg6NrNz7+N1r5XE52JRSIqg45WdtuF9FXzW+6cEm1A mMFbTG1PpLi4XH2nq6vNUKQQ7o2nO/YpU8il02Gk9T5HwYZiUM7KLlps/dP0W3ctKecQ svYV01BjJUsHoovrLG8sOkhzq+xTYcPUW5t45z7/Zy9duai689BLpWKj/VrV1TuPwwS0 ++AZp7Tb69Eef2PobygCxYSBr1HFRL6uHmCxqmz9IQeGai/ZiFvESUENfUvn2BIqCW/i ZPF/TKpLVV1l/kA0sADgW6Xro9KmWr/jRNlDuK4BLOpsYPRVQrHhUsPb5Kz/q/GVUyX7 /XMA== 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=ObrabPeHCvU+7dJRKxpHSNrTAOTtMCoM5TrsgPoZkdA=; b=pEKttu7Ibf9c7AbwZycsOCWr9ZETE7JYXt9rbKP+1BZ4TJ/uAdP4mC3IKBURdAWNbm xHVJcYeBKfsf54Q6VRFi2BesDl2Aw94ymEgwsDIzxA77Uf0JVCZMgZnhN5G6Pa33wSOd o0WHeZbBYa77/7sPPKgtImGBfLoCSQ49+Famlxs8Hb1e190R7G92wm8wJ/nruHGrpo1p Sj1CUqClCsuU0A4fgf235sD29KnSU91wCQE4po2+hIQL5Py/GWLJVFawVHWzk4InjkW1 MlbWUS0bW1IaSdC4hIxev+4emfT2UlIy7vazVFZSpkuR699UA/TVBl8DI5mKu/wWpmKX R70Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LqDnul8I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga37-20020a1709070c2500b006f37c8021b6si2683278ejc.879.2022.05.13.10.02.09; Fri, 13 May 2022 10:02:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LqDnul8I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1355797AbiELPLd (ORCPT + 99 others); Thu, 12 May 2022 11:11:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355732AbiELPKq (ORCPT ); Thu, 12 May 2022 11:10:46 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 200DA261F9C for ; Thu, 12 May 2022 08:10:39 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id f2so5636498ioh.7 for ; Thu, 12 May 2022 08:10:39 -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=ObrabPeHCvU+7dJRKxpHSNrTAOTtMCoM5TrsgPoZkdA=; b=LqDnul8IKgFzWCT9AVCqtSZZI7UcE9n96UHYaVIKrZD7cdeC9oVar/qF2tycyK52L9 oTwaHrqibKBzBzgpvySd/H2RB/YciH6aGzeX/lWqQp9oX6W4iaacU5tp2j7iCwLVbEf1 GtR0YBHiKSfuaWOIMt/cKZfC32ZkeRcQGMe46B8O7O2/AM1BadvnVdhlI4iLHtVg6qdN nWNG0+bxOEAWljR6Fykxtaq2gos/WENZtVibwse/JhU0gZ2KSlMPM4b9etNg9CjFdYQd C0fX3bE2KW57tZf3GFsI/X/F1hXKRO9qApQ9VmpBwg5OKzgjX04snqiC8uHg72rFCopV /GfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ObrabPeHCvU+7dJRKxpHSNrTAOTtMCoM5TrsgPoZkdA=; b=f1etw4v4a3X3Ips0ovyOo3pfYILOGuQ+o1ICvwIUd7T4nMwG8oQ09G+bana93nI+OZ kknTDlFN2YQqgu0sRb/yryGG/j9BhQp5d828ZemoCZAlUuZxeQ1A1f8SYZWr5zyXTS0A NQay4dNaC1onP20Oi1bf84447FguboPtwa3CJuoGdFDwRh127XrQBoP1dWwkRvbPLoga A4WgLLKGSMVZsPB683MvSFabWJt6VyOIW/4CFR5c20IIL4s0tZ5cWJMAi4G0vRzsHJps 5cceOtRLqwsN0ag0ME6kRx3+vPWOI8loXWderjHVSjObo8CuW/9WoPk7vFlVKtdqC5JB 3Afw== X-Gm-Message-State: AOAM533/5YcQYLiDNoxf4vMIobsCq44hE2HdZKq47BgmiKkt15z77edE Yaam4ccWyeCw+TAtf2+7svcwaA== X-Received: by 2002:a02:84ac:0:b0:32b:a11b:4586 with SMTP id f41-20020a0284ac000000b0032ba11b4586mr202328jai.231.1652368238418; Thu, 12 May 2022 08:10:38 -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 p15-20020a6b8d0f000000b0065a47e16f3fsm18217iod.17.2022.05.12.08.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 08:10:38 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com Cc: lkp@intel.com, mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 1/3] net: ipa: certain dropped packets aren't accounted for Date: Thu, 12 May 2022 10:10:31 -0500 Message-Id: <20220512151033.211592-2-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220512151033.211592-1-elder@linaro.org> References: <20220512151033.211592-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 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 --- 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 888e94278a84f..cea7b2e2ce969 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1150,13 +1150,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.32.0