1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2024 Pengutronix, Oleksij Rempel <kernel@pengutronix.de> */
4 #ifndef _NET_IEEE8021Q_H
5 #define _NET_IEEE8021Q_H
7 #include <linux/errno.h>
10 * enum ieee8021q_traffic_type - 802.1Q traffic type priority values (802.1Q-2022)
12 * @IEEE8021Q_TT_BK: Background
13 * @IEEE8021Q_TT_BE: Best Effort (default). According to 802.1Q-2022, BE is 0
14 * but has higher priority than BK which is 1.
15 * @IEEE8021Q_TT_EE: Excellent Effort
16 * @IEEE8021Q_TT_CA: Critical Applications
17 * @IEEE8021Q_TT_VI: Video, < 100 ms latency and jitter
18 * @IEEE8021Q_TT_VO: Voice, < 10 ms latency and jitter
19 * @IEEE8021Q_TT_IC: Internetwork Control
20 * @IEEE8021Q_TT_NC: Network Control
22 enum ieee8021q_traffic_type
{
36 #define SIMPLE_IETF_DSCP_TO_IEEE8021Q_TT(dscp) ((dscp >> 3) & 0x7)
38 #if IS_ENABLED(CONFIG_NET_IEEE8021Q_HELPERS)
40 int ietf_dscp_to_ieee8021q_tt(u8 dscp
);
41 int ieee8021q_tt_to_tc(enum ieee8021q_traffic_type tt
, unsigned int num_queues
);
45 static inline int ietf_dscp_to_ieee8021q_tt(u8 dscp
)
50 static inline int ieee8021q_tt_to_tc(enum ieee8021q_traffic_type tt
,
51 unsigned int num_queues
)
57 #endif /* _NET_IEEE8021Q_H */