Hello Andrew, > -----Original Message----- > From: Andrew Lunn <andrew@xxxxxxx> > Sent: Monday, July 7, 2025 1:54 PM > To: Michael Dege <michael.dege@xxxxxxxxxxx> > Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>; Niklas Söderlund > <niklas.soderlund@xxxxxxxxxxxx>; Paul Barker <paul@xxxxxxxxxxx>; Andrew Lunn <andrew+netdev@xxxxxxx>; > David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>; Jakub Kicinski > <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; linux-renesas- > soc@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Nikita Yushchenko <nikita.yoush@xxxxxxxxxxxxxxxxxx> > Subject: Re: [PATCH 0/3] net: renesas: rswitch: R-Car S4 add HW offloading for layer 2 switching > > > There is a discrepancy between the value being passed by iproute2 and > > brctl. Iproute2 passes the value unaltered in seconds and brctl passes > > the value in seconds multiplied by 100. So far this is OK because > > brctl is deprecated. But the default value being passed when neither > > brctl is called nor the ageing parameter is added when the bridge is created is also multiplied by > 100 resulting in 30000s being set as default ageing time instead of 300s. Is this a known issue? > > You need to be careful of 100. It is probably the value of HZ you are using. This means it is probably > in jiffies. > > It could be whoever added support to DSA was using HZ = 1000, and so assumed it has milliseconds, not > jiffies, and the API is broken. > > If you have time, could you dig into this. Trace there where jiffies are used, seconds, and what > conversions are preformed, for the default values, netlink API and sysfs API. Once we know where it > goes wrong, we can figure out how to fix it. > > Andrew I poked around and it looks to me that the issue is in the default value: Include/linux/if_bridge.h#65; #define BR_DEFAULT_AGEING_TIME (300 * HZ) In our case HZ is 100. And the issue is only seen when no other value has been set. (fresh boot) Both sysfs API and netlink API produce the same values. That is the value received in switchdev_attr->u.stp_state is presented unaltered. ip link change dev br type bridge ageing 10 and echo 10 > /sys/class/net/br/bridge/ageing_time Both result in a "10" being passed in switchdev_attr->u.stp_state. Best regards, Michael ________________________________ Renesas Electronics Europe GmbH Registered Office: Arcadiastrasse 10 DE-40472 Duesseldorf Commercial Registry: Duesseldorf, HRB 3708 Managing Director: Carsten Jauch VAT-No.: DE 14978647 Tax-ID-No: 105/5839/1793 Legal Disclaimer: This e-mail communication (and any attachment/s) is confidential and contains proprietary information, some or all of which may be legally privileged. It is intended solely for the use of the individual or entity to which it is addressed. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.