Skip to content

Commit 6643bb0

Browse files
jukkarAnas Nashif
authored andcommitted
net: l2: ethernet: Add priority to sent ethernet VLAN header
When sending packet add the VLAN priority to the ethernet header. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 2c343d2 commit 6643bb0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

subsys/net/ip/l2/ethernet.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,16 @@ static enum net_verdict set_vlan_tag(struct ethernet_context *ctx,
303303

304304
return NET_DROP;
305305
}
306+
307+
static void set_vlan_priority(struct ethernet_context *ctx,
308+
struct net_pkt *pkt)
309+
{
310+
/* FIXME: Currently just convert packet priority to VLAN
311+
* priority. This needs to be fixed as VLAN priority is not necessarily
312+
* the same as packet priority.
313+
*/
314+
net_pkt_set_vlan_priority(pkt, net_pkt_priority(pkt));
315+
}
306316
#endif /* CONFIG_NET_VLAN */
307317

308318
struct net_eth_hdr *net_eth_fill_header(struct ethernet_context *ctx,
@@ -477,6 +487,8 @@ static enum net_verdict ethernet_send(struct net_if *iface,
477487
if (set_vlan_tag(ctx, iface, pkt) == NET_DROP) {
478488
return NET_DROP;
479489
}
490+
491+
set_vlan_priority(ctx, pkt);
480492
}
481493
#endif /* CONFIG_NET_VLAN */
482494

0 commit comments

Comments
 (0)