[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6fe3beb2-4306-11cd-83ce-66072db81346@gmail.com>
Date:   Wed, 3 Feb 2021 08:59:40 -0700
From:   David Ahern <dsahern@...il.com>
To:     Andrea Mayer <andrea.mayer@...roma2.it>,
        "David S. Miller" <davem@...emloft.net>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        David Ahern <dsahern@...nel.org>,
        Jakub Kicinski <kuba@...nel.org>, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org
Cc:     Colin Ian King <colin.king@...onical.com>,
        Stefano Salsano <stefano.salsano@...roma2.it>,
        Paolo Lungaroni <paolo.lungaroni@...t.it>,
        Ahmed Abdelsalam <ahabdels.dev@...IL.COM>
Subject: Re: [PATCH net-next] seg6: fool-proof the processing of SRv6 behavior
 attributes
On 2/2/21 11:56 AM, Andrea Mayer wrote:
> diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
> index b07f7c1c82a4..7cc50d506902 100644
> --- a/net/ipv6/seg6_local.c
> +++ b/net/ipv6/seg6_local.c
> @@ -31,6 +31,9 @@
>  #include <linux/etherdevice.h>
>  #include <linux/bpf.h>
>  
> +#define SEG6_F_ATTR(i)		BIT(i)
> +#define SEG6_LOCAL_MAX_SUPP	32
> +
SEG6_LOCAL_MAX_SUPP should not be needed; it can be derived from the type:
    BUILD_BUG_ON(BITS_PER_TYPE(unsigned long) > SEG6_LOCAL_MAX)
The use of BIT() looks fine.
Powered by blists - more mailing lists