* [PATCH net v2] net: usb: lan78xx: disable VLAN filter in promiscuous mode
@ 2026-07-01 13:09 Enrico Pozzobon via B4 Relay
2026-07-02 11:36 ` Nicolai Buchwitz
0 siblings, 1 reply; 3+ messages in thread
From: Enrico Pozzobon via B4 Relay @ 2026-07-01 13:09 UTC (permalink / raw)
To: Thangaraj Samynathan, Rengarajan Sundararajan, UNGLinuxDriver,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Woojung.Huh
Cc: netdev, linux-usb, linux-kernel, Enrico Pozzobon
From: Enrico Pozzobon <enrico.pozzobon@dissecto.com>
The hardware VLAN filter (RFE_CTL_VLAN_FILTER_) drops VLAN-tagged frames
whose VID has not been registered via lan78xx_vlan_rx_add_vid(). It is
left enabled in promiscuous mode, so packet capture (e.g. tcpdump or
Wireshark) does not see tagged frames for unregistered VIDs.
Clear the filter while the interface is promiscuous and restore it from
NETIF_F_HW_VLAN_CTAG_FILTER otherwise. Enforce the same condition in
lan78xx_set_features() so netdev_update_features() cannot re-enable the
filter while promiscuous.
Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
Signed-off-by: Enrico Pozzobon <enrico.pozzobon@dissecto.com>
---
Currently, on microchip lan7801, enabling promiscuous mode does not
result in VLAN tagged packets being captured. This patch fixes this,
forcing the RFE_CTL_VLAN_FILTER_ flag to be off when promiscuous mode is
enabled.
---
Changes in v2:
- moved VLAN filter logic into lan78xx_update_vlan_filter()
- Link to v1: https://patch.msgid.link/20260630-lan78xx-vlan-promisc-v1-1-fbf0f903bd8f@dissecto.com
To: Thangaraj Samynathan <Thangaraj.S@microchip.com>
To: Rengarajan Sundararajan <Rengarajan.S@microchip.com>
To: UNGLinuxDriver@microchip.com
To: Andrew Lunn <andrew+netdev@lunn.ch>
To: "David S. Miller" <davem@davemloft.net>
To: Eric Dumazet <edumazet@google.com>
To: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
To: Woojung.Huh@microchip.com
Cc: netdev@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
drivers/net/usb/lan78xx.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index c4cebacabcb5..cb782d81d84f 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -1499,6 +1499,17 @@ static void lan78xx_deferred_multicast_write(struct work_struct *param)
return;
}
+static void lan78xx_update_vlan_filter(struct lan78xx_priv *pdata,
+ struct net_device *netdev,
+ netdev_features_t features)
+{
+ if ((features & NETIF_F_HW_VLAN_CTAG_FILTER) &&
+ !(netdev->flags & IFF_PROMISC))
+ pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_;
+ else
+ pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_;
+}
+
static void lan78xx_set_multicast(struct net_device *netdev)
{
struct lan78xx_net *dev = netdev_priv(netdev);
@@ -1533,6 +1544,8 @@ static void lan78xx_set_multicast(struct net_device *netdev)
}
}
+ lan78xx_update_vlan_filter(pdata, dev->net, dev->net->features);
+
if (netdev_mc_count(dev->net)) {
struct netdev_hw_addr *ha;
int i;
@@ -3074,10 +3087,7 @@ static int lan78xx_set_features(struct net_device *netdev,
else
pdata->rfe_ctl &= ~RFE_CTL_VLAN_STRIP_;
- if (features & NETIF_F_HW_VLAN_CTAG_FILTER)
- pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_;
- else
- pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_;
+ lan78xx_update_vlan_filter(pdata, netdev, features);
spin_unlock_irqrestore(&pdata->rfe_ctl_lock, flags);
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260623-lan78xx-vlan-promisc-83af8a48a7ec
Best regards,
--
Enrico Pozzobon <enrico.pozzobon@dissecto.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] net: usb: lan78xx: disable VLAN filter in promiscuous mode
2026-07-01 13:09 [PATCH net v2] net: usb: lan78xx: disable VLAN filter in promiscuous mode Enrico Pozzobon via B4 Relay
@ 2026-07-02 11:36 ` Nicolai Buchwitz
2026-07-03 9:25 ` Thangaraj.S
0 siblings, 1 reply; 3+ messages in thread
From: Nicolai Buchwitz @ 2026-07-02 11:36 UTC (permalink / raw)
To: enrico.pozzobon
Cc: Thangaraj Samynathan, Rengarajan Sundararajan, UNGLinuxDriver,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Woojung.Huh, netdev, linux-usb, linux-kernel
Hi Enrico
On 1.7.2026 15:09, Enrico Pozzobon via B4 Relay wrote:
> From: Enrico Pozzobon <enrico.pozzobon@dissecto.com>
>
> The hardware VLAN filter (RFE_CTL_VLAN_FILTER_) drops VLAN-tagged
> frames
> whose VID has not been registered via lan78xx_vlan_rx_add_vid(). It is
> left enabled in promiscuous mode, so packet capture (e.g. tcpdump or
> Wireshark) does not see tagged frames for unregistered VIDs.
>
> Clear the filter while the interface is promiscuous and restore it from
> NETIF_F_HW_VLAN_CTAG_FILTER otherwise. Enforce the same condition in
> lan78xx_set_features() so netdev_update_features() cannot re-enable the
> filter while promiscuous.
>
> Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000
> Ethernet device driver")
> Signed-off-by: Enrico Pozzobon <enrico.pozzobon@dissecto.com>
> ---
> Currently, on microchip lan7801, enabling promiscuous mode does not
> result in VLAN tagged packets being captured. This patch fixes this,
> forcing the RFE_CTL_VLAN_FILTER_ flag to be off when promiscuous mode
> is
> enabled.
> ---
> Changes in v2:
> - moved VLAN filter logic into lan78xx_update_vlan_filter()
> - Link to v1:
> https://patch.msgid.link/20260630-lan78xx-vlan-promisc-v1-1-fbf0f903bd8f@dissecto.com
>
> To: Thangaraj Samynathan <Thangaraj.S@microchip.com>
> To: Rengarajan Sundararajan <Rengarajan.S@microchip.com>
> To: UNGLinuxDriver@microchip.com
> To: Andrew Lunn <andrew+netdev@lunn.ch>
> To: "David S. Miller" <davem@davemloft.net>
> To: Eric Dumazet <edumazet@google.com>
> To: Jakub Kicinski <kuba@kernel.org>
> To: Paolo Abeni <pabeni@redhat.com>
> To: Woojung.Huh@microchip.com
> Cc: netdev@vger.kernel.org
> Cc: linux-usb@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
> drivers/net/usb/lan78xx.c | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index c4cebacabcb5..cb782d81d84f 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -1499,6 +1499,17 @@ static void
> lan78xx_deferred_multicast_write(struct work_struct *param)
> return;
> }
>
> +static void lan78xx_update_vlan_filter(struct lan78xx_priv *pdata,
> + struct net_device *netdev,
> + netdev_features_t features)
> +{
> + if ((features & NETIF_F_HW_VLAN_CTAG_FILTER) &&
> + !(netdev->flags & IFF_PROMISC))
> + pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_;
> + else
> + pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_;
> +}
> +
> static void lan78xx_set_multicast(struct net_device *netdev)
> {
> struct lan78xx_net *dev = netdev_priv(netdev);
> @@ -1533,6 +1544,8 @@ static void lan78xx_set_multicast(struct
> net_device *netdev)
> }
> }
>
> + lan78xx_update_vlan_filter(pdata, dev->net, dev->net->features);
> +
> if (netdev_mc_count(dev->net)) {
> struct netdev_hw_addr *ha;
> int i;
> @@ -3074,10 +3087,7 @@ static int lan78xx_set_features(struct
> net_device *netdev,
> else
> pdata->rfe_ctl &= ~RFE_CTL_VLAN_STRIP_;
>
> - if (features & NETIF_F_HW_VLAN_CTAG_FILTER)
> - pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_;
> - else
> - pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_;
> + lan78xx_update_vlan_filter(pdata, netdev, features);
>
> spin_unlock_irqrestore(&pdata->rfe_ctl_lock, flags);
>
>
> ---
> base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
> change-id: 20260623-lan78xx-vlan-promisc-83af8a48a7ec
>
> Best regards,
> --
> Enrico Pozzobon <enrico.pozzobon@dissecto.com>
AFAIU the findings from Sashiko [1] on v1 are either false positives or
pre-existing
issues unrelated to this change, so LGTM.
@Thangaraj / maintainers:
The mails to Rengarajan are bouncing since a few series - does the
MAINTAINERS entry need an update?
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
[1]
https://sashiko.dev/#/patchset/20260630-lan78xx-vlan-promisc-v1-1-fbf0f903bd8f%40dissecto.com
Thanks
Nicolai
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH net v2] net: usb: lan78xx: disable VLAN filter in promiscuous mode
2026-07-02 11:36 ` Nicolai Buchwitz
@ 2026-07-03 9:25 ` Thangaraj.S
0 siblings, 0 replies; 3+ messages in thread
From: Thangaraj.S @ 2026-07-03 9:25 UTC (permalink / raw)
To: nb, enrico.pozzobon
Cc: UNGLinuxDriver, andrew+netdev, davem, edumazet, kuba, pabeni,
Woojung.Huh, netdev, linux-usb, linux-kernel
Hi Nicolai,
> AFAIU the findings from Sashiko [1] on v1 are either false positives or pre-
> existing issues unrelated to this change, so LGTM.
>
> @Thangaraj / maintainers:
> The mails to Rengarajan are bouncing since a few series - does the
> MAINTAINERS entry need an update?
>
[Thangaraj Samynathan] Yes, Rengarajan has left Microchip. His name needs
to be removed from maintainer.
> Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
>
Thanks,
Thangaraj Samynathan - I53494
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-03 9:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 13:09 [PATCH net v2] net: usb: lan78xx: disable VLAN filter in promiscuous mode Enrico Pozzobon via B4 Relay
2026-07-02 11:36 ` Nicolai Buchwitz
2026-07-03 9:25 ` Thangaraj.S
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox