linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qais Yousef <Qais.Yousef@imgtec.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Yang Yingliang <yangyingliang@huawei.com>,
	Eric Dumazet <edumazet@google.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	"David S. Miller" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-next@vger.kernel.org" <linux-next@vger.kernel.org>
Subject: RE: [PATCH] net/sched/sch_tbf.c: fix linking error
Date: Thu, 12 Dec 2013 14:29:35 +0000	[thread overview]
Message-ID: <392C4BDEFF12D14FA57A3F30B283D7D13C8A24@LEMAIL01.le.imgtec.org> (raw)
In-Reply-To: <1386857899.19078.49.camel@edumazet-glaptop2.roam.corp.google.com>

> -----Original Message-----
> From: Eric Dumazet [mailto:eric.dumazet@gmail.com]
> Sent: 12 December 2013 14:18
> To: Qais Yousef
> Cc: Yang Yingliang; Eric Dumazet; Jamal Hadi Salim; David S. Miller;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> next@vger.kernel.org
> Subject: Re: [PATCH] net/sched/sch_tbf.c: fix linking error
> 
> On Thu, 2013-12-12 at 12:38 +0000, Qais Yousef wrote:
> > ERROR: "__udivdi3" [net/sched/sch_tbf.ko] undefined!
> >
> > introduced by: cc106e441a63 (net: sched: tbf: fix the calculation of
> > max_size)
> >
> > which adds a 64 by 32 bit division without using do_div().
> > Fix it by using do_div(len/ 53) instead of len/53.
> >
> > Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
> > Cc: Eric Dumazet <edumazet@google.com>
> > Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: netdev@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > Cc: linux-next@vger.kernel.org
> > ---
> > We caught this error on linux-next today. This is my quick attemp of a fix.
> > If it's not appropriate or doesn't make sense my apologies and feel
> > free to resend a better fix :)
> >
> >  net/sched/sch_tbf.c |    6 ++++--
> >  1 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index
> > a44928c..771cbec 100644
> > --- a/net/sched/sch_tbf.c
> > +++ b/net/sched/sch_tbf.c
> > @@ -131,8 +131,10 @@ static u64 psched_ns_t2l(const struct
> > psched_ratecfg *r,
> >
> >  	do_div(len, NSEC_PER_SEC);
> >
> > -	if (unlikely(r->linklayer == TC_LINKLAYER_ATM))
> > -		len = (len / 53) * 48;
> > +	if (unlikely(r->linklayer == TC_LINKLAYER_ATM)) {
> > +		do_div(len, 53);
> > +		len *= 48;
> > +	}
> >
> >  	if (len > r->overhead)
> >  		len -= r->overhead;
> 
> This looks like this was already fixed yesterday in David net tree :
> 
> http://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=d55d282e6
> af88120ad90e93a88f70e3116dc0e3d
> 

Ah, ok. Thanks for checking this and sorry about the noise.

Qais


  reply	other threads:[~2013-12-12 14:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12 12:38 [PATCH] net/sched/sch_tbf.c: fix linking error Qais Yousef
2013-12-12 14:18 ` Eric Dumazet
2013-12-12 14:29   ` Qais Yousef [this message]
2013-12-12 17:25 ` David Miller
     [not found] <1386851356-1395-1-git-send-email-qais.yousef@imgtec.com>
2013-12-16 13:34 ` Qais Yousef

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=392C4BDEFF12D14FA57A3F30B283D7D13C8A24@LEMAIL01.le.imgtec.org \
    --to=qais.yousef@imgtec.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yangyingliang@huawei.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;
as well as URLs for NNTP newsgroup(s).