Skip to content

Commit

Permalink
sch_api: Change signature of qdisc_tree_reduce_backlog() to use ints
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Toke Høiland-Jørgensen authored and David S. Miller committed Jan 19, 2019
1 parent f04d402 commit 5f2939d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5f2939d

Please sign in to comment.