Skip to content

Commit 0a5f14c

Browse files
ffainellidavem330
authored andcommitted
net: dsa: tag_brcm: Indicate to master netdevice port + queue
We need to tell the DSA master network device doing the actual transmission what the desired switch port and queue number is for it to resolve that to the internal transmit queue it is mapped to. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 60724d4 commit 0a5f14c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

include/net/dsa.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,4 +516,9 @@ static inline int call_dsa_notifiers(unsigned long val, struct net_device *dev,
516516
}
517517
#endif
518518

519+
/* Broadcom tag specific helpers to insert and extract queue/port number */
520+
#define BRCM_TAG_SET_PORT_QUEUE(p, q) ((p) << 8 | q)
521+
#define BRCM_TAG_GET_PORT(v) ((v) >> 8)
522+
#define BRCM_TAG_GET_QUEUE(v) ((v) & 0xff)
523+
519524
#endif

net/dsa/tag_brcm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ static struct sk_buff *brcm_tag_xmit(struct sk_buff *skb, struct net_device *dev
8686
brcm_tag[2] = BRCM_IG_DSTMAP2_MASK;
8787
brcm_tag[3] = (1 << p->dp->index) & BRCM_IG_DSTMAP1_MASK;
8888

89+
/* Now tell the master network device about the desired output queue
90+
* as well
91+
*/
92+
skb_set_queue_mapping(skb, BRCM_TAG_SET_PORT_QUEUE(p->dp->index,
93+
queue));
94+
8995
return skb;
9096
}
9197

0 commit comments

Comments
 (0)