Skip to content

Commit 823e5cc

Browse files
vladimirolteankuba-moo
authored andcommitted
net: dsa: tag_sja1105: prefer precise source port info on SJA1110 too
Now that dsa_8021q_rcv() handles better the case where we don't overwrite the precise source information if it comes from an external (non-tag_8021q) source, we can now unify the call sequence between sja1105_rcv() and sja1110_rcv(). This is a preparatory change for creating a higher-level wrapper for the entire sequence which will live in tag_8021q. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Link: https://patch.msgid.link/20240713211620.1125910-6-paweldembicki@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0064b86 commit 823e5cc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

net/dsa/tag_sja1105.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,12 +652,12 @@ static struct sk_buff *sja1110_rcv(struct sk_buff *skb,
652652
if (likely(sja1105_skb_has_tag_8021q(skb)))
653653
dsa_8021q_rcv(skb, &source_port, &switch_id, &vbid, &vid);
654654

655-
if (vbid >= 1)
655+
if (source_port != -1 && switch_id != -1)
656+
skb->dev = dsa_conduit_find_user(netdev, switch_id, source_port);
657+
else if (vbid >= 1)
656658
skb->dev = dsa_tag_8021q_find_port_by_vbid(netdev, vbid);
657-
else if (source_port == -1 || switch_id == -1)
658-
skb->dev = dsa_find_designated_bridge_port_by_vid(netdev, vid);
659659
else
660-
skb->dev = dsa_conduit_find_user(netdev, switch_id, source_port);
660+
skb->dev = dsa_find_designated_bridge_port_by_vid(netdev, vid);
661661
if (!skb->dev) {
662662
netdev_warn(netdev, "Couldn't decode source port\n");
663663
return NULL;

0 commit comments

Comments
 (0)