summaryrefslogtreecommitdiff
path: root/tc/f_basic.c
AgeCommit message (Collapse)Author
2019-05-20treewide: refactor help messagesMatteo Croce
Every tool in the iproute2 package have one or more function to show an help message to the user. Some of these functions print the help line by line with a series of printf call, e.g. ip/xfrm_state.c does 60 fprintf calls. If we group all the calls to a single one and just concatenate strings, we save a lot of libc calls and thus object size. The size difference of the compiled binaries calculated with bloat-o-meter is: ip/ip: add/remove: 0/0 grow/shrink: 5/15 up/down: 103/-4796 (-4693) Total: Before=672591, After=667898, chg -0.70% ip/rtmon: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-54 (-54) Total: Before=48879, After=48825, chg -0.11% tc/tc: add/remove: 0/2 grow/shrink: 31/10 up/down: 882/-6133 (-5251) Total: Before=351912, After=346661, chg -1.49% bridge/bridge: add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-459 (-459) Total: Before=70502, After=70043, chg -0.65% misc/lnstat: add/remove: 0/1 grow/shrink: 1/0 up/down: 48/-486 (-438) Total: Before=9960, After=9522, chg -4.40% tipc/tipc: add/remove: 0/0 grow/shrink: 1/1 up/down: 18/-62 (-44) Total: Before=79182, After=79138, chg -0.06% While at it, indent some strings which were starting at column 0, and use tabs where possible, to have a consistent style across helps. Signed-off-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: David Ahern <dsahern@gmail.com>
2017-11-12drop unneeded include of syslog.hStephen Hemminger
Only arpd uses syslog Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-08-04tc actions: Improved batching and time filtered dumpingJamal Hadi Salim
dump more than TCA_ACT_MAX_PRIO actions per batch when the kernel supports it. Introduced keyword "since" for time based filtering of actions. Some example (we have 400 actions bound to 400 filters); at installation time. Using updated when tc setting the time of interest to 120 seconds earlier (we see 400 actions): prompt$ hackedtc actions ls action gact since 120000| grep index | wc -l 400 go get some coffee and wait for > 120 seconds and try again: prompt$ hackedtc actions ls action gact since 120000 | grep index | wc -l 0 Lets see a filter bound to one of these actions: .... filter pref 10 u32 filter pref 10 u32 fh 800: ht divisor 1 filter pref 10 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10 (rule hit 2 success 1) match 7f000002/ffffffff at 12 (success 1 ) action order 1: gact action pass random type none pass val 0 index 23 ref 2 bind 1 installed 1145 sec used 802 sec Action statistics: Sent 84 bytes 1 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 ... that coffee took long, no? It was good. Now lets ping -c 1 127.0.0.2, then run the actions again: prompt$ hackedtc actions ls action gact since 120 | grep index | wc -l 1 More details please: prompt$ hackedtc -s actions ls action gact since 120000 action order 0: gact action pass random type none pass val 0 index 23 ref 2 bind 1 installed 1270 sec used 30 sec Action statistics: Sent 168 bytes 2 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 And the filter? filter pref 10 u32 filter pref 10 u32 fh 800: ht divisor 1 filter pref 10 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10 (rule hit 4 success 2) match 7f000002/ffffffff at 12 (success 2 ) action order 1: gact action pass random type none pass val 0 index 23 ref 2 bind 1 installed 1324 sec used 84 sec Action statistics: Sent 168 bytes 2 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
2016-03-21tc: code cleanupStephen Hemminger
Use checkpatch to fix whitespace and other style issues.
2015-05-11tc: fill in handle before checking argcWANG Cong
When deleting a specific basic filter with handle, tc command always ignores the 'handle' option, so tcm_handle is always 0 and kernel deletes all filters in the selected group. This is wrong, we should respect 'handle' in cmdline. Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2014-10-09discourage use of direct policer interfaceJamal Hadi Salim
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
2012-04-10Convert to use rta_getattr_ functionsStephen Hemminger
User new functions (inspired by libmnl) to do type safe access of routeing attributes
2008-02-13Update various classifiers' help output for expected CLASSID syntaxPJ Waskiewicz
update: Fix the spelling of "hexidecimal" This updates the help output to specify that CLASSID should be hexidecimal. This makes sure that a user entering "flowid 1:10" gets his flow put into band 15 (0x10) and knows why. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
2008-02-07minor typo fixesStephen Hemminger
A couple of obvious typo's.
2006-12-05Remove trailing whitespaceStephen Hemminger
Go through source files and remove all trailing whitespace Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2005-06-23More missing cvs adds..shemminger