Thread (51 messages) 51 messages, 7 authors, 2023-05-24

Re: [PATCH net 6/6] net/sched: qdisc_destroy() old ingress and clsact Qdiscs before grafting

From: Peilin Ye <hidden>
Date: 2023-05-15 22:45:27
Also in: lkml

On Thu, May 11, 2023 at 05:11:23PM -0700, Peilin Ye wrote:
quoted
quoted
->init() may be too early, aren't there any error points which could
prevent the Qdisc from binding after ->init() was called?
You're right, it's in qdisc_create(), argh...
->destroy() is called for all error points between ->init() and
dev_graft_qdisc().  I'll try handling it in ->destroy().
Sorry for any confusion: there is no point at all undoing "setting dev
pointer to b1" in ->destroy() because datapath has already been affected.

To summarize, grafting B mustn't fail after setting dev pointer to b1, so
->init() is too early, because e.g. if user requested [1] to create a rate
estimator, gen_new_estimator() could fail after ->init() in
qdisc_create().

On the other hand, ->attach() is too late because it's later than
dev_graft_qdisc(), so concurrent filter requests might see uninitialized
dev pointer in theory.

Please suggest; is adding another callback (or calling ->attach()) right
before dev_graft_qdisc() for ingress (clsact) Qdiscs too much for this
fix?

[1] e.g. $ tc qdisc add dev eth0 estimator 1s 8s clsact

Thanks,
Peilin Ye
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help