Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2712400pxb; Thu, 3 Feb 2022 12:31:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXr/rzBygGsovf2qbTGL0IY4mFN8bqRxr+jWuvn41+eI12WhUUHYmZnxeis7zPuVSIyrnJ X-Received: by 2002:a17:902:ea0b:: with SMTP id s11mr36699151plg.133.1643920266047; Thu, 03 Feb 2022 12:31:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643920266; cv=none; d=google.com; s=arc-20160816; b=wRtKKeGbqRandFsCkdjpefdSbkiKmy1x9/RTkhDKgTJbil4e+MuRNE4xMt2/3S8QZA RTqDEcigpq0gNzHOAtG5ag7u//cR0asZLzXsE1lFdNWi/Afba9jvZsiAnvvGUrdFiytk FT7lpjPPCb5zMGD7pRZngz4nCRVleQLks+oTrjHueuUG24YZDzx+VPAtHWkfGoqR7m0c zpz6Um5dhsKzShgt0RPqvax0a1l40tv2c0Zuzi+E2VoPz8/LE2OA/9hpVB5fyvil3oNc sP7tHWJtVG1MNZ5jz3Jdb0UF7NUbT6nx/gKzXB/alPfExuGsFu0k3VX7mN3+kRfTd3lH OFGg== 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=TIZyuqBufxAitJOiYAoUO6ML7BGyW72LuYL7A9Zd06I=; b=wM3wR9OXP/6eXqftEXEPzs1mriA8bwZVaoESrQNcSuR2LrCRgbc08E/un/6bwXAI27 adCjGDMNwkdrFDqbc8wiLZ69f336FioVIOr9aOEHo4jmvLbPTSK9i26VyW47K9npmJeC uupkqTnpD16WB05TKNhSP6AE4fWnPvXKDkvusjMnhuMK2fjDXwjHfjqzA7iWvVZkkX+F y/oLW+YRzbSzKUH7eQwhMOIVnbuBAtfbxYEif+0RbFS7S0QqBmoQPGKRBg6OUuXxGjUi rph/Gflmi0upnBjlAMfMT/1nZR8lW2q+uyaY4M2LveON7hEPt6MygTI+sLWFUXDhkZ66 1WgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="l0cNK/Zo"; 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 n7si26482624plf.136.2022.02.03.12.30.55; Thu, 03 Feb 2022 12:31:06 -0800 (PST) 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="l0cNK/Zo"; 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 S1352673AbiBCRKJ (ORCPT + 99 others); Thu, 3 Feb 2022 12:10:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352557AbiBCRJp (ORCPT ); Thu, 3 Feb 2022 12:09:45 -0500 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66DCEC061714 for ; Thu, 3 Feb 2022 09:09:44 -0800 (PST) Received: by mail-il1-x136.google.com with SMTP id z4so2654565ilz.4 for ; Thu, 03 Feb 2022 09:09:44 -0800 (PST) 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=TIZyuqBufxAitJOiYAoUO6ML7BGyW72LuYL7A9Zd06I=; b=l0cNK/ZoNnrcd1AYeAyM4hvz0Xi7q+a9VciorTZrJw/NQUe/pu0lWzj2GADHrJT/G8 L8mxRxQ4zJDPW3+Jrl6QFjLJFUlBQtFwDTI/HqZdN8Hm9CKwLYQL5sRCNQsRoF9KNYet Yw35Zk988oetFskQSyg2D6XV8d+TeHry9855Rq4qWIUZOcpgjqCT1XFJFvlwYOLQEevY aYMmaJHb44yUKpY1rRBqc75CtGitB/ayOiXx5SjGgYkloywhg7mSgLRHRMg6n7yd375G 5dlrxRdCEeb75z8OiBmGTz4GqsbsU+IuuO8vAw6Fc8K2GMP4skS8H15oOFxouzHteLTP xbRQ== 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=TIZyuqBufxAitJOiYAoUO6ML7BGyW72LuYL7A9Zd06I=; b=LUvoOqIrREg2rBovVCO7o/eZ3Rvjv94V71TwqbuQ++rS6ISmH+Aq2yU6FFticZ9bKe L2/Lo+U9Ha6iJBvXEw2AekSplSWD24LGgnzH5/p8Q8tVEWfjT68td5a/r+A5fTrf5DFE kVsSIMDmE/WxOJYrpbyWpyJk6JBtrW4xQQfUSAaD/9MQYvBFbX+SP5Gxhoa/ENycloNn MoyagMHCGjET9YFc//GqLdiLV0OdWEFIX/UZYrguqfmiVfoU4Q3Z1i43GBgInS5hsw90 o0oDmBoVTMAslQUwiphOE81leHIJqyNg21GJIW8qeDOvZ9EqfqWWOGIkdyDfPpQMg7BN 7WXg== X-Gm-Message-State: AOAM531ez164NyD5g4Hd2+agePIAACV9zkqvHWNrS27+DRCknWF7T8Z5 8bItzcGTtddVzpdwD0STDiR7nw== X-Received: by 2002:a05:6e02:2163:: with SMTP id s3mr19853641ilv.244.1643908183577; Thu, 03 Feb 2022 09:09:43 -0800 (PST) Received: from localhost.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id m12sm21869671iow.54.2022.02.03.09.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 09:09:43 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, mka@chromium.org, evgreen@chromium.org, cpratapa@codeaurora.org, avuyyuru@codeaurora.org, jponduru@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 08/10] net: ipa: kill replenish_backlog Date: Thu, 3 Feb 2022 11:09:25 -0600 Message-Id: <20220203170927.770572-9-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220203170927.770572-1-elder@linaro.org> References: <20220203170927.770572-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 no longer use the replenish_backlog atomic variable to decide when we've got work to do providing receive buffers to hardware. Basically, we try to keep the hardware as full as possible, all the time. We keep supplying buffers until the hardware has no more space for them. As a result, we can get rid of the replenish_backlog field and the atomic operations performed on it. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_endpoint.c | 7 ------- drivers/net/ipa/ipa_endpoint.h | 2 -- 2 files changed, 9 deletions(-) diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index b854a39c69925..9d875126a360e 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1086,7 +1086,6 @@ static void ipa_endpoint_replenish(struct ipa_endpoint *endpoint) return; while ((trans = ipa_endpoint_trans_alloc(endpoint, 1))) { - WARN_ON(!atomic_dec_not_zero(&endpoint->replenish_backlog)); if (ipa_endpoint_replenish_one(endpoint, trans)) goto try_again_later; @@ -1105,9 +1104,6 @@ static void ipa_endpoint_replenish(struct ipa_endpoint *endpoint) gsi_trans_free(trans); clear_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags); - /* The last one didn't succeed, so fix the backlog */ - atomic_inc(&endpoint->replenish_backlog); - /* Whenever a receive buffer transaction completes we'll try to * replenish again. It's unlikely, but if we fail to supply even * one buffer, nothing will trigger another replenish attempt. @@ -1346,7 +1342,6 @@ static void ipa_endpoint_rx_complete(struct ipa_endpoint *endpoint, struct page *page; ipa_endpoint_replenish(endpoint); - atomic_inc(&endpoint->replenish_backlog); if (trans->cancelled) return; @@ -1693,8 +1688,6 @@ static void ipa_endpoint_setup_one(struct ipa_endpoint *endpoint) */ clear_bit(IPA_REPLENISH_ENABLED, endpoint->replenish_flags); clear_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags); - atomic_set(&endpoint->replenish_backlog, - gsi_channel_tre_max(gsi, endpoint->channel_id)); INIT_DELAYED_WORK(&endpoint->replenish_work, ipa_endpoint_replenish_work); } diff --git a/drivers/net/ipa/ipa_endpoint.h b/drivers/net/ipa/ipa_endpoint.h index c95816d882a74..9a37f9387f011 100644 --- a/drivers/net/ipa/ipa_endpoint.h +++ b/drivers/net/ipa/ipa_endpoint.h @@ -66,7 +66,6 @@ enum ipa_replenish_flag { * @netdev: Network device pointer, if endpoint uses one * @replenish_flags: Replenishing state flags * @replenish_ready: Number of replenish transactions without doorbell - * @replenish_backlog: Number of buffers needed to fill hardware queue * @replenish_work: Work item used for repeated replenish failures */ struct ipa_endpoint { @@ -86,7 +85,6 @@ struct ipa_endpoint { /* Receive buffer replenishing for RX endpoints */ DECLARE_BITMAP(replenish_flags, IPA_REPLENISH_COUNT); u32 replenish_ready; - atomic_t replenish_backlog; struct delayed_work replenish_work; /* global wq */ }; -- 2.32.0