Closed daniel-noland closed 2 weeks ago
Sorry, I didn't mean to label this as a bug.
Adding this functionallity and being able to independently define actions in tc sounds like a good addition. From a first glance, it looks to me, as tc action
is similar to tc qdisc
or tc filter
and so implementing it should be similar to Qdisc
or Filter
.
Thanks for suggesting this feature and volunteering to add it. I'm happy to accept a PR.
Not sure about your progress and status of work at @daniel-noland. As there was no updated so far, I went ahead and started working on it with https://github.com/florianl/go-tc/pull/150.
Closing with the merge of https://github.com/florianl/go-tc/pull/150.
Oh, you are ahead of me and more :smile:
Glad you got this done.
I had to learn more than I expected to about tc and netlink and the arch of this library so I was quite slow.
I did manage to implement it over here rust-netlink/netlink-packet-route#122 since I am notably more fluent in rust than go. I will compare our implementations and see if I can learn some stuff :smiley:
No worry :) I'm kind of familiar with this code base and netlink. As I'm less familiar with Rust, I will look at https://github.com/rust-netlink/netlink-packet-route/pull/122 to learn more.
I would like to add support for functionality equivalent to the
tc actions
commands to this library, but I wanted to make sure that this is desirable from your point of view before I spend the time.Summary of functionality I would like to add
tc
allows actions to be created independently of filters. Once created, these actions may thenFor example, consider the following :
At this point, we could
list the
mirred
actionslist the
gact
actionscreate any number of filters using either or both of these actions by index
display those filters as normal (with per-action statistics)
centrally update those actions (e.g., change
drop
topass
)attempts to delete those actions while in use will be rejected (albeit with a buggy error message from
iproute2
/tc
)Removing all filters that use an action will allow the action to be deleted
If you are interested I will work on it and submit a patch.