Skip to contentSkip to conversation

tc qdisc show - statistics truncated

LARTC Jingsong Fu 3 participants 4 messages Jan 3, 2003 – Jan 7, 2003

lore
Share & tools
lore
#1 lore raw
Quoted 8 lines · Jingsong Fu

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

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#2 lore raw
In reply to Jingsong Fu

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.

Has anyone had the same issue, and what's the easy way to resolve it?

Thanks,

Jingsong

-----Original Message-----
From: Patrick McHardy [mailto:[email protected]]
Sent: Thursday, January 02, 2003 7:39 PM
To: Jingsong Fu
Cc: [email protected]
Subject: Re: [LARTC] tc qdisc show - statistics truncated

Quoted 8 lines · Jingsong Fu

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

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#3 lore raw
In reply to Jingsong Fu
Quoted 20 lines · Jingsong Fu

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;
Quoted 6 lines

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

Quoted 3 lines

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

Quoted 27 lines

Thanks,

Jingsong

-----Original Message-----
From: Patrick McHardy [mailto:[email protected]]
Sent: Thursday, January 02, 2003 7:39 PM
To: Jingsong Fu
Cc: [email protected]
Subject: Re: [LARTC] tc qdisc show - statistics truncated

Quoted 9 lines · Jingsong Fu

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
Quoted 6 lines

Your tc binary is not matching your kernel version, i would say. Install a new tc version, preferably from source.

Patrick

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/