All of lore.kernel.org
 help / color / mirror / Atom feed
* BUILD_BUG_ON error in mlx5/core/pagealloc.c
@ 2016-10-10 23:41 Tom Herbert
  2016-10-11  0:10 ` Tom Herbert
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Herbert @ 2016-10-10 23:41 UTC (permalink / raw)
  To: Linux Kernel Network Developers, Saeed Mahameed

I am hitting this in mlx5

drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function
‘reclaim_pages_cmd.clone.0’:
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:346: error: call
to ‘__compiletime_assert_346’ declared with attribute error:
BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_out, pas[i]) % 64
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function ‘give_pages’:
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:291: error: call
to ‘__compiletime_assert_291’ declared with attribute error:
BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_in, pas[i]) % 64

Bisecting points to:

commit a533ed5e179cd15512d40282617909d3482a771c
Author: Saeed Mahameed <saeedm@mellanox.com>
Date:   Sun Jul 17 13:27:25 2016 +0300

    net/mlx5: Pages management commands via mlx5 ifc

Thanks,
Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUILD_BUG_ON error in mlx5/core/pagealloc.c
  2016-10-10 23:41 BUILD_BUG_ON error in mlx5/core/pagealloc.c Tom Herbert
@ 2016-10-11  0:10 ` Tom Herbert
       [not found]   ` <CALzJLG911C=Chxgy0Fm_jLf7s8L21yqmQA4fqfn909o3VgnvRg@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Herbert @ 2016-10-11  0:10 UTC (permalink / raw)
  To: Linux Kernel Network Developers, Saeed Mahameed

On Mon, Oct 10, 2016 at 4:41 PM, Tom Herbert <tom@herbertland.com> wrote:
> I am hitting this in mlx5
>
> drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function
> ‘reclaim_pages_cmd.clone.0’:
> drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:346: error: call
> to ‘__compiletime_assert_346’ declared with attribute error:
> BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_out, pas[i]) % 64
> drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function ‘give_pages’:
> drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:291: error: call
> to ‘__compiletime_assert_291’ declared with attribute error:
> BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_in, pas[i]) % 64
>

The expression in BUILD_BUG_ON expands to "((unsigned)(unsigned
long)(&(((struct mlx5_ifc_manage_pages_in_bits *)0)->pas[i]))) % 64".
The variable array index to pas makes this expression non-constant, I
imagine that is where the problem lies.

> Bisecting points to:
>
> commit a533ed5e179cd15512d40282617909d3482a771c
> Author: Saeed Mahameed <saeedm@mellanox.com>
> Date:   Sun Jul 17 13:27:25 2016 +0300
>
>     net/mlx5: Pages management commands via mlx5 ifc
>
> Thanks,
> Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUILD_BUG_ON error in mlx5/core/pagealloc.c
       [not found]   ` <CALzJLG911C=Chxgy0Fm_jLf7s8L21yqmQA4fqfn909o3VgnvRg@mail.gmail.com>
@ 2016-10-11  3:58     ` Tom Herbert
  2016-10-11  7:34       ` Saeed Mahameed
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Herbert @ 2016-10-11  3:58 UTC (permalink / raw)
  To: Saeed Mahameed; +Cc: Linux Kernel Network Developers, Saeed Mahameed

On Mon, Oct 10, 2016 at 8:17 PM, Saeed Mahameed
<saeedm@dev.mellanox.co.il> wrote:
>
>
> On Tuesday, October 11, 2016, Tom Herbert <tom@herbertland.com> wrote:
>>
>> On Mon, Oct 10, 2016 at 4:41 PM, Tom Herbert <tom@herbertland.com> wrote:
>> > I am hitting this in mlx5
>> >
>> > drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function
>> > ‘reclaim_pages_cmd.clone.0’:
>> > drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:346: error: call
>> > to ‘__compiletime_assert_346’ declared with attribute error:
>> > BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_out, pas[i]) % 64
>> > drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function
>> > ‘give_pages’:
>> > drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:291: error: call
>> > to ‘__compiletime_assert_291’ declared with attribute error:
>> > BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_in, pas[i]) % 64
>> >
>>
>> The expression in BUILD_BUG_ON expands to "((unsigned)(unsigned
>> long)(&(((struct mlx5_ifc_manage_pages_in_bits *)0)->pas[i]))) % 64".
>> The variable array index to pas makes this expression non-constant, I
>> imagine that is where the problem lies.
>>
>> > Bisecting points to:
>> >
>> > commit a533ed5e179cd15512d40282617909d3482a771c
>> > Author: Saeed Mahameed <saeedm@mellanox.com>
>> > Date:   Sun Jul 17 13:27:25 2016 +0300
>> >
>> >     net/mlx5: Pages management commands via mlx5 ifc
>
>
> Hi Tom,
> We know about this issue, it happens only with gcc4.4  or gcc 4.2 i don't
> remember exactly which.
> Most likely it is a gcc issue.
>
I don't believe that is the case. As I pointed out this is giving
BUILD_BUG_ON a non-constant expression. To fix this should just be a
matter of using a constant argument for the BUILD_BUG_ON. AFAICT
there's only two instances of MLX5_SET64 where this can be a problem.
I will post a fix shortly.

Tom

> Anyway, we are working on the issue and we will provide a fix or a W/A
> hopefully next week. This week most of the team are on vacation.
>
> Thanks
> Saeed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BUILD_BUG_ON error in mlx5/core/pagealloc.c
  2016-10-11  3:58     ` Tom Herbert
@ 2016-10-11  7:34       ` Saeed Mahameed
  0 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2016-10-11  7:34 UTC (permalink / raw)
  To: Tom Herbert; +Cc: Linux Kernel Network Developers, Saeed Mahameed

On Tue, Oct 11, 2016 at 12:58 PM, Tom Herbert <tom@herbertland.com> wrote:
> On Mon, Oct 10, 2016 at 8:17 PM, Saeed Mahameed
> <saeedm@dev.mellanox.co.il> wrote:
>>
>>
>> On Tuesday, October 11, 2016, Tom Herbert <tom@herbertland.com> wrote:
>>>
>>> On Mon, Oct 10, 2016 at 4:41 PM, Tom Herbert <tom@herbertland.com> wrote:
>>> > I am hitting this in mlx5
>>> >
>>> > drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function
>>> > ‘reclaim_pages_cmd.clone.0’:
>>> > drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:346: error: call
>>> > to ‘__compiletime_assert_346’ declared with attribute error:
>>> > BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_out, pas[i]) % 64
>>> > drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c: In function
>>> > ‘give_pages’:
>>> > drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c:291: error: call
>>> > to ‘__compiletime_assert_291’ declared with attribute error:
>>> > BUILD_BUG_ON failed: __mlx5_bit_off(manage_pages_in, pas[i]) % 64
>>> >
>>>
>>> The expression in BUILD_BUG_ON expands to "((unsigned)(unsigned
>>> long)(&(((struct mlx5_ifc_manage_pages_in_bits *)0)->pas[i]))) % 64".
>>> The variable array index to pas makes this expression non-constant, I
>>> imagine that is where the problem lies.
>>>
>>> > Bisecting points to:
>>> >
>>> > commit a533ed5e179cd15512d40282617909d3482a771c
>>> > Author: Saeed Mahameed <saeedm@mellanox.com>
>>> > Date:   Sun Jul 17 13:27:25 2016 +0300
>>> >
>>> >     net/mlx5: Pages management commands via mlx5 ifc
>>
>>
>> Hi Tom,
>> We know about this issue, it happens only with gcc4.4  or gcc 4.2 i don't
>> remember exactly which.
>> Most likely it is a gcc issue.
>>
> I don't believe that is the case. As I pointed out this is giving
> BUILD_BUG_ON a non-constant expression. To fix this should just be a
> matter of using a constant argument for the BUILD_BUG_ON. AFAICT

Well, compilation work for us on most of our systems (where we have
newer gcc), something just doesn't add up here!
Anyway we didn't want to complicate the MACROs API and we wanted to
investigate a little bit more.

> there's only two instances of MLX5_SET64 where this can be a problem.
> I will post a fix shortly.

Thanks Tom, Just saw it, i will ack it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-11  7:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-10 23:41 BUILD_BUG_ON error in mlx5/core/pagealloc.c Tom Herbert
2016-10-11  0:10 ` Tom Herbert
     [not found]   ` <CALzJLG911C=Chxgy0Fm_jLf7s8L21yqmQA4fqfn909o3VgnvRg@mail.gmail.com>
2016-10-11  3:58     ` Tom Herbert
2016-10-11  7:34       ` Saeed Mahameed

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.