Skip to content

Commit ea7e343

Browse files
Björn Töpelborkmann
authored andcommitted
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: c0c77d8 ("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>
1 parent a46a5c1 commit ea7e343

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/xdp/xdp_umem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
209209
if ((addr + size) < addr)
210210
return -EINVAL;
211211

212-
nframes = size / frame_size;
212+
nframes = (unsigned int)div_u64(size, frame_size);
213213
if (nframes == 0 || nframes > UINT_MAX)
214214
return -EINVAL;
215215

0 commit comments

Comments
 (0)