Commit Graph

33 Commits

Author SHA1 Message Date
Ivan Kolodyazhny
7f2b136d34 qdisc ingress_block support 2022-12-13 09:41:45 -08:00
Anton Protopopov
1a118fe229 Add horizon attributes to fq
Add two attributes to fq: Horizon and HorizonDrop (which correspond to the
TCA_FQ_HORIZON and TCA_FQ_HORIZON_DROP attributes). The HorizonDrop attribute
specifies which policy to apply: drop (1, kernel default), cap delivery time to
horizon (0), and the Horizon attribute specifies the number of useconds before
applying the policy.

Add a new test TestFqHorizon to test the changes and as an example of usage.

Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
2022-06-08 12:58:07 -07:00
Wu Zongyong
9ada19101f filter: add support for police action
This patch adds support for tc police action. And codes of fw filter
have been refactored with the police action for reducing redundant
codes.

Signed-off-by: Wu Zongyong <wuzongyong@linux.alibaba.com>
2021-11-29 08:39:51 -08:00
Tobias Klauser
4ef7bcbf15 Don't re-initialize or shadow package level var native to fix data race
The package level var native (holding the native endianness) is
initialized at package load time. Thus there is no need to re-initalize
it in functions using it, e.g. (*Handle).filterModify, parseU32Data,
parseFwData, parseBpfData and parseMatchAllData.

This fixes a data race between these functions and any read access of
var native, e.g. in LinkDeserialize as reported in issue #633.

Also don't re-declare local variables shadowing the global package-level
var.

Fixes #633

Signed-off-by: Tobias Klauser <tobias@cilium.io>
2021-05-10 07:24:37 -07:00
Sargun Dhillon
a67bebfcc8 Add support for addition FQ Codel knobs
These knobs are supported in recent kernels, and are useful for tuning
in the datacenter.
2020-12-28 10:28:43 -08:00
Ivan Milchev
abd6d09710 added support for SFQ qdiscs 2020-10-19 15:28:26 -04:00
Chun Chen
339a215d65 Fix NewHtbClass
- Prio and Quantum should be set equal to the input params
- Fix buffer and cbuffer due to incorrect hz
- Fix Xmittime which is also not equal the behavior of c library.
C library converts time to uint32 to drop precision before multiply
tick_in_usec. ref https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/tc/tc_core.c#n62
2020-09-15 14:32:20 -04:00
Julian Kornberger
e137ed6e2c Replace nl.NewRtAttrChild with method on struct 2018-10-30 10:31:19 -07:00
Joe Stringer
531df7a209 Avoid serializing empty TCA_OPTIONS in qdisc messages
This was causing a QdiscReplace() call for a generic qdisc
(QdiscType="clsact", Parent=HANDLE_CLSACT) to fail with the error
"invalid argument" after the qdisc was first created.

Signed-off-by: Joe Stringer <joe@wand.net.nz>
2018-10-16 11:53:53 -07:00
Francis Begyn
1006cf4f24 Implementation of HFSC
Testing and functionality for the use of HFSC has been implemented.
The use of service curves is implenented closely as to how they behave
with the TC implementation.
Automated checks and testing were succesful.
2018-07-16 12:14:02 -07:00
Sargun Dhillon
a2af46a09c Add FQ Codel 2018-02-05 10:22:15 -08:00
Sargun Dhillon
465b5fef28 Add Fq Qdisc support 2018-02-05 10:22:15 -08:00
Ian Bishop
0e3b74dbe2 replace syscall with golang.org/x/sys/unix 2017-10-26 09:45:08 -07:00
Julian Kornberger
619f36a9ae Convert if/else statements to switch 2017-09-24 11:05:26 -07:00
Vishvananda Ishaya Abrams
c19091b1c6 Add support for peakrate and minburst. 2017-02-08 10:29:21 -08:00
Vishvananda Ishaya Abrams
1890b34fa3 Fix a panic in parseTbfData.
Include all 8 bytes when generating the native Uint64 otherwise this
code may encounter an index out of range panic.
2017-01-05 15:59:13 -08:00
Vishvananda Ishaya Abrams
c750a61f18 Set rates higher than 32bit integers 2016-12-13 18:04:10 -08:00
Vish Ishaya
0bc457d244 fix darwin build by moving code (#138)
Fixes issue #135
2016-06-15 08:44:14 -07:00
Alessandro Boch
f116a3048a Use package empty handle for pkg APIs (#117)
- Package methods only need an empty handle.
  Not a regular Handle with a couple of
  sockets creation/delete.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-09 16:55:00 -07:00
Alessandro Boch
14f41c27fa Provide netlink handle (#104)
- Ties to a netlink socket. All client requests
  will re-use same socket. Socket released at
  handle deletion.
- Also network namespace can be specified during
  handle creation. Socket will be opened on the
  specified network namespace.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-08 11:35:49 -07:00
Vishvananda Ishaya
adb0f53af6 Cleanup from golint and go vet 2016-03-19 17:12:26 -07:00
chantra
eeca6ddad9 [qdisc] refactor all commands to use qdiscModify function 2015-11-12 09:55:13 -05:00
chantra
e1c5c4e664 [qdisc] move building payload i its own function 2015-11-12 09:46:43 -05:00
chantra
b530ef5ad1 [qdisc] add support for replace/change 2015-11-11 23:57:32 -05:00
chantra
322c7826d2 [netem] add support for reordering/corruption/correlation
Note: This requires #58 to be merged in order to properly work.
2015-10-28 00:22:47 -07:00
chantra
9b7c60d6bd [netem] minimalist support for netem
Support for tc_netem_qopt options, e.g: latency, limit, loss, gap, duplicate and jitter
2015-10-28 00:22:47 -07:00
chantra
ef0cd12f0c Add TC Class support 2015-09-10 22:50:54 -07:00
chantra
2a6a59d231 Enable HTB classful qdisc 2015-09-05 00:13:17 -07:00
Vishvananda Ishaya
25d051e40e add prio qdisc 2015-08-19 18:22:02 -07:00
Vishvananda Ishaya
7b3d58b87e skip qdiscs from other interfaces 2015-08-19 16:51:48 -07:00
Vishvananda Ishaya
acc8a28738 Add basic support for redirect filter 2015-08-19 16:02:04 -07:00
Vishvananda Ishaya
a6d6ef6a6a support basic tbf qdisc 2015-08-18 14:07:01 -07:00
Vishvananda Ishaya
c9399c7e3d beginning of handling for qdiscs 2015-08-18 03:16:54 -07:00