Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1994209rwb; Fri, 11 Nov 2022 03:36:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf4YVR3Ncwl3dnlaxAllW95VGBx/rvWysnw9lgomzvNqKXigyS2B0bymggHlolxB3cvdAzUY X-Received: by 2002:a17:903:210a:b0:186:9f20:e7e2 with SMTP id o10-20020a170903210a00b001869f20e7e2mr2002023ple.174.1668166619329; Fri, 11 Nov 2022 03:36:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668166619; cv=none; d=google.com; s=arc-20160816; b=d4XgPi5PjHNnX/yGo3K0XWf8H6LZTIpyDEFcRd08RxmlDIeGeD5prlf/LWrs/s1TLx sRiZ8Jf+ebrv6U5HE/sStZoeGq5eppg/MO3TxLNln+2BtCmUKLbp24rDib9EtvRCW1wJ GjdqxIJcse8Af7lgPQUfTu2uUYxb4nXLwQBmxd4/alAFuzkq60AuzHVhVMQzlwx46NV1 dYXCpV1Y0I1MMTQkPM9GBIBJn5aD+LM9cuXMXOwfxV+n8sOjXyCPCgdfGvLYTUIWQ+NR n/2eiacuEcSqB7wSUSCw0eRdZMqsrs4UiPGT5Mw/och6BaHfi3ykYvsshYGn/l7jA4zg bqGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SPrFzEXBtZfMuZQ0E/MD8Y/s/TLhrKQ91tlI8+CfrEM=; b=wGk7udYkvfzf5RQnYC4u6kHtFIg4B2uj8CiOQkRKDNTuHVARGsL6WuxrQ4q7iBvv51 8zpMsiwW4GhYvRvi4zRUXbKCzrcX4P6sbHOgTMovRKVwBSoXVXKJAXVjh5fDkKfuSFCB PD45qItWm+r1lx3RPrAyG9S7ZjOiNRPNgxuZWmVlkjq4Z4kWXLOL9Si0H9ZZYfdbx2Az FwroyBN9A3gVNfd3cuHf6f+X9n7++JD70JwRq8nw5CuzYNzji6gQ0Vo+k886U8EvcmaV yTINfu57qBLfuICv/dU60a6C1amU0/wzrwIiOkL5CzzHz7v70lfz+02VxQUZeqehvuv4 usHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hh3ztc+R; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gp12-20020a17090adf0c00b00202b984842csi2433956pjb.35.2022.11.11.03.36.46; Fri, 11 Nov 2022 03:36:59 -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=@kernel.org header.s=k20201202 header.b=hh3ztc+R; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233687AbiKKK0D (ORCPT + 92 others); Fri, 11 Nov 2022 05:26:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233567AbiKKKZ7 (ORCPT ); Fri, 11 Nov 2022 05:25:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FC36129; Fri, 11 Nov 2022 02:25:58 -0800 (PST) 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 339B4B82510; Fri, 11 Nov 2022 10:25:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50033C433D6; Fri, 11 Nov 2022 10:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668162355; bh=bnQXfus7E3RasnI8EALEGVL0v9ZykMY0xEISNFgDZyY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hh3ztc+RCjIOVNp7TMdIES2gXjy0XYR4dt6yqtM+cn4UBAlsDNM5WziMvrhhEs3j5 PmF/nBb1QhXPIPNUM6vN589es2xw6VCutcpdDmh++Y+8SdL4t2Icz3OQJ6XTUnzFqv gTjoFUYOG1P06YcGf82o41rCjMHWfcSRNSfdHLlA8p88Ev/l+M2QHa3owp4vGOGGSV yrvlLtTyGPzVrmcMDxpIgjZj6d+Z0vZ9Uno2OcF0FzOO3h9sf/rkbhiJXrx5erhJzB JGPOEO10jta2PFXZyM1ZQnzYWrCoSjW8UrUFscHIRfmiG42No2Xw6/1POmUDJzVFkF 5OVNLYHLZgc/Q== Message-ID: <48804ac2-e5aa-bb48-3a44-922e0bd3b688@kernel.org> Date: Fri, 11 Nov 2022 12:25:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] net: ethernet: ti: cpsw_ale: optimize cpsw_ale_restore() Content-Language: en-US To: Jakub Kicinski , Vladimir Oltean , Ido Schimmel , Nikolay Aleksandrov Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, vigneshr@ti.com, srk@ti.com, linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221108135643.15094-1-rogerq@kernel.org> <20221109191941.6af4f71d@kernel.org> <32eacc9d-3866-149a-579a-41f8e405123f@kernel.org> <20221110123249.5f0e19df@kernel.org> From: Roger Quadros In-Reply-To: <20221110123249.5f0e19df@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Hi Jakub, On 10/11/2022 22:32, Jakub Kicinski wrote: > On Thu, 10 Nov 2022 11:39:47 +0200 Roger Quadros wrote: >>> Maybe my tree is old but I see we clear only if there is a netdev that >> >> This patch depends on this series >> https://lore.kernel.org/netdev/20221104132310.31577-3-rogerq@kernel.org/T/ > > I do have those in my tree. > >>> needs to be opened but then always call ale_restore(). Is that okay? >> >> If netdev is closed and opened ale_restore() is not called. >> ale_restore() is only called during system suspend/resume path >> since CPSW-ALE might have lost context during suspend and we want to restore >> all valid ALE entries. > > Ack, what I'm referring to is the contents of am65_cpsw_nuss_resume(). > > I'm guessing that ALE_CLEAR is expected to be triggered by > cpsw_ale_start(). > > Assuming above is true and that ALE_CLEAR comes from cpsw_ale_start(), > the call stack is: > > cpsw_ale_start() > am65_cpsw_nuss_common_open() > am65_cpsw_nuss_ndo_slave_open() > am65_cpsw_nuss_resume() > > but resume() only calls ndo_slave_open under certain conditions: > > for (i = 0; i < common->port_num; i++) { > if (netif_running(ndev)) { > rtnl_lock(); > ret = am65_cpsw_nuss_ndo_slave_open(ndev); > > Is there another path? Or perhaps there's nothing to restore > if all netdevs are down? I see your point now. We are missing a ALE_CLEAR if all interfaces were down during suspend/resume. In this case the call to cpsw_ale_restore() is pointless as ALE will be cleared again when one of the interfaces is brought up. I'll revise the patch to call cpsw_ale_restore only if any interface was running. > >> I have a question here. How should ageable entries be treated in this case? > > Ah, no idea :) Let's me add experts to To: Thanks. cheers, -roger