Re: [PATCH net-next v6 3/9] net: add IEEE 802.1q specific helpers

From: Simon Horman
Date: Thu Apr 11 2024 - 07:47:55 EST


On Wed, Apr 10, 2024 at 10:05:50AM +0200, Oleksij Rempel wrote:
> IEEE 802.1q specification provides recommendation and examples which can
> be used as good default values for different drivers.
>
> This patch implements mapping examples documented in IEEE 802.1Q-2022 in
> Annex I "I.3 Traffic type to traffic class mapping" and IETF DSCP naming
> and mapping DSCP to Traffic Type inspired by RFC8325.
>
> This helpers will be used in followup patches for dsa/microchip DCB
> implementation.
>
> Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>

..

> diff --git a/include/net/ieee8021q.h b/include/net/ieee8021q.h
> new file mode 100644
> index 0000000000000..3bec7ec951362
> --- /dev/null
> +++ b/include/net/ieee8021q.h
> @@ -0,0 +1,55 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/* Copyright (c) 2024 Pengutronix, Oleksij Rempel <kernel@xxxxxxxxxxxxxx> */
> +
> +#ifndef _NET_IEEE8021Q_H
> +#define _NET_IEEE8021Q_H
> +
> +#include <linux/errno.h>
> +
> +/**
> + * enum ieee8021q_traffic_type - 802.1Q traffic type priority values (802.1Q-2022)
> + *
> + * @IEEE8021Q_TT_BK: Background
> + * @IEEE8021Q_TT_BE: Best Effort (default). According to 802.1Q-2022, BE is 0
> + * but has higher priority than BK which is 1.
> + * @IEEE8021Q_TT_EE: Excellent Effort
> + * @IEEE8021Q_TT_CA: Critical Applications
> + * @IEEE8021Q_TT_VI: Video, < 100 ms latency and jitter
> + * @IEEE8021Q_TT_VO: Voice, < 10 ms latency and jitter
> + * @IEEE8021Q_TT_IC: Internetwork Control
> + * @IEEE8021Q_TT_NC: Network Control
> + */
> +enum ieee8021q_traffic_type {
> + IEEE8021Q_TT_BK = 0,
> + IEEE8021Q_TT_BE = 1,
> + IEEE8021Q_TT_EE = 2,
> + IEEE8021Q_TT_CA = 3,
> + IEEE8021Q_TT_VI = 4,
> + IEEE8021Q_TT_VO = 5,
> + IEEE8021Q_TT_IC = 6,
> + IEEE8021Q_TT_NC = 7,
> +

Hi Oleksij,

I think the following line should go here to keep ./scripts/kernel-doc -none
happy:

/* private: */

> + IEEE8021Q_TT_MAX,
> +};

..