Skip to content

Commit

Permalink
net: sched: remove qdisc_watchdog->last_expires
Browse files Browse the repository at this point in the history
This field mirrors hrtimer softexpires, we can instead
use the existing helpers.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20230308182648.1150762-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Eric Dumazet authored and Jakub Kicinski committed Mar 10, 2023
1 parent 513bdd9 commit 62423bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion include/net/pkt_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ static inline psched_time_t psched_get_time(void)
}

struct qdisc_watchdog {
u64 last_expires;
struct hrtimer timer;
struct Qdisc *qdisc;
};
Expand Down
6 changes: 4 additions & 2 deletions net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,14 +639,16 @@ void qdisc_watchdog_schedule_range_ns(struct qdisc_watchdog *wd, u64 expires,
return;

if (hrtimer_is_queued(&wd->timer)) {
u64 softexpires;

softexpires = ktime_to_ns(hrtimer_get_softexpires(&wd->timer));
/* If timer is already set in [expires, expires + delta_ns],
* do not reprogram it.
*/
if (wd->last_expires - expires <= delta_ns)
if (softexpires - expires <= delta_ns)
return;
}

wd->last_expires = expires;
hrtimer_start_range_ns(&wd->timer,
ns_to_ktime(expires),
delta_ns,
Expand Down

0 comments on commit 62423bd

Please sign in to comment.