On Wed, Dec 09, 2020 at 04:21:31PM +0100, Tobias Waldekranz wrote: > On Wed, Dec 09, 2020 at 15:27, Andrew Lunn <and...@lunn.ch> wrote: > >> I disagree. A LAG is one type of netdev that a DSA port can offload. The > >> other one is the DSA port's own netdev, i.e. what we have had since time > >> immemorial. > >> > >> dsa_port_offloads_netdev(dp, dev)? > > > > That is better. > > ...but there is an even better one?
Not that comes to mind. > > > But a comment explaining what the function does might > > be useful. > > This is the function body: > > /* Switchdev offloading can be configured on: */ > > if (dev == dp->slave) > /* DSA ports directly connected to a bridge. */ > return true; > > if (dp->lag && dev == dp->lag->dev) > /* DSA ports connected to a bridge via a LAG */ > return true; > > return false; > > What more is there to explain? OK, you are right. It is well commented as is. Just change the name and we are good. Andrew