summaryrefslogtreecommitdiffstats
path: root/tc
Commit message (Collapse)AuthorAgeFilesLines
* linklayer interface between kernel and tc/userspaceJesper Dangaard Brouer2013-09-035-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This iproute2 tc patch is connected to the kernel - commit 8a8e3d84b17 (net_sched: restore "linklayer atm" handling) The rate table calculated by tc, have gotten replaced in the kernel and is no-longer used for lookups. This happened in kernel release v3.8 caused by kernel - commit 56b765b79 ("htb: improved accuracy at high rates"). This change unfortunately caused breakage of tc overhead and linklayer parameters. Kernel overhead handling got fixed in kernel v3.10 by - commit 01cb71d2d47 (net_sched: restore "overhead xxx" handling) Kernel linklayer handling got fixed in kernel v3.11 by - commit 8a8e3d84b17 (net_sched: restore "linklayer atm" handling) The linklayer fix introduced a struct change, that allow the linklayer attribute to be transferred between tc and kernel. This patch make use of this linklayer attribute. The linklayer setting is transfer to the kernel. And linklayer setting received from the kernel is printed with a prefixed "linklayer" when listing current configuration. The default TC_LINKLAYER_ETHERNET is only printed in detailed output mode. Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
* tc: allow qdisc without optionsStephen Hemminger2013-08-261-9/+9
| | | | Pfifo_fast needs no options. So don't force it to have parsing code.
* More minor spelling fixesStephen Hemminger2013-08-044-7/+7
|
* Make tc and ip batch mode consistentStephen Hemminger2013-07-161-7/+8
| | | | | Change the code for tc and ip so that batch mode is handled the same.
* get_rate: detect 32bit overflowsEric Dumazet2013-06-071-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Mon, 2013-06-03 at 16:36 +0100, Ben Hutchings wrote: > Oops, I read this as being strtol() currently, not strtod(). Currently > '1.5gbit' will work, but this change will break that. So I think you > need to keep bps as a double. Arg > Then here I think the check should be *rate != floor(bps), i.e. accept > rounding down of a non-integer number of bytes but any other change is > assumed to be overflow. Thanks Ben, here is v4 then ;) [PATCH v4] get_rate: detect 32bit overflows Current rate limit is 34.359.738.360 bit per second, and unfortunately 40Gbps links are above it. overflows in get_rate() are currently not detected, and some users are confused. Let's detect this and complain. Note that some qdisc are ready to get extended range, but this will need additional attributes and new iproute2 With help from Ben Hutchings Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
* htb: fix indentationStephen Hemminger2013-06-071-50/+49
| | | | iproute2 uses kernel style indenting
* htb: report overhead attributeEric Dumazet2013-06-071-0/+2
| | | | | | | | | | | | | | | "tc class show dev ..." omits the overhead attribute for HTB. After patch I have : tc class add dev $DEV parent 1: classid 1:1 est 1sec 4sec htb \ rate 12Mbit mtu 1500 quantum 1514 overhead 20 tc class show dev $DEV class htb 1:1 root prio 0 rate 12000Kbit overhead 20 ceil 12000Kbit burst 1500b cburst 1500b Signed-off-by: Eric Dumazet <edumazet@google.com>
* iproute2: act_ipt fix xtables breakage on older versions.Alexander Duyck2013-05-011-6/+8
| | | | | | | | | | | | | | | | | | | | | | In trying to build on a RHEL6.3 I ran into several build issues that are addressed in this patch. The first is that xtables_merge_options only has 3 parameters. It appears this is how this code was originally. As such for the case where the version is less than 6 I am assuming it would be correct to maintain the original setup that only had 3 parameters being passed instead of 4. I also ran into an issue with the define for __ALIGN_KERNEL not being present. I believe this may be due to the fact that __ALIGN_KERNEL was moved into a separate header from ALIGN after the UAPI changes. In order to just cover all of the bases I have moved the main definition for the macros into __ALIGN_KERNEL_MASK and __ALIGN_KERNEL and if ALIGN is also needed then it is just a direct redefine to __ALIGN_KERNEL. Cc: Hasan Chowdhury <shemonc@gmail.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
* Fix build when shared libraries are disabledStephen Hemminger2013-03-131-0/+8
| | | | | On some platforms, shared libraries are not used. The stub code need some updating to not generate errors.
* iproute2: clearer error messages for fifo and tbf qdiscsKees van Reeuwijk2013-02-212-37/+57
| | | | | | | | | | | | | | | | Clearer error messages for fifo and tbf qdiscs: - Say who is complaining - Don't just say a parameter is bad, show the offending parameter - Be clearer about duplicate parameters vs illegal pairs of parameters - Try to give multiple error messages rather than let the user discover the errors one by one - When there are parameter aliases, try to use the variant that was used, or at least mention them all Note that in the old version an empty parameter list to tbf would just cause an explain() message without a specific error message. By simply removing the relevant error check, the code now handles this error more gracefully by printing an error message for all mandatory parameters. It still prints the explain() message. Signed-off-by: Kees van Reeuwijk <reeuwijk@few.vu.nl>
* ip: make local functions staticStephen Hemminger2013-02-1220-74/+49
|
* Use pkg-config to obtain xtables.h pathBenjamin Poirier2013-02-111-0/+2
| | | | | | | | | On openSUSE 12.2 (at least) xtables.h is not installed in the system-wide include dir but in /usr/include/iptables-1.4.16.3/. This results in the following build failure: em_ipset.c:26:21: fatal error: xtables.h: No such file or directory Other includers of xtables.h already call out to pkg-config
* iproute2: tc netem rate: allow negative packet/cell overheadJohannes Naab2013-02-041-2/+4
| | | | | | by fixing the parsing of command-line tokens Signed-off-by: Johannes Naab <jn@stusta.de>
* iproute2: act_ipt fix xtables breakageJamal Hadi Salim2013-01-161-18/+45
| | | | | | | Fixes breakage with xtables API starting with version 1.4.10 Signed-off-by: Hasan Chowdhury <shemonc@gmail.com> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
* include needed filesStrake2012-12-231-0/+1
| | | | Needed to build iproute2 with musl
* allow pkg-config to be customizedMike Frysinger2012-11-111-2/+2
| | | | | | | | | Rather than hard coding `pkg-config`, use ${PKG_CONFIG} so people can override it to their specific version (like when cross-compiling). This is the same way the upstream pkg-config code works. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* iproute2-3.6.0 assumes presence of iptablesMatt Burgess2012-10-031-1/+3
| | | | | | | | | | | | | | | | | | | Hi, When compiling iproute2-3.6.0 on a host that doesn't have iptables available, I get the following error: gcc -Wall -Wstrict-prototypes -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -DCONFIG_GACT -DCONFIG_GACT_PROB -DYY_NO_INPUT -c -o em_ipset.o em_ipset.c em_ipset.c:26:21: fatal error: xtables.h: No such file or directory Fixed by the following patch, which guards the building of em_ipset.o on the presence of suitable headers. Thanks, Matt.
* Ematch used to classify CAN frames according to their identifiersRostislav Lisovy2012-08-202-0/+192
| | | | | | | | | This ematch enables effective filtering of CAN frames (AF_CAN) based on CAN identifiers with masking of compared bits. Implementation utilizes bitmap based classification for standard frame format (SFF) which is optimized for minimal overhead. Signed-off-by: Rostislav Lisovy <lisovy@gmail.com>
* utils: invarg: msg precedes the faulty argDan Kenigsberg2012-08-173-13/+13
| | | | | | fix all call which reversed the arg order. Signed-off-by: Dan Kenigsberg <danken@redhat.com>
* tc: add ipset ematchFlorian Westphal2012-08-132-0/+269
| | | | | | | | | | | | | | | example usage: tc filter add dev $dev parent $id: basic match not ipset'(foobar src)' .. also updates iproute2/ematch_map, else tc complains: Error: Unable to find ematch "ipset" in /etc/iproute2/ematch_map Please assign a unique ID to the ematch kind the suggested entry is: 8 ipset when trying to use this ematch. (text ematch (5) only exists in kernel, a vlan ematch (6) exists neither in kernel nor userspace, but kernel headers define TCF_EM_VLAN == 6).
* tc: man: change man page and comment to confirm to code's behavior.Li Wei2012-07-121-1/+1
| | | | | | | | Since the get_rate() code incorrectly interpreted bare number, the behavior is not the same as man page and comment described. We need to change the man page and comment for compatible with the existing usage by scripts.
* tc: filter: validate filter priority in userspace.Li Wei2012-07-101-1/+1
| | | | | | | | | Because we use the high 16 bits of tcm_info to pass prio value to kernel, thus it's range would be [0, 0xffff], without validation in tc when user pass a lager(>65535) priority, the actual priority set in kernel would confuse the user. So, add a validation to ensure prio in the range.
* tc: u32: Fix firstfrag filter.Hiroaki SHIMODA2012-07-101-1/+1
| | | | | | | On current firstfrag filter, all non fragmented packets are matched. firstfrag should check MF bit. Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
* tc: u32: Fix icmp_code off.Hiroaki SHIMODA2012-07-101-1/+1
| | | | | | | The off of icmp_code is not 20 but 21. Also offmask should be 0 unless nexthdr+ is specified. Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
* tc: prio: Perform more strict check on priomap.Li Wei2012-06-181-1/+1
| | | | | Since band number counts from zero thus band must be little than opt.bands.
* tc-codel: Update usage textVijay Subramanian2012-05-241-1/+1
| | | | | | | codel can take 'noecn' as an option. This also makes it consistent with the manpage. Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
* fq_codel: Fair Queue Codel AQMEric Dumazet2012-05-222-0/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fair Queue Codel packet scheduler Principles : - Packets are classified (internal classifier or external) on flows. - This is a Stochastic model (as we use a hash, several flows might be hashed on same slot) - Each flow has a CoDel managed queue. - Flows are linked onto two (Round Robin) lists, so that new flows have priority on old ones. - For a given flow, packets are not reordered (CoDel uses a FIFO) - head drops only. - ECN capability is on by default. - Very low memory footprint (64 bytes per flow) tc qdisc ... fq_codel [ limit PACKETS ] [ flows number ] [ target TIME ] [ interval TIME ] [ noecn ] [ quantum BYTES ] Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Dave Taht <dave.taht@bufferbloat.net> Cc: Kathleen Nichols <nichols@pollere.com> Cc: Van Jacobson <van@pollere.net> Cc: Tom Herbert <therbert@google.com> Cc: Matt Mathis <mattmathis@google.com> Cc: Nandita Dukkipati <nanditad@google.com> Cc: Maciej Żenczykowski <maze@google.com> Cc: Yuchung Cheng <ycheng@google.com> Cc: Stephen Hemminger <shemminger@vyatta.com> Cc: Changli Gao <xiaosuo@gmail.com>
* tc_codel: Controlled Delay AQMEric Dumazet2012-05-222-0/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An implementation of CoDel AQM, from Kathleen Nichols and Van Jacobson. http://queue.acm.org/detail.cfm?id=2209336 This AQM main input is no longer queue size in bytes or packets, but the delay packets stay in (FIFO) queue. As we don't have infinite memory, we still can drop packets in enqueue() in case of massive load, but mean of CoDel is to drop packets in dequeue(), using a control law based on two simple parameters : target : target sojourn time (default 5ms) interval : width of moving time window (default 100ms) Selected packets are dropped, unless ECN is enabled and packets can get ECN mark instead. Usage: tc qdisc ... codel [ limit PACKETS ] [ target TIME ] [ interval TIME ] [ ecn ] qdisc codel 10: parent 1:1 limit 2000p target 3.0ms interval 60.0ms ecn Sent 13347099587 bytes 8815805 pkt (dropped 0, overlimits 0 requeues 0) rate 202365Kbit 16708pps backlog 113550b 75p requeues 0 count 116 lastcount 98 ldelay 4.3ms dropping drop_next 816us maxpacket 1514 ecn_mark 84399 drop_overlimit 0 CoDel must be seen as a base module, and should be used keeping in mind there is still a FIFO queue. So a typical setup will probably need a hierarchy of several qdiscs and packet classifiers to be able to meet whatever constraints a user might have. One possible example would be to use fq_codel, which combines Fair Queueing and CoDel, in replacement of sfq / sfq_red. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Dave Taht <dave.taht@bufferbloat.net>
* tc-netem: Add support for ECN packet markingVijay Subramanian2012-05-221-0/+26
| | | | | | | | This patch provides support for marking packets with ECN instead of dropping them with netem. This makes it possible to make use of the netem ECN marking feature that was added recently to the kernel. Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
* iproute2 - Fix up and simplify variables pointing to install directoriesChristoph J. Thompson2012-04-122-2/+2
| | | | | | | Define where is the are located the iproute2 config files. Get rid of trailing slashes for paths in several file. Signed-off-by: Christoph J. Thompson <cjsthompson@gmail.com>
* Convert to use rta_getattr_ functionsStephen Hemminger2012-04-1023-54/+54
| | | | | User new functions (inspired by libmnl) to do type safe access of routeing attributes
* csum action, fix typoAnton Danilov2012-03-151-1/+1
|
* iproute: fix tc -iec display of Mibit ratesAndreas Henriksson2012-03-101-1/+1
| | | | | | | | | | | | | | | | | | As reported by Thomas Mühlgrabner <muehltom@cable.vol.at> in http://bugs.debian.org/662979 : When showing htb class configuration with "tc -iec class show", the output for Mibit is actually the value for bit. Example: configure a class with a ceil of 1000Mibit. Output states 1048576000 Mibit. The cause is missing parenteses in the display code of tc.... (Please also note that a lower value of 100Mibit will be displayed as 102400 Kibit, which I think is kind of ugly.) Reported-by: Thomas Mühlgrabner <muehltom@cable.vol.at> Signed-off-by: Andreas Henriksson <andreas@fatal.se>
* iproute2: cleanup dependenciesYegor Yefremov2012-02-271-1/+1
| | | | | | | | | | LIBNETLINK will be defined in the main Makefile, so both ../lib/libnetlink.a ../lib/libutil.a will be automatically appended during linking. Otherwise ../lib/libnetlink.a ../lib/libutil.a will appear twice during linking. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
* iproute2: tc - mqprio formatted print fixPetr Sabata2012-02-221-2/+2
| | | | | | | Just a minor correction of mqprio printf()'s. Reported-by: Petr Písař <ppisar@redhat.com> Signed-off-by: Petr Šabata <contyk@redhat.com>
* red: add missing include math.hStephen Hemminger2012-02-061-0/+1
| | | | red now uses pow() function.
* netem: Fail cleanly if user input is wrongVijay Subramanian2012-01-201-0/+2
| | | | | | | | | | | (Resending patch since it looks like my earlier mail did not make it to netdev). netem reordering requires that the delay parameter be given. Currently, if no delay is given, tc prints the error message but still installs the qdisc. Fix this by printing the usage and failing cleanly. Signed-off-by: Vijay Subramanian <subramanian.vijay@gmail.com>
* gred: support TCA_GRED_MAX_P attributeEric Dumazet2012-01-201-4/+17
| | | | | | | | | | | | | | TCA_GRED_MAX_P permits to express high resolution probabilities. New output (on 3.3+ kernel) : disc gred 9442: root refcnt 17 DP:0 (prio 1) Average Queue 0b Measured Queue 0b Packet drops: 0 (forced 0 early 0) Packet totals: 20 (bytes 2584) limit 31460b min 3000b max 9000b ewma 5 probability 0.05 Scell_log 15 Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
* choke: support TCA_CHOKE_MAX_PEric Dumazet2012-01-201-4/+16
| | | | | | | | | | | | | | | | | | | TCA_CHOKE_MAX_P permits to express high resolution RED probability. tc qdisc add dev $DEV parent 1:1 handle 10: est 1sec 8sec choke \ limit 90 ecn min 10 max 30 probability 0.05 bandwidth 10Mbit Before patch : tc -s -d qdisc show dev eth3 qdisc ... limit 90p min 10p max 30p ecn ewma 3 Plog 19 Scell_log 13 After : qdisc ... limit 90p min 10p max 30p ecn ewma 3 probability 0.05 Scell_log 13 Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
* sfq: add optional RED on top of SFQEric Dumazet2012-01-201-10/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an optional Random Early Detection on each SFQ flow queue. Traditional SFQ limits count of packets, while RED permits to also control number of bytes per flow, and adds ECN capability as well. 1) We dont handle the idle time management in this RED implementation, since each 'new flow' begins with a null qavg. We really want to address backlogged flows. 2) if headdrop is selected, we try to ecn mark first packet instead of currently enqueued packet. This gives faster feedback for tcp flows compared to traditional RED [ marking the last packet in queue ] Example of use : tc qdisc add dev $DEV parent 1:1 handle 10: est 1sec 4sec sfq \ limit 3000 headdrop flows 512 divisor 16384 \ redflowlimit 100000 min 8000 max 60000 probability 0.20 ecn qdisc sfq 10: parent 1:1 limit 3000p quantum 1514b depth 127 headdrop flows 512/16384 divisor 16384 ewma 6 min 8000b max 60000b probability 0.2 ecn prob_mark 0 prob_mark_head 4876 prob_drop 6131 forced_mark 0 forced_mark_head 0 forced_drop 0 Sent 1175211782 bytes 777537 pkt (dropped 6131, overlimits 11007 requeues 0) rate 99483Kbit 8219pps backlog 689392b 456p requeues 0 In this test, with 64 netperf TCP_STREAM sessions, 50% using ECN enabled flows, we can see number of packets CE marked is smaller than number of drops (for non ECN flows) If same test is run, without RED, we can check backlog is much bigger. qdisc sfq 10: parent 1:1 limit 3000p quantum 1514b depth 127 headdrop flows 512/16384 divisor 16384 Sent 1148683617 bytes 795006 pkt (dropped 0, overlimits 0 requeues 0) rate 98429Kbit 8521pps backlog 1221290b 841p requeues 0 Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
* red: fix adaptive spellingEric Dumazet2012-01-201-2/+4
| | | | | Reported-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
* red: Add adaptative algo Logged in as shemmingerEric Dumazet2012-01-191-3/+21
| | | | | | | | | | | | | | | Enable Adaptative RED algo, using : tc qdisc ... red limit BYTES ... adaptative ... Support of high precision probability/max_p setting and reporting, with support of old kernels. With a new kernel, "Plog ..." is replaced in tc output by "probability value" : qdisc red 10: dev eth3 parent 1:1 limit 360Kb min 30Kb max 90Kb ecn ewma 5 probability 0.09 Scell_log 15
* tc: netem rate shaping and cell extensionHagen Paul Pfeifer2012-01-191-1/+52
| | | | | | | | | | | | This patch add rate shaping as well as cell support. The link-rate can be specified via rate options. Three optional arguments control the cell knobs: packet-overhead, cell-size, cell-overhead. To ratelimit eth0 root queue to 5kbit/s, with a 20 byte packet overhead, 100 byte cell size and a 5 byte per cell overhead: tc qdisc add dev eth0 root netem rate 5kbit 20 100 5 Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
* iproute2: fix calling up the xt actionJan Engelhardt2012-01-031-2/+2
| | | | | | | Upsteam: has not been sent yet Requesting the xt action never succeeded because it registered using the wrong name.
* iproute2: proper detection of libxtables position and flagsJan Engelhardt2012-01-031-2/+2
| | | | | | | Upstream: not sent yet Any tests involving iptables _MUST_ utilize pkg-config to find the proper locations of the installation.
* ematch: fix warning about unused input()Stephen Hemminger2012-01-031-0/+1
| | | | | Use existing compile flag to indicate that input() is not used by tc ematch, fixes compiler warning.
* ematch: fix warning about yyerror and constStephen Hemminger2012-01-031-2/+2
| | | | yyerror() should take const char * on current bison.
* libnetlink: remove unused junk callbackStephen Hemminger2011-12-284-10/+10
| | | | | | | Both rtnl_talk and rtnl_dump had a callback for handling portions of netlink message that do not match the correct pid or seq. But this callback was never used by any part of iproute2 so remove it.
* netem: fix a typo in explain()Eric Dumazet2011-12-241-1/+1
| | | | Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
* netem: add support for 4 state and GE loss modelStephen Hemminger2011-12-223-54/+206
| | | | Incorporate support for new loss models.