]> git.itanic.dy.fi Git - linux-stable/commit
net: dsa: tag_sja1105: always prefer source port information from INCL_SRCPT
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 27 Jun 2023 09:42:07 +0000 (12:42 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 29 Jun 2023 12:41:26 +0000 (14:41 +0200)
commitc1ae02d876898b1b8ca1e12c6f84d7b406263800
tree71af8a29080c5b6dff822a95ac42f43e2115a711
parentb4638af8885af93cd70351081da1909c59342440
net: dsa: tag_sja1105: always prefer source port information from INCL_SRCPT

Currently the sja1105 tagging protocol prefers using the source port
information from the VLAN header if that is available, falling back to
the INCL_SRCPT option if it isn't. The VLAN header is available for all
frames except for META frames initiated by the switch (containing RX
timestamps), and thus, the "if (is_link_local)" branch is practically
dead.

The tag_8021q source port identification has become more loose
("imprecise") and will report a plausible rather than exact bridge port,
when under a bridge (be it VLAN-aware or VLAN-unaware). But link-local
traffic always needs to know the precise source port. With incorrect
source port reporting, for example PTP traffic over 2 bridged ports will
all be seen on sockets opened on the first such port, which is incorrect.

Now that the tagging protocol has been changed to make link-local frames
always contain source port information, we can reverse the order of the
checks so that we always give precedence to that information (which is
always precise) in lieu of the tag_8021q VID which is only precise for a
standalone port.

Fixes: d7f9787a763f ("net: dsa: tag_8021q: add support for imprecise RX based on the VBID")
Fixes: 91495f21fcec ("net: dsa: tag_8021q: replace the SVL bridging with VLAN-unaware IVL bridging")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/dsa/tag_sja1105.c