From: Hangbin Liu <hangbin.liu@linux.dev>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Jiale Yao <yaojiale02@163.com>, Jiri Pirko <jiri@resnulli.us>,
Oleksij Rempel <o.rempel@pengutronix.de>,
Stephen Hemminger <stephen@networkplumber.org>,
netdev@vger.kernel.org, Jay Vosburgh <jv@jvosburgh.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Alexandra Winter <wintera@linux.ibm.com>,
Aswin Karuvally <aswin@linux.ibm.com>
Subject: Re: [PATCH net] net: do not bond/team netdevices which use ml_priv
Date: Thu, 20 Aug 2026 11:23:59 +0800 [thread overview]
Message-ID: <aoZzT1WoDGHpyvps@fedora> (raw)
In-Reply-To: <15ea29f5-7154-4bf9-baff-88f4b6477722@hartkopp.net>
On Wed, Aug 19, 2026 at 08:15:42PM +0200, Oliver Hartkopp wrote:
> Hi Hangbin, all,
>
> thanks for your feedback!
>
> In fact checking for dev->ml_priv != NULL seems to be too hard and would
> likely create some breaking setups.
>
> I have sent a patch on the Linux-CAN ML that makes the CAN subsystem robust
> against alien ARPHRD_CAN interfaces that might be created by TUN/TAP via
> TUNSETLINK ioctl:
>
> https://lore.kernel.org/linux-can/20260819160822.8256-1-socketcan@hartkopp.net/
>
> The other question remains how to make bonding/team keep the fingers away
> from incompatible net devices.
>
> The current black listing approach from Jiale Yao (using a unified helper as
> suggested by Jiri Pirko) seems to be the best way to go now:
>
> https://lore.kernel.org/netdev/20260728151240.89434-1-yaojiale02@163.com/
>
> + if (port_dev->type == ARPHRD_CAN ||
> + port_dev->type == ARPHRD_IEEE802154 ||
> + port_dev->type == ARPHRD_IEEE802154_MONITOR) {
> + NL_SET_ERR_MSG(extack,
> + "CAN and IEEE 802.15.4 devices can't be added as a team port");
> + netdev_err(dev, "Device %s is CAN or IEEE 802.15.4. These device types
> can't be added as a team port\n",
> + portname);
> + return -EINVAL;
> + }
> + }
> +
This looks good to me to avoid making the checking to wide.
>
> There might be other dev->types (e.g. ARPHRD_ARCNET) or a future white list
> approach this unified helper could support. For either team and bonding!
>
> @Jiale Yao: What would be a good name for such helper in
> include/linux/if_arp.h ?
>
> dev_is_not_ether_compatible(const struct net_device *dev)
> dev_is_ether_compatible(const struct net_device *dev)
> dev_has_special_l2_proto(const struct net_device *dev)
> dev_has_l2_proto(const struct net_device *dev)
> dev_is_pure_packet_bus(const struct net_device *dev)
>
> or something like this?
I'm not good at naming. Leave it to you.
Thanks for your works!
Hangbin
next prev parent reply other threads:[~2026-08-20 3:24 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 [this message]
2026-08-20 8:29 ` Alexandra Winter
2026-08-20 11:06 ` Oliver Hartkopp
2026-08-21 1:46 ` Hangbin Liu
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=aoZzT1WoDGHpyvps@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=o.rempel@pengutronix.de \
--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