[LARTC] tc qdisc show - statistics truncated

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jingsong Fu wrote:

>I have tried the new tc source, however it still complains on "statistics truncated". 
>
>By looking into the function print_qdisc() of iproute2/tc/tc_qdisc.c, shown as follows,
>
>     if (RTA_PAYLOAD(tb[TCA_STATS]) < sizeof(struct tc_stats))
>         fprintf(fp, "statistics truncated");
>
>struct tc_stats
>{
>	__u64	bytes;			/* NUmber of enqueues bytes */
>	__u32	packets;		/* Number of enqueued packets	*/
>	__u32	drops;			/* Packets dropped because of lack of resources */
>	__u32	overlimits;		/* Number of throttle events when this
>					 * flow goes out of allocated bandwidth */
>	__u32	bps;			/* Current flow byte rate */
>	__u32	pps;			/* Current flow packet rate */
>	__u32	qlen;
>	__u32	backlog;
>#ifdef __KERNEL__
>	spinlock_t *lock;
>#endif
>};
>
>RTA_PAYLOAD() is 36 bytes, which is __u32 aligned. 
>sizeof(struct tc_stats) is 40 bytes which is __u64 aligned.
>
On which platform are you trying ? on i386 i get sizeof(struct tc_stats) 
== 36 in userspace (without __KERNEL__ defined).

>
>Has anyone had the same issue, and what's the easy way to resolve it?
>
The easy way is just replacing sizeof(...)  by 36 and hoping that it works.

Bye,
Patrick

>
>Thanks,
>
>Jingsong
>
>-----Original Message-----
>From: Patrick McHardy [mailto:kaber@stinky.trash.net]
>Sent: Thursday, January 02, 2003 7:39 PM
>To: Jingsong Fu
>Cc: lartc@mailman.ds9a.nl
>Subject: Re: [LARTC] tc qdisc show - statistics truncated
>
>
>On Thu, 2 Jan 2003, Jingsong Fu wrote:
>
>  
>
>>I am trying to show PRIO qdisc stats, and always get statistics truncated as follows, could someone help to explain why and how correct it?
>>Thanks,
>>Jingsong
>>
>># tc -s qdisc show dev eth0
>>qdisc prio 1: bands 8 priomap  7 6 5 4 3 2 1 0 7 7 7 7 7 7 7 7
>>statistics truncated
>>    
>>
>
>Your tc binary is not matching your kernel version, i would say.
>Install a new tc version, preferably from source.
>
>Patrick
>  
>




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux