netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iproute] rdma broken on 32 bit
@ 2018-12-10 22:10 Stephen Hemminger
  2018-12-11 17:33 ` Leon Romanovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2018-12-10 22:10 UTC (permalink / raw)
  To: Leon Romanovsky, David Ahern; +Cc: netdev

It appears that RDMA is broken on 32 bit platforms.
Sure you don't run on 32bit, but iproute2 needs to build everywhere.

The issue is that  you are assuming a C enum can hold 64 bits.
The standard says enum only has to hold "int" values.
So it breaks on 32bit.

The issue is deeper than just a trivial fix. Please either change iproute
config script to not build RDMA if sizeof(enum) < 64 or fix the code to
use a safe value like uint64_t.

rdma
    CC       rdma.o
    CC       utils.o
    CC       dev.o
    CC       link.o
In file included from rdma.h:26:0,
                 from dev.c:12:
dev.c: In function ‘dev_caps_to_str’:
../include/utils.h:269:38: warning: left shift count >= width of type [-Wshift-count-overflow]
 #define BIT(nr)                 (1UL << (nr))
                                      ^
rdma.h:32:61: note: in expansion of macro ‘BIT’
 #define RDMA_BITMAP_ENUM(name, bit_no) RDMA_BITMAP_##name = BIT(bit_no),
                                                             ^~~
If you wade through the macro swamp:
dev.c
#define RDMA_DEV_FLAGS(x) \

	x(SG_GAPS_REG, 32) \

	enum { RDMA_DEV_FLAGS(RDMA_BITMAP_ENUM) };

Expands to:
	enum {
		RDMA_BITMAP_SG_GAPS_REG = (1UL << (32)),
	};
		

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

end of thread, other threads:[~2018-12-13 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-10 22:10 [iproute] rdma broken on 32 bit Stephen Hemminger
2018-12-11 17:33 ` Leon Romanovsky
2018-12-13 21:15   ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).