netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: DENG Qingfang <dqfext@gmail.com>
Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"René van Dorst" <opensource@vdorst.com>,
	"Frank Wunderlich" <frank-w@public-files.de>,
	"Greg Ungerer" <gerg@kernel.org>,
	"Alex Dewar" <alex.dewar90@gmail.com>,
	"Chuanhong Guo" <gch981213@gmail.com>
Subject: Re: [RFC PATCH net-next] net: dsa: mt7530: support setting ageing time
Date: Fri, 20 Nov 2020 03:25:40 +0100	[thread overview]
Message-ID: <20201120022540.GD1804098@lunn.ch> (raw)
In-Reply-To: <20201119064020.19522-1-dqfext@gmail.com>

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 <dqfext@gmail.com>
> ---
>  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

  reply	other threads:[~2020-11-20  2:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19  6:40 [RFC PATCH net-next] net: dsa: mt7530: support setting ageing time DENG Qingfang
2020-11-20  2:25 ` Andrew Lunn [this message]
2020-11-20  3:37   ` DENG Qingfang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201120022540.GD1804098@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Landen.Chao@mediatek.com \
    --cc=alex.dewar90@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=frank-w@public-files.de \
    --cc=gch981213@gmail.com \
    --cc=gerg@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=opensource@vdorst.com \
    --cc=sean.wang@mediatek.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).