From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12A07C388F9 for ; Fri, 20 Nov 2020 02:25:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D16722267 for ; Fri, 20 Nov 2020 02:25:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2ObzAhTo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D16722267 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lunn.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=skr132DiWXxsWpBRPdePh15ksbibVgDSH5nm/yVE/KU=; b=2ObzAhTopAsSIm56t5ilyB2FP /g+vdpZcsZyeN29prw09P/6jeJa/tu0q7f7FWlsqJj1GdcusVEQT51n+3diU8ly1hA6k7+xmmmqKS MXol9/XjNaa8+DwWLgZuQEmVbwlFgnvjxQSVyzu/5JdU9Dggv6OLTmXqFETMDXIqa6zY72jAWDrjA YWfMESsA2I9ldLoqOzMsv6+KcNOfkvJvy1yve55m9XpZaL0lNQ88apAIHPmN+aIUhIMEtXitbul3W ClPzfr0hwHu+xpvl+TmgGDCwchiEyQ4/MH437MwLOzjIkYI17YG4qjIAydqR3FKJMLnn6MjWTMf8y 5EntuhmNA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfw7P-0004TW-Jw; Fri, 20 Nov 2020 02:25:47 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfw7M-0004SA-HI for linux-mediatek@lists.infradead.org; Fri, 20 Nov 2020 02:25:45 +0000 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kfw7I-008333-JR; Fri, 20 Nov 2020 03:25:40 +0100 Date: Fri, 20 Nov 2020 03:25:40 +0100 From: Andrew Lunn To: DENG Qingfang Subject: Re: [RFC PATCH net-next] net: dsa: mt7530: support setting ageing time Message-ID: <20201120022540.GD1804098@lunn.ch> References: <20201119064020.19522-1-dqfext@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201119064020.19522-1-dqfext@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201119_212544_652234_78653E94 X-CRM114-Status: GOOD ( 14.22 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Landen Chao , Florian Fainelli , Frank Wunderlich , netdev@vger.kernel.org, Sean Wang , Russell King , "David S . Miller" , =?iso-8859-1?Q?Ren=E9?= van Dorst , Alex Dewar , Greg Ungerer , linux-mediatek@lists.infradead.org, Matthias Brugger , Jakub Kicinski , Vladimir Oltean , Chuanhong Guo , Vivien Didelot Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Thu, Nov 19, 2020 at 02:40:20PM +0800, DENG Qingfang wrote: > MT7530 has a global address age control register, so use it to set > ageing time. > > The applied timer is (AGE_CNT + 1) * (AGE_UNIT + 1) seconds > > Signed-off-by: DENG Qingfang > --- > drivers/net/dsa/mt7530.c | 41 ++++++++++++++++++++++++++++++++++++++++ > drivers/net/dsa/mt7530.h | 13 +++++++++++++ > 2 files changed, 54 insertions(+) > > RFC: > 1. What is the expected behaviour if the timer is too big or too small? > - return -ERANGE or -EINVAL; ERANGE is good. > or > - if it is too big, apply the maximum value; if it is too small, > disable learning; > > 2. Is there a better algorithm to find the closest pair? The bridge code will default to 300 seconds. And after a topology change, it sets it to 2 * the forwarding delay, which defaults to 15 seconds. So maybe you can look for these two values, and use pre-computed values? You still need to handle other values, the user can configure these. Andrew _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C29EC388F9 for ; Fri, 20 Nov 2020 02:26:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2397F2236F for ; Fri, 20 Nov 2020 02:26:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726824AbgKTCZp (ORCPT ); Thu, 19 Nov 2020 21:25:45 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:40352 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726172AbgKTCZo (ORCPT ); Thu, 19 Nov 2020 21:25:44 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kfw7I-008333-JR; Fri, 20 Nov 2020 03:25:40 +0100 Date: Fri, 20 Nov 2020 03:25:40 +0100 From: Andrew Lunn To: DENG Qingfang Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, Sean Wang , Landen Chao , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S . Miller" , Jakub Kicinski , Matthias Brugger , Russell King , =?iso-8859-1?Q?Ren=E9?= van Dorst , Frank Wunderlich , Greg Ungerer , Alex Dewar , Chuanhong Guo Subject: Re: [RFC PATCH net-next] net: dsa: mt7530: support setting ageing time Message-ID: <20201120022540.GD1804098@lunn.ch> References: <20201119064020.19522-1-dqfext@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201119064020.19522-1-dqfext@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Nov 19, 2020 at 02:40:20PM +0800, DENG Qingfang wrote: > MT7530 has a global address age control register, so use it to set > ageing time. > > The applied timer is (AGE_CNT + 1) * (AGE_UNIT + 1) seconds > > Signed-off-by: DENG Qingfang > --- > drivers/net/dsa/mt7530.c | 41 ++++++++++++++++++++++++++++++++++++++++ > drivers/net/dsa/mt7530.h | 13 +++++++++++++ > 2 files changed, 54 insertions(+) > > RFC: > 1. What is the expected behaviour if the timer is too big or too small? > - return -ERANGE or -EINVAL; ERANGE is good. > or > - if it is too big, apply the maximum value; if it is too small, > disable learning; > > 2. Is there a better algorithm to find the closest pair? The bridge code will default to 300 seconds. And after a topology change, it sets it to 2 * the forwarding delay, which defaults to 15 seconds. So maybe you can look for these two values, and use pre-computed values? You still need to handle other values, the user can configure these. Andrew