Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / net / ieee8021q.h
blob8bfe903dd3d00fb432b32e3150d77f3a43d00f0c
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>
9 /**
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 {
23 IEEE8021Q_TT_BK = 0,
24 IEEE8021Q_TT_BE = 1,
25 IEEE8021Q_TT_EE = 2,
26 IEEE8021Q_TT_CA = 3,
27 IEEE8021Q_TT_VI = 4,
28 IEEE8021Q_TT_VO = 5,
29 IEEE8021Q_TT_IC = 6,
30 IEEE8021Q_TT_NC = 7,
32 /* private: */
33 IEEE8021Q_TT_MAX,
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);
43 #else
45 static inline int ietf_dscp_to_ieee8021q_tt(u8 dscp)
47 return -EOPNOTSUPP;
50 static inline int ieee8021q_tt_to_tc(enum ieee8021q_traffic_type tt,
51 unsigned int num_queues)
53 return -EOPNOTSUPP;
56 #endif
57 #endif /* _NET_IEEE8021Q_H */