Thread (22 messages) flat view 22 messages, 5 authors, 2025-07-07

RE: [PATCH 0/3] net: renesas: rswitch: R-Car S4 add HW offloading for layer 2 switching

From: Michael Dege <hidden>
Date: 2025-07-07 12:25:15
Also in: linux-renesas-soc, lkml

Hello Andrew,

-----Original Message-----
From: Andrew Lunn <andrew@lunn.ch>
Sent: Monday, July 7, 2025 1:54 PM
To: Michael Dege <redacted>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>; Niklas Söderlund
[off-list ref]; Paul Barker [off-list ref]; Andrew Lunn [off-list ref];
David S. Miller [off-list ref]; Eric Dumazet [off-list ref]; Jakub Kicinski
[off-list ref]; Paolo Abeni [off-list ref]; netdev@vger.kernel.org; linux-renesas-
soc@vger.kernel.org; linux-kernel@vger.kernel.org; Nikita Yushchenko [off-list ref]
Subject: Re: [PATCH 0/3] net: renesas: rswitch: R-Car S4 add HW offloading for layer 2 switching
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help