Re: [PATCH net-next] seg6: fool-proof the processing of SRv6 behavior attributes

2021-02-03 Thread David Ahern
On 2/3/21 7:27 PM, Andrea Mayer wrote: > > I think there is an issue here because BITS_PER_TYPE(unsigned long) is greater > than the SEG6_LOCAL_MAX (currently = 9). > > I think it should be like this: > > BUILD_BUG_ON(SEG6_LOCAL_MAX + 1 > BITS_PER_TYPE(unsigned long)) > > I will send a v2 with

Re: [PATCH net-next] seg6: fool-proof the processing of SRv6 behavior attributes

2021-02-03 Thread Andrea Mayer
Hi David, thanks for your time. On Wed, 3 Feb 2021 08:59:40 -0700 David Ahern wrote: > 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.

Re: [PATCH net-next] seg6: fool-proof the processing of SRv6 behavior attributes

2021-02-03 Thread David Ahern
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 > #include > > +#define SEG6_F_ATTR(i) BIT(i)

[PATCH net-next] seg6: fool-proof the processing of SRv6 behavior attributes

2021-02-02 Thread Andrea Mayer
The set of required attributes for a given SRv6 behavior is identified using a bitmap stored in an unsigned long, since the initial design of SRv6 networking in Linux. Recently the same approach has been used for identifying the optional attributes. However, the number of attributes supported by S