linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/sched/sch_tbf.c: fix linking error
@ 2013-12-12 12:38 Qais Yousef
  2013-12-12 14:18 ` Eric Dumazet
  2013-12-12 17:25 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Qais Yousef @ 2013-12-12 12:38 UTC (permalink / raw)
  To: Yang Yingliang
  Cc: Qais Yousef, Eric Dumazet, Jamal Hadi Salim, David S. Miller,
	netdev, linux-kernel, linux-next

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;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net/sched/sch_tbf.c: fix linking error
  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
  2013-12-12 17:25 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2013-12-12 14:18 UTC (permalink / raw)
  To: Qais Yousef
  Cc: Yang Yingliang, Eric Dumazet, Jamal Hadi Salim, David S. Miller,
	netdev, linux-kernel, linux-next

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=d55d282e6af88120ad90e93a88f70e3116dc0e3d

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] net/sched/sch_tbf.c: fix linking error
  2013-12-12 14:18 ` Eric Dumazet
@ 2013-12-12 14:29   ` Qais Yousef
  0 siblings, 0 replies; 5+ messages in thread
From: Qais Yousef @ 2013-12-12 14:29 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Yang Yingliang, Eric Dumazet, Jamal Hadi Salim, David S. Miller,
	netdev, linux-kernel, linux-next

> -----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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net/sched/sch_tbf.c: fix linking error
  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 17:25 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2013-12-12 17:25 UTC (permalink / raw)
  To: qais.yousef
  Cc: yangyingliang, edumazet, jhs, netdev, linux-kernel, linux-next

From: Qais Yousef <qais.yousef@imgtec.com>
Date: Thu, 12 Dec 2013 12:38:56 +0000

> 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 :)

This is already fixed in the net-next tree.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] net/sched/sch_tbf.c: fix linking error
       [not found] <1386851356-1395-1-git-send-email-qais.yousef@imgtec.com>
@ 2013-12-16 13:34 ` Qais Yousef
  0 siblings, 0 replies; 5+ messages in thread
From: Qais Yousef @ 2013-12-16 13:34 UTC (permalink / raw)
  To: Yang Yingliang
  Cc: Eric Dumazet, Jamal Hadi Salim, David S. Miller, netdev,
	linux-kernel, linux-next

Sorry for the noise. I'm not sure how this got sent out again. I definitely didn't type any git send-email commands at all today :-/

Qais

> -----Original Message-----
> From: Qais Yousef [mailto:qais.yousef@imgtec.com]
> Sent: 12 December 2013 12:29
> To: Yang Yingliang
> Cc: Qais Yousef; Eric Dumazet; Jamal Hadi Salim; David S. Miller;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> next@vger.kernel.org
> Subject: [PATCH] net/sched/sch_tbf.c: fix linking error
> 
> 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;
> --
> 1.7.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-12-16 13:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).