From: Eric Dumazet <eric.dumazet@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Pravin B Shelar <pshelar@ovn.org>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Tonghao Zhang <xiangxia.m.yue@gmail.com>
Cc: netdev@vger.kernel.org, dev@openvswitch.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: openvswitch: use do_div() for 64-by-32 divisions:
Date: Fri, 24 Apr 2020 08:05:34 -0700 [thread overview]
Message-ID: <d2c14a2d-4e7b-d36a-be90-e987b1ea6183@gmail.com> (raw)
In-Reply-To: <20200424121051.5056-1-geert@linux-m68k.org>
On 4/24/20 5:10 AM, Geert Uytterhoeven wrote:
> On 32-bit architectures (e.g. m68k):
>
> ERROR: modpost: "__udivdi3" [net/openvswitch/openvswitch.ko] undefined!
> ERROR: modpost: "__divdi3" [net/openvswitch/openvswitch.ko] undefined!
>
> Fixes: e57358873bb5d6ca ("net: openvswitch: use u64 for meter bucket")
> Reported-by: noreply@ellerman.id.au
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> net/openvswitch/meter.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
> index 915f31123f235c03..3498a5ab092ab2b8 100644
> --- a/net/openvswitch/meter.c
> +++ b/net/openvswitch/meter.c
> @@ -393,7 +393,7 @@ static struct dp_meter *dp_meter_create(struct nlattr **a)
> * Start with a full bucket.
> */
> band->bucket = (band->burst_size + band->rate) * 1000ULL;
> - band_max_delta_t = band->bucket / band->rate;
> + band_max_delta_t = do_div(band->bucket, band->rate);
> if (band_max_delta_t > meter->max_delta_t)
> meter->max_delta_t = band_max_delta_t;
> band++;
>
This is fascinating... Have you tested this patch ?
Please double check what do_div() return value is supposed to be !
Thanks.
next prev parent reply other threads:[~2020-04-24 15:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 12:10 [PATCH] net: openvswitch: use do_div() for 64-by-32 divisions: Geert Uytterhoeven
2020-04-24 15:05 ` Eric Dumazet [this message]
2020-04-24 15:12 ` Geert Uytterhoeven
2020-04-24 16:45 ` Toke Høiland-Jørgensen
2020-04-24 17:54 ` Geert Uytterhoeven
2020-04-25 3:40 ` Tonghao Zhang
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=d2c14a2d-4e7b-d36a-be90-e987b1ea6183@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.org \
--cc=geert@linux-m68k.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pshelar@ovn.org \
--cc=xiangxia.m.yue@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.