lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 26 May 2020 12:19:20 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Saeed Mahameed <saeedm@...lanox.com>
Cc:     "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
        Eli Cohen <eli@...lanox.com>, Roi Dayan <roid@...lanox.com>,
        Eli Britstein <elibr@...lanox.com>
Subject: Re: [net-next 07/10] net/mlx5e: Add support for hw encapsulation of
 MPLS over UDP

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ