From: Randy Dunlap <rdunlap@infradead.org>
To: "Björn Töpel" <bjorn.topel@gmail.com>,
ast@fb.com, daniel@iogearbox.net, netdev@vger.kernel.org
Cc: "Björn Töpel" <bjorn.topel@intel.com>,
"Stephen Rothwell" <sfr@canb.auug.org.au>,
magnus.karlsson@intel.com, linux-next@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next] xsk: fix 64-bit division
Date: Mon, 7 May 2018 11:25:24 -0700 [thread overview]
Message-ID: <baf737cf-a0c4-b542-8d37-fd9cdfe7101d@infradead.org> (raw)
In-Reply-To: <20180507174350.3534-1-bjorn.topel@gmail.com>
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
next prev parent reply other threads:[~2018-05-07 18:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-07 5:31 linux-next: Tree for May 7 Stephen Rothwell
2018-05-07 12:13 ` Geert Uytterhoeven
2018-05-07 12:25 ` Stephen Rothwell
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 [this message]
2018-05-09 16:13 ` Daniel Borkmann
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=baf737cf-a0c4-b542-8d37-fd9cdfe7101d@infradead.org \
--to=rdunlap@infradead.org \
--cc=ast@fb.com \
--cc=bjorn.topel@gmail.com \
--cc=bjorn.topel@intel.com \
--cc=daniel@iogearbox.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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).