Skip to content

Commit 5afe4cc

Browse files
vladimirolteankuba-moo
authored andcommitted
net: dsa: tag_rtl8_4: use the dsa_xmit_port_mask() helper
The "rtl8_4" and "rtl8_4t" tagging protocols populate a bit mask for the TX ports, so we can use dsa_xmit_port_mask() to centralize the decision of how to set that field. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: "Alvin Šipraga" <alsi@bang-olufsen.dk> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20251127120902.292555-12-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 4abf39c commit 5afe4cc

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

net/dsa/tag_rtl8_4.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
static void rtl8_4_write_tag(struct sk_buff *skb, struct net_device *dev,
104104
void *tag)
105105
{
106-
struct dsa_port *dp = dsa_user_to_port(dev);
107106
__be16 tag16[RTL8_4_TAG_LEN / 2];
108107

109108
/* Set Realtek EtherType */
@@ -116,7 +115,7 @@ static void rtl8_4_write_tag(struct sk_buff *skb, struct net_device *dev,
116115
tag16[2] = htons(FIELD_PREP(RTL8_4_LEARN_DIS, 1));
117116

118117
/* Zero ALLOW; set RX (CPU->switch) forwarding port mask */
119-
tag16[3] = htons(FIELD_PREP(RTL8_4_RX, BIT(dp->index)));
118+
tag16[3] = htons(FIELD_PREP(RTL8_4_RX, dsa_xmit_port_mask(skb, dev)));
120119

121120
memcpy(tag, tag16, RTL8_4_TAG_LEN);
122121
}

0 commit comments

Comments
 (0)