• Vladimir Oltean's avatar
    net: enetc: don't disable VLAN filtering in IFF_PROMISC mode · a74dbce9
    Vladimir Oltean authored
    Quoting from the blamed commit:
    
        In promiscuous mode, it is more intuitive that all traffic is received,
        including VLAN tagged traffic. It appears that it is necessary to set
        the flag in PSIPVMR for that to be the case, so VLAN promiscuous mode is
        also temporarily enabled. On exit from promiscuous mode, the setting
        made by ethtool is restored.
    
    Intuitive or not, there isn't any definition issued by a standards body
    which says that promiscuity has anything to do with VLAN filtering - it
    only has to do with accepting packets regardless of destination MAC address.
    
    In fact people are already trying to use this misunderstanding/bug of
    the enetc driver as a justification to transform promiscuity into
    something it never was about: accepting every packet (maybe that would
    be the "rx-all" netdev feature?):
    https://lore.kernel.org/netdev/20201110153958.ci5ekor3o2ekg3ky@ipetronik.com/
    
    This is relevant because there are use cases in the kernel (such as
    tc-flower rules with the protocol 802.1Q and a vlan_id key) which do not
    (yet) use the vlan_vid_add API to be compatible with VLAN-filtering NICs
    such as enetc, so for those, disabling rx-vlan-filter is currently the
    only right solution to make these setups work:
    https://lore.kernel.org/netdev/CA+h21hoxwRdhq4y+w8Kwgm74d4cA0xLeiHTrmT-VpSaM7obhkg@mail.gmail.com/
    The blamed patch has unintentionally introduced one more way for this to
    work, which is to enable IFF_PROMISC, however this is non-portable
    because port promiscuity is not meant to disable VLAN filtering.
    Therefore, it could invite people to write broken scripts for enetc, and
    then wonder why they are broken when migrating to other drivers that
    don't handle promiscuity in the same way.
    
    Fixes: 7070eea5 ("enetc: permit configuration of rx-vlan-filter with ethtool")
    Cc: Markus Blöchl <Markus.Bloechl@ipetronik.com>
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a74dbce9
enetc_pf.c 29.7 KB