From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Song Liu <liu.song.a23@gmail.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Daniel Borkmann <daniel@iogearbox.net>,
oss-drivers@netronome.com, Networking <netdev@vger.kernel.org>,
Jiong Wang <jiong.wang@netronome.com>
Subject: Re: [PATCH bpf-next 2/7] lib: reciprocal_div: implement the improved algorithm on the paper mentioned
Date: Tue, 26 Jun 2018 13:52:58 -0700 [thread overview]
Message-ID: <20180626135258.7e80bead@cakuba.netronome.com> (raw)
In-Reply-To: <CAPhsuW4P5J1ZgUVKGfwWs7vX_7thc5cr1x6mrY8Wx3d2dqEDTw@mail.gmail.com>
On Mon, 25 Jun 2018 23:21:10 -0700, Song Liu wrote:
> > +struct reciprocal_value_adv reciprocal_value_adv(u32 d, u8 prec)
> > +{
> > + struct reciprocal_value_adv R;
> > + u32 l, post_shift;
> > + u64 mhigh, mlow;
> > +
> > + l = fls(d - 1);
> > + post_shift = l;
> > + /* NOTE: mlow/mhigh could overflow u64 when l == 32 which means d has
> > + * MSB set. This case needs to be handled before calling
> > + * "reciprocal_value_adv", please see the comment at
> > + * include/linux/reciprocal_div.h.
> > + */
>
> Shall we handle l == 32 case better? I guess the concern here is extra
> handling may slow down the fast path? If that's the case, we should
> at least add a WARNING on the slow path.
Agreed, I think Jiong is travelling, hence no response. We'll respin.
next prev parent reply other threads:[~2018-06-26 20:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-25 3:54 [PATCH bpf-next 0/7] nfp: bpf: add multiplication, divide and memcpy from maps Jakub Kicinski
2018-06-25 3:54 ` [PATCH bpf-next 1/7] nfp: bpf: allow source ptr type be map ptr in memcpy optimization Jakub Kicinski
2018-06-26 5:50 ` Song Liu
2018-06-26 7:08 ` Jakub Kicinski
2018-06-26 16:26 ` Song Liu
2018-06-25 3:54 ` [PATCH bpf-next 2/7] lib: reciprocal_div: implement the improved algorithm on the paper mentioned Jakub Kicinski
2018-06-26 6:21 ` Song Liu
2018-06-26 20:52 ` Jakub Kicinski [this message]
2018-06-27 8:54 ` Daniel Borkmann
2018-06-25 3:54 ` [PATCH bpf-next 3/7] nfp: bpf: rename umin/umax to umin_src/umax_src Jakub Kicinski
2018-06-26 6:21 ` Song Liu
2018-06-25 3:54 ` [PATCH bpf-next 4/7] nfp: bpf: copy range info for all operands of all ALU operations Jakub Kicinski
2018-06-26 6:50 ` Song Liu
2018-06-25 3:54 ` [PATCH bpf-next 5/7] nfp: bpf: support u16 and u32 multiplications Jakub Kicinski
2018-06-26 22:23 ` Song Liu
2018-06-25 3:54 ` [PATCH bpf-next 6/7] nfp: bpf: support u32 divide using reciprocal_div.h Jakub Kicinski
2018-06-26 22:28 ` Song Liu
2018-06-25 3:54 ` [PATCH bpf-next 7/7] nfp: bpf: migrate to advanced reciprocal divide in reciprocal_div.h Jakub Kicinski
2018-06-26 20:59 ` Jakub Kicinski
2018-07-05 18:28 ` Jiong Wang
-- strict thread matches above, loose matches on Subject: below --
2018-06-28 19:02 [PATCH bpf-next 2/7] lib: reciprocal_div: implement the improved algorithm on the paper mentioned Jiong Wang
2018-06-28 21:05 ` Jakub Kicinski
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=20180626135258.7e80bead@cakuba.netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--cc=jiong.wang@netronome.com \
--cc=liu.song.a23@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/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