Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qdisc all delete #801

Closed
leeseungbin opened this issue May 20, 2021 · 7 comments
Closed

qdisc all delete #801

leeseungbin opened this issue May 20, 2021 · 7 comments

Comments

@leeseungbin
Copy link

can I delete all existing qdisc settings without knowing the interface index and knowing which interfaces exist?

@svinota
Copy link
Owner

svinota commented May 20, 2021

There is no RTNL operation to delete all qdiscs, thus no such mapping in IPRoute.tc(). Thus only walking through interfaces, getting qdiscs and removing them one by one.

I can schedule this feature as one call tc('flush') with optional index to flush qdiscs on all or a specific interface.

@svinota svinota added the fr label May 20, 2021
@leeseungbin
Copy link
Author

There is no RTNL operation to delete all qdiscs, thus no such mapping in IPRoute.tc(). Thus only walking through interfaces, getting qdiscs and removing them one by one.

I can schedule this feature as one call tc('flush') with optional index to flush qdiscs on all or a specific interface.

thank you!
It was decided to do it with the one by one deletion method.

I have one question
qdisc information is below.
Can I set the limit of pfifo when creating qdisc using the tc function?
i think this code -> tc('add', 'pfifo', self.ip_route.link_lookup(ifname=target_key)[0], parent='1:1', limit=700)
but limit was not set.
Is this because sched_pfifo_fast.py only has band and priomap field?

(venv) root@futurue4:/usr/lib/python3.8/site-packages/pyroute2# tc qdisc show dev enp0s18
qdisc prio 1: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc htb 2: parent 1:2 r2q 10 default 0x10 direct_packets_stat 0 direct_qlen 1000
qdisc pfifo 8003: parent 1:1 limit 1000p
qdisc htb 30: parent 2:30 r2q 10 default 0x10 direct_packets_stat 0 direct_qlen 1000
qdisc htb 10: parent 2:10 r2q 10 default 0x10 direct_packets_stat 0 direct_qlen 1000
qdisc htb 20: parent 2:20 r2q 10 default 0x10 direct_packets_stat 0 direct_qlen 1000

@svinota
Copy link
Owner

svinota commented May 20, 2021

That's 'cause [p|b]fifo parameters setup is not implemented in the library. I schedule this feature as well.

First I have to finish changing the package layout and fix issues caused by this change, and then these two features (flush & fifo) will be in 0.6.2

@leeseungbin
Copy link
Author

That's 'cause [p|b]fifo parameters setup is not implemented in the library. I schedule this feature as well.

First I have to finish changing the package layout and fix issues caused by this change, and then these two features (flush & fifo) will be in 0.6.2
The current pyroute2 is also great, but I'm looking forward to more in the future.
It helped me a lot and I am very grateful.
If you ever come to Korea, please contact me. I will buy you a cold beer.

svinota added a commit that referenced this issue May 22, 2021
@svinota
Copy link
Owner

svinota commented May 22, 2021

pfifo support with limit added:

ipr.tc('add',
       kind='pfifo',
       index=ipr.link_lookup(ifname='test0'),
       limit=700)

The feature requires more work as it still raises warnings etc, but it works on the master

If you ever come to Korea, please contact me

Sure :) It's a bit tough to travel nowadays, but I would love to get there one day.

svinota added a commit that referenced this issue May 22, 2021
@svinota
Copy link
Owner

svinota commented May 22, 2021

ipr.tc() extended:

  • ipr.tc('del') — remove all root qdiscs except the one on lo
  • ipr.tc('del', index=[2,3,4]) — remove root qdiscs on all interfaces in the list

svinota added a commit that referenced this issue May 22, 2021
@svinota
Copy link
Owner

svinota commented May 28, 2021

Closing as resolved. Feel free to reopen the ticket if you see more issues with the feature.

@svinota svinota closed this as completed May 28, 2021
@svinota svinota added the fixed label May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants