All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net/sched: fix type of htb statistics
@ 2018-08-30 14:39 Florent Fourcot
  2018-09-02 20:57 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Florent Fourcot @ 2018-08-30 14:39 UTC (permalink / raw)
  To: netdev; +Cc: Florent Fourcot

tokens and ctokens are defined as s64 in htb_class structure,
and clamped to 32bits value during netlink dumps:

cl->xstats.tokens = clamp_t(s64, PSCHED_NS2TICKS(cl->tokens),
                            INT_MIN, INT_MAX);

Defining it as u32 is working since userspace (tc) is printing it as
signed int, but a correct definition from the beginning is probably
better.

In the same time, 'giants' structure member is unused since years, so
update the comment to mark it unused.

Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
---
 include/uapi/linux/pkt_sched.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index 8975fd1a1421..e9b7244ac381 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -395,9 +395,9 @@ enum {
 struct tc_htb_xstats {
 	__u32 lends;
 	__u32 borrows;
-	__u32 giants;	/* too big packets (rate will not be accurate) */
-	__u32 tokens;
-	__u32 ctokens;
+	__u32 giants;	/* unused since 'Make HTB scheduler work with TSO.' */
+	__s32 tokens;
+	__s32 ctokens;
 };
 
 /* HFSC section */
-- 
2.11.0

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

* Re: [PATCH net-next] net/sched: fix type of htb statistics
  2018-08-30 14:39 [PATCH net-next] net/sched: fix type of htb statistics Florent Fourcot
@ 2018-09-02 20:57 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-09-02 20:57 UTC (permalink / raw)
  To: florent.fourcot; +Cc: netdev

From: Florent Fourcot <florent.fourcot@wifirst.fr>
Date: Thu, 30 Aug 2018 16:39:23 +0200

> tokens and ctokens are defined as s64 in htb_class structure,
> and clamped to 32bits value during netlink dumps:
> 
> cl->xstats.tokens = clamp_t(s64, PSCHED_NS2TICKS(cl->tokens),
>                             INT_MIN, INT_MAX);
> 
> Defining it as u32 is working since userspace (tc) is printing it as
> signed int, but a correct definition from the beginning is probably
> better.
> 
> In the same time, 'giants' structure member is unused since years, so
> update the comment to mark it unused.
> 
> Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>

Looks good, applied.

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

end of thread, other threads:[~2018-09-03  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-30 14:39 [PATCH net-next] net/sched: fix type of htb statistics Florent Fourcot
2018-09-02 20:57 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.