Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4542187imw; Tue, 19 Jul 2022 08:30:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s1bJAi4s1X1exDedpB283LfHERjSOMJpNKDPKDSimoxRxOOra8bt8gFvb23Oz5DAZwYxs9 X-Received: by 2002:a05:6808:118b:b0:2cf:761c:184d with SMTP id j11-20020a056808118b00b002cf761c184dmr15558314oil.87.1658244620421; Tue, 19 Jul 2022 08:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658244620; cv=none; d=google.com; s=arc-20160816; b=0rTUIptTRj7oW5+xLbHsXem7OT3KkWdMhsw3cS6XkunSDArql9ZoY4YjDrSA1Kw392 kzH6SFxtpND5/KEByUU+zZikroV1c/CwpNiGRZPzQEDlNggshj3ZSdV/lZl5UI92ewSP U5hxy4Bnp7iGWrINBpJtE6EpsDQFxX3fTGGnn7W15V7savKttR4ahu2Vry5arSGdTdq+ aul/xOPzaUoR9l6DHM4jo8w29kwJcYP12CaQpDYscwWNxt2ThghhZ0PJ54gLewWCNM3W tbFrbN5jvGXY5vlPcPKAai/ewqOdXojXrpF4u+Ttq3nluHoUvenMqgcc1nSLyWX99WWF 8ueQ== 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=zRHK405baFW2UdcNvF1Ri8j6v7h1hezBx9diOW60tXw=; b=iTaXpPwW98zuAnJuk1U8EsxTtKy7EgSnyseIghi3gzUxaS2Ls0FZkngkPsmmbv4GXc RkJLq0bdnIf6A+6M9+87NiWueGPeRhO0HYARpt0sREDU5SUNlTNFWmcidIsoTCnpcpBF mUvJYnSh/Go6McHfw4m+wAEKDMlo0w8R+U0qzStV653QcylFXXkjRKaBZYqCsAmK11D0 hoDm3jWNVmXoeMJCS0HqEU9a04Z9MdQlEVDR1QRJFfMSuf1j+/7rnLes4VepbEYluGM9 MpWZJ2ogvVn0JabSwmx60jYw5Y42RH5pI00ulyVMZyQYlOpUkWsFp2EHrgn7KUEq3EBH r+cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EcNyCwlg; 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 o7-20020a9d6d07000000b0060c04fbc610si13098058otp.234.2022.07.19.08.30.06; Tue, 19 Jul 2022 08:30:20 -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=EcNyCwlg; 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 S239441AbiGSOkh (ORCPT + 99 others); Tue, 19 Jul 2022 10:40:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239365AbiGSOj7 (ORCPT ); Tue, 19 Jul 2022 10:39:59 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1E1F54ADA for ; Tue, 19 Jul 2022 07:36:00 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id n7so11925630ioo.7 for ; Tue, 19 Jul 2022 07:36:00 -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=zRHK405baFW2UdcNvF1Ri8j6v7h1hezBx9diOW60tXw=; b=EcNyCwlgGsDJIOtNW/Ss1NOraStXKkldrA+XkALRjahcB3N8Pn4slgW8OT1YUICsNb zAMUE0EQhGd08tsdqZWKWCG5Zl7dR322RIbUsHxVfRkGHA1qQ+eiJh91uusj59tOgQ9h 0sX/5MECKAwoyBmb0xUCwETEbwnEfnaUgSEgVPUcagNEQ3zKaUANvS4C3CGlPBvEVTUf opQ8DjxVkGm4lZTxQLoDqRdpqX8d131HraMlGKKf0V4oxwLbKoFm8N3l9iXCaz3N57xd tHlQ8SW8jrIT9d6zL6a5Ix58mAUu8T7W5D619gjQxL1N67CYV59zMWNSRQ4Zjjq/sgqw LpyA== 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=zRHK405baFW2UdcNvF1Ri8j6v7h1hezBx9diOW60tXw=; b=xSahEW2aoAoOgUZcTuzB3bhMzvfE9mdr7F9iaw2fgDUMfbdtYeud9w5nUKAOAQ17k/ Dv/TRB5P1DLUgnXTLzpxNZhQ90fjuH495M2Sku/UnKKe+Y+xbjP5WQfiGDqyuGb/Wnl/ lt35jf/tSB/0loO24OxjqWJ/TTLlcBZMvTFe+merS7XC6Hunj/COWSXu63PBUgXSITXe keRvhRMQIMWEFwyg4Er9N3VIuP/zDLAoW/0A70jTzRgCcmL30L/aNGAvFrPY7vcxchvA ayVMi2v8yFxAvg9GFU69gyb2I/G/Ccu7KT7QnBSnNULfOS8NacWMzraNtIqZXWqwdYlS MfJw== X-Gm-Message-State: AJIora8vb3jU3klhxFDiXcsZlkvi+1ofyeMyFT9y8H5dD/2iHCgYFzdW 4RJOl7ibOnIwYqm3HtOcuOszhw== X-Received: by 2002:a6b:3fd6:0:b0:67b:d97f:47d3 with SMTP id m205-20020a6b3fd6000000b0067bd97f47d3mr11241017ioa.46.1658241360312; Tue, 19 Jul 2022 07:36:00 -0700 (PDT) Received: from localhost.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id t16-20020a056602141000b00675a83bc1e3sm7286559iov.13.2022.07.19.07.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 07:35:59 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: 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-next 3/5] net: ipa: skip some cleanup for unused transactions Date: Tue, 19 Jul 2022 09:35:51 -0500 Message-Id: <20220719143553.280908-4-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220719143553.280908-1-elder@linaro.org> References: <20220719143553.280908-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 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 In gsi_trans_free(), there's no point in ipa_gsi_trans_release() if a transaction is unused. No used TREs means no IPA layer resources to clean up. So only call ipa_gsi_trans_release() if at least one TRE was used. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi_trans.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c index b17f7b5a498be..b298ca7968907 100644 --- a/drivers/net/ipa/gsi_trans.c +++ b/drivers/net/ipa/gsi_trans.c @@ -404,7 +404,8 @@ void gsi_trans_free(struct gsi_trans *trans) if (!last) return; - ipa_gsi_trans_release(trans); + if (trans->used_count) + ipa_gsi_trans_release(trans); /* Releasing the reserved TREs implicitly frees the sgl[] and * (if present) info[] arrays, plus the transaction itself. -- 2.34.1