Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp725315ybz; Fri, 24 Apr 2020 08:15:31 -0700 (PDT) X-Google-Smtp-Source: APiQypK8/INjBaxpnyKsasUD/legdKZfRHjO08CtVMChkBB8S27TLXFjWE42srJG8P62FWY4Bxla X-Received: by 2002:a50:f61c:: with SMTP id c28mr7202364edn.365.1587741331328; Fri, 24 Apr 2020 08:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587741331; cv=none; d=google.com; s=arc-20160816; b=jxWIyAiTQ3T/aIgMPvlt6NaUENj93kdVf7WgZrnR4XwQfozAfKZ61ZMON6OtZchTi1 ue+o/XLK63ywY2AZ44Gl4Ry5ziVZtQx31C5MbWuZMbjBxZz8Bibk1Eppz5xzADNCwd5Y Jx1JlpDaN6AifQzdu8PlFEJzHI0wKY95Fj/AfPs4xn6ZHyp+vhL4ta9uCxioOc8tflwT xMzyMAkncOGkIotpOYkMU4yBwraRDk+jr5zLEFgkKLsrHVoY0DLs6eI5zpF/YJ0VxEal PYEmIIn9tXUEbuEdycKHjStf/1JqIBZ3v5yLaiLq4+rvCEJGma14I81Gdv0eQq2tqIRY efgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=H6TSxp621tHGXOK2SxkqJA3SlWKHV8D7dciTUE31bQE=; b=oiREcawFzyWeZK3wrLO9PORrsKRuozMnEmXd7S7HB+wob2aaeGnAmrHtcRuhpC6lgL 4XaphqAIMyT2/ktBxad9tEUq6ETLXU+JP3zIxtwMOBJWsQrUa516BNdhngQie/wyCHdO ZuEyypsr/vBLMnTJBc92BKLPWWDiWVWpsGJnsjgjsTM9WjsTrXAFhRoZA1QNYo9O2+xO 3sWFLcuMlINEJDzJC54G0UcG4CLYBj1XyTNp6CP1yg5o8vOVraRurOAQ1N8LkYj5fOzu i+YeMJl29KGli8xWlRlFBJc1NOUkdGVyd7QcL1Foh/yZYB0OA3mbPuNSa1YZyWr/nwGf i7Pg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id aq26si3228365ejc.26.2020.04.24.08.15.07; Fri, 24 Apr 2020 08:15:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728217AbgDXPNA (ORCPT + 99 others); Fri, 24 Apr 2020 11:13:00 -0400 Received: from mail-oo1-f67.google.com ([209.85.161.67]:41424 "EHLO mail-oo1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726699AbgDXPM7 (ORCPT ); Fri, 24 Apr 2020 11:12:59 -0400 Received: by mail-oo1-f67.google.com with SMTP id t3so2169417oou.8; Fri, 24 Apr 2020 08:12:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H6TSxp621tHGXOK2SxkqJA3SlWKHV8D7dciTUE31bQE=; b=CK9y/WNdfkGDvRB1llmwGsKCMY0NXAxhh2HpWIxR2ncAZr234EfS8Lt7za7giJ6tDP d6XYhm7eMoGCLxyMo2mvDKBsISPN4lyjwJ58+CZiwrAdwwy/MYLdY1xSm4nJaPlGutAB 4THqZzZ4b12ANpPic1rnZ1qy8Yic1rgMMe5CuLADIn8+vhZVHBpy+4gxits3W5ACYDCp VefQnQbKhOPrIRMSooS5s8GkVn9j3xfrKTWiA6HQrL+tyd6yNVDwb2a4CGeoD6J9OIwm d5Rrp76f5JLnal1+d603DzAz2o2iJ+QJjeofrkC0RlKa/EEZsaDIlaco2Hr3O2zsUZSp Zpbw== X-Gm-Message-State: AGi0PuZsjmGtyxlsmnd5BNkpbd6UW5cQMMwRRAmGr64vpOoAKJI33/i5 MZFL8uJ4EKjLjGxS2100smF4L2H19zko6nVCTEU= X-Received: by 2002:a4a:d44a:: with SMTP id p10mr1884233oos.11.1587741178374; Fri, 24 Apr 2020 08:12:58 -0700 (PDT) MIME-Version: 1.0 References: <20200424121051.5056-1-geert@linux-m68k.org> In-Reply-To: From: Geert Uytterhoeven Date: Fri, 24 Apr 2020 17:12:46 +0200 Message-ID: Subject: Re: [PATCH] net: openvswitch: use do_div() for 64-by-32 divisions: To: Eric Dumazet Cc: Pravin B Shelar , "David S . Miller" , Jakub Kicinski , Tonghao Zhang , netdev , dev@openvswitch.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Eric, On Fri, Apr 24, 2020 at 5:05 PM Eric Dumazet wrote: > 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 > > --- > > 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 ? Sorry, I should have said this is compile-tested only. > Please double check what do_div() return value is supposed to be ! I do not have any openvswitch setups, let alone on the poor m68k box. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds