Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: tag_mtk: use the dsa_xmit_port_mask() helper

The "mtk" tagging protocol populates 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: Chester A. Unal" <chester.a.unal@arinc9.com>
Cc: Daniel Golle <daniel@makrotopia.org>
Cc: DENG Qingfang <dqfext@gmail.com>
Cc: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20251127120902.292555-7-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Vladimir Oltean and committed by
Jakub Kicinski
84a60bbe ea659a92

+2 -1
+2 -1
net/dsa/tag_mtk.c
··· 54 54 * whether that's a combined special tag with 802.1Q header. 55 55 */ 56 56 mtk_tag[0] = xmit_tpid; 57 - mtk_tag[1] = (1 << dp->index) & MTK_HDR_XMIT_DP_BIT_MASK; 57 + mtk_tag[1] = FIELD_PREP(MTK_HDR_XMIT_DP_BIT_MASK, 58 + dsa_xmit_port_mask(skb, dev)); 58 59 59 60 /* Tag control information is kept for 802.1Q */ 60 61 if (xmit_tpid == MTK_HDR_XMIT_UNTAGGED) {