* Re: linux-next: Tree for May 7 (net/xdp)
[not found] <20180507153147.166ee38a@canb.auug.org.au>
@ 2018-05-07 16:17 ` Randy Dunlap
2018-05-07 17:43 ` [PATCH bpf-next] xsk: fix 64-bit division Björn Töpel
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2018-05-07 16:17 UTC (permalink / raw)
To: Stephen Rothwell, Linux-Next Mailing List
Cc: Linux Kernel Mailing List, netdev@vger.kernel.org,
Björn Töpel, Magnus Karlsson
On 05/06/2018 10:31 PM, Stephen Rothwell wrote:
> Hi all,
>
> Changes since 20180504:
>
on i386:
net/xdp/xdp_umem.o: In function `xdp_umem_reg':
xdp_umem.c:(.text+0x47e): undefined reference to `__udivdi3'
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH bpf-next] xsk: fix 64-bit division
2018-05-07 16:17 ` linux-next: Tree for May 7 (net/xdp) Randy Dunlap
@ 2018-05-07 17:43 ` Björn Töpel
2018-05-07 18:25 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Björn Töpel @ 2018-05-07 17:43 UTC (permalink / raw)
To: ast, daniel, netdev
Cc: Björn Töpel, Randy Dunlap, Stephen Rothwell,
magnus.karlsson, linux-next, linux-kernel
From: Björn Töpel <bjorn.topel@intel.com>
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>
---
net/xdp/xdp_umem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.14.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH bpf-next] xsk: fix 64-bit division
2018-05-07 17:43 ` [PATCH bpf-next] xsk: fix 64-bit division Björn Töpel
@ 2018-05-07 18:25 ` Randy Dunlap
2018-05-09 16:13 ` Daniel Borkmann
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2018-05-07 18:25 UTC (permalink / raw)
To: Björn Töpel, ast, daniel, netdev
Cc: Björn Töpel, Stephen Rothwell, magnus.karlsson,
linux-next, linux-kernel
On 05/07/2018 10:43 AM, Björn Töpel wrote:
> From: Björn Töpel <bjorn.topel@intel.com>
>
> 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>
I don't know why the subject says xsk (instead of xdp), but anyway:
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Thanks.
> ---
> net/xdp/xdp_umem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
>
>
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH bpf-next] xsk: fix 64-bit division
2018-05-07 18:25 ` Randy Dunlap
@ 2018-05-09 16:13 ` Daniel Borkmann
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2018-05-09 16:13 UTC (permalink / raw)
To: Randy Dunlap, Björn Töpel, ast, netdev
Cc: Björn Töpel, Stephen Rothwell, magnus.karlsson,
linux-next, linux-kernel
On 05/07/2018 08:25 PM, Randy Dunlap wrote:
> On 05/07/2018 10:43 AM, Björn Töpel wrote:
>> From: Björn Töpel <bjorn.topel@intel.com>
>>
>> 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>
>
> I don't know why the subject says xsk (instead of xdp), but anyway:
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Tested-by: Randy Dunlap <rdunlap@infradead.org>
Applied to bpf-next, thanks everyone!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-09 16:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20180507153147.166ee38a@canb.auug.org.au>
2018-05-07 16:17 ` linux-next: Tree for May 7 (net/xdp) Randy Dunlap
2018-05-07 17:43 ` [PATCH bpf-next] xsk: fix 64-bit division Björn Töpel
2018-05-07 18:25 ` Randy Dunlap
2018-05-09 16:13 ` Daniel Borkmann
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).