🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Hungyu Lin Sun, 15 Nov 2026 08:53
[PATCH net-next v2] vlan: remove MII ioctl forwarding
#16579
Author: Hungyu Lin
Date: Sun, 15 Nov 2026 08:53
67 lines
12967 bytes
VLAN devices forward SIOCGMIIPHY, SIOCGMIIREG and SIOCSMIIREG to the
lower device. This exposes the lower device's PHY through the VLAN
even when the two devices are in different network namespaces.

Bonding used MII ioctls as a fallback for link monitoring. Commit
23a6037ce76c ("bonding: Remove support for use_carrier") removed
that fallback.

Remove vlan_dev_ioctl() and its ndo_eth_ioctl hook so MII ioctls on
VLAN devices return -EOPNOTSUPP. Applications that need PHY access
can issue these ioctls on the lower device.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
v2:
  - Remove MII ioctl forwarding entirely and target net-next.
v1: https://lore.kernel.org/netdev/20261106124639.12584-1-dennylin0707@gmail.com/

 net/8021q/vlan_dev.c | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index bca0a3693636..cff36d3fc6c8 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -406,29 +406,6 @@ static int vlan_hwtstamp_set(struct net_device *dev,
 	return generic_hwtstamp_set_lower(real_dev, cfg, extack);
 }
 
-static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
-{
-	struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
-	struct ifreq ifrr;
-	int err = -EOPNOTSUPP;
-
-	strscpy_pad(ifrr.ifr_name, real_dev->name, IFNAMSIZ);
-	ifrr.ifr_ifru = ifr->ifr_ifru;
-
-	switch (cmd) {
-	case SIOCGMIIPHY:
-	case SIOCGMIIREG:
-	case SIOCSMIIREG:
-		err = dev_eth_ioctl(real_dev, &ifrr, cmd);
-		break;
-	}
-
-	if (!err)
-		ifr->ifr_ifru = ifrr.ifr_ifru;
-
-	return err;
-}
-
 static int vlan_dev_neigh_setup(struct net_device *dev, struct neigh_parms *pa)
 {
 	struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
@@ -1105,7 +1082,6 @@ static const struct net_device_ops vlan_netdev_ops = {
 	.ndo_set_rx_mode	= vlan_dev_set_rx_mode,
 	.ndo_change_rx_flags	= vlan_dev_change_rx_flags,
 	.ndo_work		= vlan_dev_work,
-	.ndo_eth_ioctl		= vlan_dev_ioctl,
 	.ndo_neigh_setup	= vlan_dev_neigh_setup,
 	.ndo_get_stats64	= vlan_dev_get_stats64,
 #if IS_ENABLED(CONFIG_FCOE)

base-commit: d1f4b7c6b997c29de67ad7178ababac2328cb1b4
Re: [PATCH net-next v2] vlan: remove MII ioctl forwarding
#18226
Author: patchwork-bot+netdevbpf
Date: Wed, 18 Nov 2026 01:40
25 lines
8689 bytes
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sun, 15 Nov 2026 08:53:43 +0000 you wrote:
> VLAN devices forward SIOCGMIIPHY, SIOCGMIIREG and SIOCSMIIREG to the
> lower device. This exposes the lower device's PHY through the VLAN
> even when the two devices are in different network namespaces.
> 
> Bonding used MII ioctls as a fallback for link monitoring. Commit
> 23a6037ce76c ("bonding: Remove support for use_carrier") removed
> that fallback.
> 
> [...]

Here is the summary with links:
  - [net-next,v2] vlan: remove MII ioctl forwarding
    https://git.kernel.org/netdev/net-next/c/fbf9026e3503

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads