netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] sch_api: Change signature of qdisc_tree_reduce_backlog() to use ints
@ 2019-01-09 16:10 Toke Høiland-Jørgensen
  2019-01-19 17:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Toke Høiland-Jørgensen @ 2019-01-09 16:10 UTC (permalink / raw)
  To: netdev; +Cc: Toke Høiland-Jørgensen

There are now several places where qdisc_tree_reduce_backlog() is called
with a negative number of packets (to signal an increase in number of
packets in the queue). Rather than rely on overflow behaviour, change the
function signature to use signed integers to communicate this usage to
people reading the code.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
---
 include/net/sch_generic.h | 3 +--
 net/sched/sch_api.c       | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 9481f2c142e2..7a4957599874 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -580,8 +580,7 @@ struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
 void qdisc_reset(struct Qdisc *qdisc);
 void qdisc_put(struct Qdisc *qdisc);
 void qdisc_put_unlocked(struct Qdisc *qdisc);
-void qdisc_tree_reduce_backlog(struct Qdisc *qdisc, unsigned int n,
-			       unsigned int len);
+void qdisc_tree_reduce_backlog(struct Qdisc *qdisc, int n, int len);
 #ifdef CONFIG_NET_SCHED
 int qdisc_offload_dump_helper(struct Qdisc *q, enum tc_setup_type type,
 			      void *type_data);
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 7e4d1ccf4c87..03e26e8d0ec9 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -758,8 +758,7 @@ static u32 qdisc_alloc_handle(struct net_device *dev)
 	return 0;
 }
 
-void qdisc_tree_reduce_backlog(struct Qdisc *sch, unsigned int n,
-			       unsigned int len)
+void qdisc_tree_reduce_backlog(struct Qdisc *sch, int n, int len)
 {
 	bool qdisc_is_offloaded = sch->flags & TCQ_F_OFFLOADED;
 	const struct Qdisc_class_ops *cops;
-- 
2.19.1

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

* Re: [PATCH v2] sch_api: Change signature of qdisc_tree_reduce_backlog() to use ints
  2019-01-09 16:10 [PATCH v2] sch_api: Change signature of qdisc_tree_reduce_backlog() to use ints Toke Høiland-Jørgensen
@ 2019-01-19 17:53 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-01-19 17:53 UTC (permalink / raw)
  To: toke; +Cc: netdev

From: Toke Høiland-Jørgensen <toke@redhat.com>
Date: Wed,  9 Jan 2019 17:10:57 +0100

> There are now several places where qdisc_tree_reduce_backlog() is called
> with a negative number of packets (to signal an increase in number of
> packets in the queue). Rather than rely on overflow behaviour, change the
> function signature to use signed integers to communicate this usage to
> people reading the code.
> 
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>

Applied to net-next, thanks.

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

end of thread, other threads:[~2019-01-19 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-09 16:10 [PATCH v2] sch_api: Change signature of qdisc_tree_reduce_backlog() to use ints Toke Høiland-Jørgensen
2019-01-19 17:53 ` David Miller

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