platform: rework qdisc synchronization

System Internals / NetworkManager - Beniamino Galvani [] - 28 May 2020 15:25 UTC

Rework qdisc synchronization. The previous implementation added all known qdiscs and removed unneeded ones from platform; this had some problems:

- kernel doesn't allow to add (with exclusive flag) a qdisc if one with the same parent already exists;

- if we use the replace flag instead of add, then it becomes possible to add a new qdisc with the same parent of an existing one. However if the existing qdisc is of the same kind, kernel will try to to change() it, which fails for some qdiscs (e.g. sfq).

- kernel doesn't allow to delete a qdisc with handle of zero because that is the default qdisc and can only be replaced;

Fix that.

906450283 platform: rework qdisc synchronization
src/platform/nm-platform.c | 55 +++++++++++++++++++++++++++++++++++++---------
src/platform/nm-platform.h | 3 +++
2 files changed, 48 insertions(+), 10 deletions(-)


  • Share