[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1384439337.28458.145.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Thu, 14 Nov 2013 06:28:57 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Yang Yingliang <yangyingliang@...wei.com>
Cc: Stephen Hemminger <stephen@...workplumber.org>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH iproute2] htb: support 64bit rates
On Thu, 2013-11-14 at 16:12 +0800, Yang Yingliang wrote:
> On 2013/11/13 6:34, Eric Dumazet wrote:
>
> [...]
> > @@ -256,6 +270,7 @@ static int htb_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
> > struct tc_htb_glob *gopt;
> > double buffer,cbuffer;
> > unsigned int linklayer;
> > + __u64 rate64, ceil64;
> > SPRINT_BUF(b1);
> > SPRINT_BUF(b2);
> > SPRINT_BUF(b3);
> > @@ -275,12 +290,25 @@ static int htb_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
> > if (show_details)
> > fprintf(f, "quantum %d ", (int)hopt->quantum);
> > }
> > - fprintf(f, "rate %s ", sprint_rate(hopt->rate.rate, b1));
> > +
> > + rate64 = hopt->rate.rate;
> > + if (tb[TCA_HTB_RATE64] &&
> > + RTA_PAYLOAD(tb[TCA_HTB_RATE64]) >= sizeof(rate64)) {
> > + rate64 = rta_getattr_u64(tb[TCA_HTB_RATE64]);
> > + }
> > +
>
> If RTA_PAYLOAD(tb[TCA_HTB_RATE64]) < sizeof(rate64),
> it means something wrong, it don't need to continue,
> "return -1" would be better.
Nothing wrong actually.
Checking for these conditions are absolutely normal, to maintain
compatibility between old/new tc and or kernels.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists