On Fri, 22 May 2020 16:51:45 -0700 Saeed Mahameed wrote:
> +static inline __be32 mpls_label_id_field(__be32 label, u8 tos, u8 ttl)
> +{
> +     u32 res;
> +
> +     /* mpls label is 32 bits long and construction as follows:
> +      * 20 bits label
> +      * 3 bits tos
> +      * 1 bit bottom of stack. Since we support only one label, this bit is
> +      *       always set.
> +      * 8 bits TTL
> +      */
> +     res = be32_to_cpu(label) << 12 | 1 << 8 | (tos & 7) <<  9 | ttl;
> +     return cpu_to_be32(res);
> +}

No static inlines in C source, please. Besides this belongs in the mpls
header, it's a generic helper.

Reply via email to