Skip to content

Commit ed923da

Browse files
jukkarAnas Nashif
authored andcommitted
drivers: net: mcux: Use VLAN priority to set RX packet priority
Set the received network packet priority according to VLAN priority. Currently this mapping is 1:1 but can be changed if needed. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent ad5bbef commit ed923da

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/ethernet/eth_mcux.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,16 @@ static void eth_rx(struct device *iface)
499499

500500
net_pkt_set_vlan_tci(pkt, ntohs(hdr_vlan->vlan.tci));
501501
vlan_tag = net_pkt_vlan_tag(pkt);
502+
503+
#if CONFIG_NET_TC_RX_COUNT > 1
504+
{
505+
enum net_priority prio;
506+
507+
prio = net_vlan2priority(
508+
net_pkt_vlan_priority(pkt));
509+
net_pkt_set_priority(pkt, prio);
510+
}
511+
#endif
502512
}
503513
}
504514
#endif

0 commit comments

Comments
 (0)