From: Daniel Golle <daniel@makrotopia.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
Russell King <linux@armlinux.org.uk>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Frank Wunderlich <frankwu@gmx.de>, Chad Monroe <chad@monroe.io>,
Cezary Wilmanski <cezary.wilmanski@adtran.com>,
Liang Xu <lxu@maxlinear.com>,
"Benny (Ying-Tsan) Weng" <yweng@maxlinear.com>,
Jose Maria Verdu Munoz <jverdu@maxlinear.com>,
Avinash Jayaraman <ajayaraman@maxlinear.com>,
John Crispin <john@phrozen.org>
Subject: Re: [PATCH net-next v5 2/2] net: dsa: mxl862xx: implement bridge offloading
Date: Thu, 19 Mar 2026 12:15:39 +0000 [thread overview]
Message-ID: <abvo67rR_a-bPCkW@makrotopia.org> (raw)
In-Reply-To: <fe46d64b-1b12-48b6-b663-e7d5122b7b8a@redhat.com>
On Thu, Mar 19, 2026 at 09:57:42AM +0100, Paolo Abeni wrote:
> On 3/15/26 5:20 PM, Daniel Golle wrote:
> > (struct dsa_switch *ds, int port,
> > + struct dsa_bridge bridge,
> > + bool *tx_fwd_offload,
> > + struct netlink_ext_ack *extack)
> > +{
> > + struct mxl862xx_priv *priv = ds->priv;
> > + struct mxl862xx_bridge *mxlbridge;
> > +
> > + mxlbridge = mxl862xx_find_bridge(ds, bridge);
> > + if (!mxlbridge) {
> > + mxlbridge = mxl862xx_allocate_bridge(ds, bridge.num);
> > + if (IS_ERR(mxlbridge))
> > + return PTR_ERR(mxlbridge);
> > + }
> > +
> > + __set_bit(port, mxlbridge->portmap);
>
> AFAICS mxl862xx_bridge role is to track the above portmap, which in turn
> looks like a quite generic information which could be easily tracked by
> the DSA core. I'm wondering if it would be useful to move implement
> tracking there, and remove the mxl862xx_bridge entirely.
DSA generally uses unsigned int as port ID, however, 500MB of a bitmap
seems excessive to cover the full 32-bit range. 256-bit would be
more than sufficient (u8 range), or the 128-bit (positive s8 range)
the firmware of MxL862xx also uses...
So what should be the size of the to-be-defined generic DSA portmap?
Or should tracking happen internally using other (dynamic) structures
(eg. link list) and we provide a helper taking a driver-allocated
bitmap and its size as parameters?
The to-be-invented tracking structure should also come with a priv
pointer which can be used by the driver to (in this case) track the
firmware-assigned bridge ID as well.
Alternatively, instead of inventing a new structure, the driver could
iterate over dsa_ports which carries a pointer to dsa_bridge, and we
could just extend dsa_bridge to contain a priv pointer which allows
drivers to track what ever they want together with the DSA bridge.
Let me know what you think.
prev parent reply other threads:[~2026-03-19 12:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-15 16:20 [PATCH net-next v5 0/2] net: dsa: mxl862xx: add support for bridge offloading Daniel Golle
2026-03-15 16:20 ` [PATCH net-next v5 1/2] dsa: tag_mxl862xx: set dsa_default_offload_fwd_mark() Daniel Golle
2026-03-15 16:20 ` [PATCH net-next v5 2/2] net: dsa: mxl862xx: implement bridge offloading Daniel Golle
2026-03-19 8:51 ` Paolo Abeni
2026-03-19 11:56 ` Daniel Golle
2026-03-19 8:57 ` Paolo Abeni
2026-03-19 12:15 ` Daniel Golle [this message]
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=abvo67rR_a-bPCkW@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=ajayaraman@maxlinear.com \
--cc=andrew@lunn.ch \
--cc=cezary.wilmanski@adtran.com \
--cc=chad@monroe.io \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=frankwu@gmx.de \
--cc=horms@kernel.org \
--cc=john@phrozen.org \
--cc=jverdu@maxlinear.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lxu@maxlinear.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=yweng@maxlinear.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.