Skip to content

Commit 6c14818

Browse files
jrfastabdavem330
authored andcommitted
net: sched: cleanup qdisc_run and __qdisc_run semantics
Currently __qdisc_run calls qdisc_run_end() but does not call qdisc_run_begin(). This makes it hard to track pairs of qdisc_run_{begin,end} across function calls. To simplify reading these code paths this patch moves begin/end calls into qdisc_run(). Signed-off-by: John Fastabend <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fdaa767 commit 6c14818

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

include/net/pkt_sched.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ void __qdisc_run(struct Qdisc *q);
113113

114114
static inline void qdisc_run(struct Qdisc *q)
115115
{
116-
if (qdisc_run_begin(q))
116+
if (qdisc_run_begin(q)) {
117117
__qdisc_run(q);
118+
qdisc_run_end(q);
119+
}
118120
}
119121

120122
static inline __be16 tc_skb_protocol(const struct sk_buff *skb)

net/core/dev.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,9 +3192,9 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
31923192
contended = false;
31933193
}
31943194
__qdisc_run(q);
3195-
} else
3196-
qdisc_run_end(q);
3195+
}
31973196

3197+
qdisc_run_end(q);
31983198
rc = NET_XMIT_SUCCESS;
31993199
} else {
32003200
rc = q->enqueue(skb, q, &to_free) & NET_XMIT_MASK;
@@ -3204,6 +3204,7 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
32043204
contended = false;
32053205
}
32063206
__qdisc_run(q);
3207+
qdisc_run_end(q);
32073208
}
32083209
}
32093210
spin_unlock(root_lock);

net/sched/sch_generic.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,6 @@ void __qdisc_run(struct Qdisc *q)
266266
break;
267267
}
268268
}
269-
270-
qdisc_run_end(q);
271269
}
272270

273271
unsigned long dev_trans_start(struct net_device *dev)

0 commit comments

Comments
 (0)