netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Leon Romanovsky <leonro@mellanox.com>, David Ahern <dsahern@gmail.com>
Cc: netdev@vger.kernel.org
Subject: [iproute] rdma broken on 32 bit
Date: Mon, 10 Dec 2018 14:10:20 -0800	[thread overview]
Message-ID: <20181210141020.535f042a@xeon-e3> (raw)

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)),
	};
		

             reply	other threads:[~2018-12-10 22:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 22:10 Stephen Hemminger [this message]
2018-12-11 17:33 ` [iproute] rdma broken on 32 bit Leon Romanovsky
2018-12-13 21:15   ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181210141020.535f042a@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=dsahern@gmail.com \
    --cc=leonro@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).