aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/dsa/tag_8021q.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/net/dsa/tag_8021q.c b/net/dsa/tag_8021q.c
index 8ae48c7e1e76..4adec6bbfe59 100644
--- a/net/dsa/tag_8021q.c
+++ b/net/dsa/tag_8021q.c
@@ -128,10 +128,7 @@ int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int port, bool enabled)
128 u16 flags; 128 u16 flags;
129 129
130 if (i == upstream) 130 if (i == upstream)
131 /* CPU port needs to see this port's RX VID 131 continue;
132 * as tagged egress.
133 */
134 flags = 0;
135 else if (i == port) 132 else if (i == port)
136 /* The RX VID is pvid on this port */ 133 /* The RX VID is pvid on this port */
137 flags = BRIDGE_VLAN_INFO_UNTAGGED | 134 flags = BRIDGE_VLAN_INFO_UNTAGGED |
@@ -150,6 +147,20 @@ int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int port, bool enabled)
150 return err; 147 return err;
151 } 148 }
152 } 149 }
150
151 /* CPU port needs to see this port's RX VID
152 * as tagged egress.
153 */
154 if (enabled)
155 err = dsa_port_vid_add(upstream_dp, rx_vid, 0);
156 else
157 err = dsa_port_vid_del(upstream_dp, rx_vid);
158 if (err) {
159 dev_err(ds->dev, "Failed to apply RX VID %d to port %d: %d\n",
160 rx_vid, port, err);
161 return err;
162 }
163
153 /* Finally apply the TX VID on this port and on the CPU port */ 164 /* Finally apply the TX VID on this port and on the CPU port */
154 if (enabled) 165 if (enabled)
155 err = dsa_port_vid_add(dp, tx_vid, BRIDGE_VLAN_INFO_UNTAGGED); 166 err = dsa_port_vid_add(dp, tx_vid, BRIDGE_VLAN_INFO_UNTAGGED);