@@ -2912,6 +2912,8 @@ static int sja1105_setup(struct dsa_switch *ds)
ds->mtu_enforcement_ingress = true;
+ ds->disable_master_rxvlan = true;
+
ds->configure_vlan_while_not_filtering = true;
rc = sja1105_setup_devlink_params(ds);
@@ -299,6 +299,9 @@ struct dsa_switch {
*/
bool pcs_poll;
+ /* Necessary for tagging protocols such as tag_8021q. */
+ bool disable_master_rxvlan;
+
/* For switches that only have the MRU configurable. To ensure the
* configured MTU is not exceeded, normalization of MRU on all bridged
* interfaces is needed.
@@ -197,6 +197,18 @@ static int dsa_master_get_phys_port_name(struct net_device *dev,
return 0;
}
+static netdev_features_t dsa_master_fix_features(struct net_device *dev,
+ netdev_features_t features)
+{
+ struct dsa_port *cpu_dp = dev->dsa_ptr;
+ struct dsa_switch *ds = cpu_dp->ds;
+
+ if (ds->disable_master_rxvlan)
+ features &= ~NETIF_F_HW_VLAN_CTAG_RX;
+
+ return features;
+}
+
static int dsa_master_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct dsa_port *cpu_dp = dev->dsa_ptr;
@@ -278,6 +290,7 @@ static int dsa_master_ndo_setup(struct net_device *dev)
memcpy(ops, cpu_dp->orig_ndo_ops, sizeof(*ops));
ops->ndo_get_phys_port_name = dsa_master_get_phys_port_name;
+ ops->ndo_fix_features = dsa_master_fix_features;
ops->ndo_do_ioctl = dsa_master_ioctl;
dev->netdev_ops = ops;