diff options
author | Björn Töpel <bjorn.topel@intel.com> | 2018-05-07 19:43:50 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-05-09 18:12:21 +0200 |
commit | ea7e3435297c6ba3c8ae51db6ea48f1ed657dc5c (patch) | |
tree | 2f8339e8c0e17b2aa4ac6421ec6eadc7dac876ef /net/xdp | |
parent | a46a5c1a43499c04ce429ff3639f1417b9739ebd (diff) | |
download | linux-ea7e3435297c6ba3c8ae51db6ea48f1ed657dc5c.tar.gz linux-ea7e3435297c6ba3c8ae51db6ea48f1ed657dc5c.tar.bz2 linux-ea7e3435297c6ba3c8ae51db6ea48f1ed657dc5c.zip |
xsk: fix 64-bit division
i386 builds report:
net/xdp/xdp_umem.o: In function `xdp_umem_reg':
xdp_umem.c:(.text+0x47e): undefined reference to `__udivdi3'
This fix uses div_u64 instead of the GCC built-in.
Fixes: c0c77d8fb787 ("xsk: add user memory registration support sockopt")
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net/xdp')
-rw-r--r-- | net/xdp/xdp_umem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index 881dfdefe235..2b47a1dd7c6c 100644 --- a/net/xdp/xdp_umem.c +++ b/net/xdp/xdp_umem.c @@ -209,7 +209,7 @@ int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr) if ((addr + size) < addr) return -EINVAL; - nframes = size / frame_size; + nframes = (unsigned int)div_u64(size, frame_size); if (nframes == 0 || nframes > UINT_MAX) return -EINVAL; |