From: Hangbin Liu <hangbin.liu@linux.dev>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Alexandra Winter <wintera@linux.ibm.com>,
Stephen Hemminger <stephen@networkplumber.org>,
netdev@vger.kernel.org, Jiri Pirko <jiri@resnulli.us>,
Jay Vosburgh <jv@jvosburgh.net>, Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Jiale Yao <yaojiale02@163.com>,
Aswin Karuvally <aswin@linux.ibm.com>
Subject: Re: [PATCH net] net: do not bond/team netdevices which use ml_priv
Date: Fri, 21 Aug 2026 09:46:17 +0800 [thread overview]
Message-ID: <aoet6aHyJI5lGNOX@fedora> (raw)
In-Reply-To: <9e3e44ac-8725-4372-af4b-e5092c8a3810@hartkopp.net>
Hi Oliver,
On Thu, Aug 20, 2026 at 01:06:18PM +0200, Oliver Hartkopp wrote:
> Hi Alexandra,
> > > How would bonding modify dev->ml_priv?
> >
> > Could you give more information about this?
> > I hope there is no issue for qeth_l2. There we use and rely on dev->ml_priv.
> >
>
> I did some more investigation on all this.
>
> There are 5 drivers that are using ml_priv:
>
> - qeth
> - ctcm
> - cxgb2
> - i596
> - wilc1000
>
> where qeth and i596 are using it to store a single pointer which can also be
> done by adding this pointer to their netdev_priv structure.
>
> wilc1000 assigns ml_priv and never reads from it (development leftover).
>
> Only cxgb2 and ctcm use it in a more complex way that would make it tricky
> to move its functionality into netdev_priv without having real hardware on
> the desk.
>
> Either team and bonding do not fiddle with ml_priv on their own. But they
> make assumptions that best fit to ethernet devices where they don't care
> about nor copy any ml_priv pointers.
>
> This caused a problem on CAN devices that were not created by the CAN driver
> infrastructure (creating proper ml_priv content). When TUN/TAP set the
> dev->type of an ethernet device to ARPHRD_CAN the CAN ml_priv is NULL (not
> initialized).
I don't know why a user change the tun/tap dev->type to CAN. Can they work
together? If it's a miss config, I think we can just leave it since we already
block CAN slave.
>
> Long story short:
>
> The ml_priv assignment in wilc100 can be removed.
> For ethernet devices like the qeth there's no problem AFAICS.
> But I would think about making use of netdev_priv() there:
[...]
>
> The final question (which is not really a ml_priv issue) is how to tell
> team/bonding which netdevices are not capable to be used by them. To cover
> e.g. your ctcm driver using ARPHRD_SLIP.
>
> The current check (bond_dev->type != slave_dev->type) would allow to join
> two type-identical interfaces, which was at least not a good idea for CAN.
> For that reason we already check (slave_dev->type == ARPHRD_CAN) there.
> Other dev->types might follow.
>
> Not sure if collecting a bunch of ARPHRD values is the right approach or
> whether team/bonding should check required features and settings (like IFF
> flags, e.g. IFF_ARP or specific address length)?
Bond supports none arp devices. It also supports infiniband devices. So we
can't check it with IFF_ARP or address length.
From my perspective, we can keep the existing check as it only causes issues
with CAN devices. We can work out a better solution if more incompatible
devices are found under bond/team.
Thanks
Hangbin
next prev parent reply other threads:[~2026-08-21 1:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-15 15:39 [PATCH net] net: do not bond/team netdevices which use ml_priv Oliver Hartkopp
2026-08-15 16:00 ` Stephen Hemminger
2026-08-15 17:23 ` Oliver Hartkopp
2026-08-18 10:12 ` Hangbin Liu
2026-08-18 13:25 ` Oliver Hartkopp
2026-08-19 9:12 ` Hangbin Liu
2026-08-19 18:15 ` Oliver Hartkopp
2026-08-20 3:23 ` Hangbin Liu
2026-08-20 8:29 ` Alexandra Winter
2026-08-20 11:06 ` Oliver Hartkopp
2026-08-21 1:46 ` Hangbin Liu [this message]
2026-08-21 11:17 ` Oliver Hartkopp
2026-08-21 13:01 ` Hangbin Liu
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=aoet6aHyJI5lGNOX@fedora \
--to=hangbin.liu@linux.dev \
--cc=aswin@linux.ibm.com \
--cc=jiri@resnulli.us \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=socketcan@hartkopp.net \
--cc=stephen@networkplumber.org \
--cc=wintera@linux.ibm.com \
--cc=yaojiale02@163.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