summaryrefslogtreecommitdiff
path: root/tc
AgeCommit message (Collapse)Author
2024-05-03Merge remote-tracking branch 'main/main' into nextDavid Ahern
Signed-off-by: David Ahern <dsahern@kernel.org>
2024-04-23use missing argument helperStephen Hemminger
There is a helper in utilities to handle missing argument, but it was not being used consistently. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-04-23f_flower: implement pfcp optsMichal Swiatkowski
Allow adding tc filter for PFCP header. Add support for parsing TCA_FLOWER_KEY_ENC_OPTS_PFCP. Options are as follows: TYPE:SEID. TYPE is a 8-bit value represented in hex and can be 1 for session header and 0 for node header. In PFCP packet this is S flag in header. SEID is a 64-bit session id value represented in hex. This patch enables adding hardware filters using PFCP fields, see [1]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=d823265dd45bbf14bd67aa476057108feb4143ce Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com> Signed-off-by: David Ahern <dsahern@kernel.org>
2024-04-21tc/util: remove unused argument from print_tcstats2_attrStephen Hemminger
The function doesn't use the FILE handle. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
2024-04-21tc/police: remove unused argument to tc_print_policeStephen Hemminger
FILE handle no longer used. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
2024-04-21tc/util: remove unused argument from print_action_controlStephen Hemminger
The FILE handle is no longer used. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
2024-04-21tc/util: remove unused argument from print_tmStephen Hemminger
File argument no longer used. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
2024-04-21tc/u32: remove FILE argumentStephen Hemminger
The pretty printing routines no longer use the file handle. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David Ahern <dsahern@kernel.org>
2024-03-13simple: support json outputStephen Hemminger
Last action that never got JSON support. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-13skbmod: support json in printStephen Hemminger
This tc action never got jsonized. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-13pedit: log errors to stderrStephen Hemminger
The errors should bo to stderr, not to stdout. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-13tc: support JSON for legacy statsStephen Hemminger
The extended stats already supported JSON output, add to the legacy stats as well. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-13tc: remove no longer used helpersStephen Hemminger
The removal of tick usage in netem, means that some of the helper functions in tc are no longer used and can be safely removed. Other functions can be made static. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-13netem: use 64 bit value for latency and jitterStephen Hemminger
The current version of netem in iproute2 has a maximum of 4.3 seconds because of scaled 32 bit clock values. Some users would like to be able to use larger delays to emulate things like storage delays. Since kernel version 4.15, netem qdisc had netlink parameters to express wider range of delays in nanoseconds. But the iproute2 side was never updated to use them. This does break compatibility with older kernels (4.14 and earlier). With these out of support kernels, the latency/delay parameter will end up being ignored. Reported-by: Marc Blanchet <marc.blanchet@viagenie.ca> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-12tc: make exec_util arg constStephen Hemminger
The callbacks in exec_util should not be modifying underlying qdisc operations structure. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-12tc: make action_util arg constStephen Hemminger
The callbacks in action_util should not be modifying underlying qdisc operations structure. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-12tc: make filter_util args constStephen Hemminger
The callbacks in filter_util should not be modifying underlying qdisc operations structure. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-12tc: make qdisc_util arg constStephen Hemminger
The callbacks in qdisc_util should not be modifying underlying qdisc operations structure. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-11Merge branch 'main' of ↵Stephen Hemminger
git://git.kernel.org/pub/scm/network/iproute2/iproute2-next
2024-03-11tc/action: remove trailing whitespaceStephen Hemminger
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-03-04tc: Fix json output for f_u32Takanori Hirano
Signed-off-by: Takanori Hirano <me@hrntknr.net> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-02-27Merge remote-tracking branch 'main/main' into nextDavid Ahern
Signed-off-by: David Ahern <dsahern@kernel.org>
2024-02-19tc: Support json option in tc-cgroup, tc-flow and tc-routeTakanori Hirano
Fix json corruption when using the "-json" option in some cases Signed-off-by: Takanori Hirano <me@hrntknr.net> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-02-19tc: Change of json format in tc-fwTakanori Hirano
In the case of a process such as mapping a json to a structure, it can be difficult if the keys have the same name but different types. Since handle is used in hex string, change it to fw. Signed-off-by: Takanori Hirano <me@hrntknr.net> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-02-18Merge remote-tracking branch 'main/main' into nextDavid Ahern
Signed-off-by: David Ahern <dsahern@kernel.org>
2024-02-10tc: u32: check return value from snprintfStephen Hemminger
Add assertion to check for case of snprintf failing (bad format?) or buffer getting full. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-02-10tc: drop no longer used prototype from tc_util.hStephen Hemminger
Part of the ipt removal missed this. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-02-10tc: print unknown action on stderrStephen Hemminger
This is an error, and should not go to stdout. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-02-10tc: bpf: fix extra newline in JSON outputStephen Hemminger
Don't print newline at end of bpf if in JSON mode. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-02-10tc: Support json option in tc-fw.Takanori Hirano
Fix json corruption when using the "-json" option in cases where tc-fw is set. Signed-off-by: Takanori Hirano <me@hrntknr.net> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-02-10tc: u32: errors should be printed on stderrStephen Hemminger
Don't corrupt stdout with error messages, matters if JSON is used. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-02-09treewide: fix typos in various commentsAndrea Claudi
Fix various typos and spelling errors in some iproute2 comments. Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Andrea Claudi <aclaudi@redhat.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-30tc: Add NLM_F_ECHO support for filtersVictor Nogueira
If the user specifies this flag for a filter command the kernel will return the command's result back to user space. For example: tc -echo filter add dev lo parent ffff: protocol ip matchall action ok added filter dev lo parent ffff: protocol ip pref 49152 matchall chain 0 As illustrated above, the kernel will give us a pref of 491252 The same can be done for other filter commands (replace, delete, and change). For example: tc -echo filter del dev lo parent ffff: pref 49152 protocol ip matchall deleted filter dev lo parent ffff: protocol ip pref 49152 matchall chain 0 Signed-off-by: Victor Nogueira <victor@mojatatu.com> Reviewed-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: David Ahern <dsahern@kernel.org>
2024-01-30tc: add NLM_F_ECHO support for actionsVictor Nogueira
This patch adds the -echo flag to tc command line and support for it in tc actions. If the user specifies this flag for an action command, the kernel will return the command's result back to user space. For example: tc -echo actions add action mirred egress mirror dev lo total acts 0 Added action action order 1: mirred (Egress Mirror to device lo) pipe index 10 ref 1 bind 0 not_in_hw As illustrated above, the kernel will give us an index of 10 The same can be done for other action commands (replace, change, and delete). For example: tc -echo actions delete action mirred index 10 total acts 0 Deleted action action order 1: mirred (Egress Mirror to device lo) pipe index 10 ref 0 bind 0 not_in_hw Signed-off-by: Victor Nogueira <victor@mojatatu.com> Reviewed-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: David Ahern <dsahern@kernel.org>
2024-01-25spelling fixesStephen Hemminger
Use codespell and ispell to fix some spelling errors in comments and README's. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-25m_mirred: Allow mirred to blockVictor Nogueira
So far the mirred action has dealt with syntax that handles mirror/redirection for netdev. A matching packet is redirected or mirrored to a target netdev. In this patch we enable mirred to mirror to a tc block as well. IOW, the new syntax looks as follows: ... mirred <ingress | egress> <mirror | redirect> [index INDEX] < <blockid BLOCKID> | <dev <devname>> > Examples of mirroring or redirecting to a tc block: $ tc filter add block 22 protocol ip pref 25 \ flower dst_ip 192.168.0.0/16 action mirred egress mirror blockid 22 $ tc filter add block 22 protocol ip pref 25 \ flower dst_ip 10.10.10.10/32 action mirred egress redirect blockid 22 Co-developed-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Co-developed-by: Pedro Tammela <pctammela@mojatatu.com> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com> Signed-off-by: Victor Nogueira <victor@mojatatu.com> Signed-off-by: David Ahern <dsahern@kernel.org>
2024-01-21tc: better clockid handlingStephen Hemminger
All clockid values not available on some older glibc versions. Also, add some comments. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-19tc: unify clockid handlingStephen Hemminger
There are three places in tc which all have same code for handling clockid (copy/paste). Move it into tc_util.c. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-01-08remove support for iptables actionStephen Hemminger
There is an open upstream kernel patch to remove ipt action from kernel. This is corresponding iproute2 change. - Remove support fot ipt and xt in tc. - Remove no longer used header files. - Update man pages. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David Ahern <dsahern@kernel.org>
2023-12-06tc: fq: reports stats added in linux-6.7Eric Dumazet
Report new fields added in linux-6.7: - fastpath : Number of packets that have used the fast path. - band[012]_pkts : Number of packets currently queued per band. - band[012]_drops : Counters of dropped packets, per band (only printed if not zero) Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David Ahern <dsahern@kernel.org>
2023-12-06tc: fq: add TCA_FQ_WEIGHTS handlingEric Dumazet
Linux-6.7 FQ got WRR scheduling. TCA_FQ_WEIGHTS attribute can report/change per-band weights. tc qdisc show dev eth1 ... qdisc fq ... weights 589824 196608 65536 quantum 8364b ... Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David Ahern <dsahern@kernel.org>
2023-12-06tc: fq: add TCA_FQ_PRIOMAP handlingEric Dumazet
linux-6.7 FQ packet scheduler gets 3-bands, and the ability to report or program the associated priomap. $ tc qdisc show dev eth0 ... qdisc fq ... bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 $ tc qdisc change dev eth0 ... qdisc fq ... bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David Ahern <dsahern@kernel.org>
2023-11-06Merge branch 'main' of ↵Stephen Hemminger
git://git.kernel.org/pub/scm/network/iproute2/iproute2-next
2023-10-30tc: drop support for ATM qdiscStephen Hemminger
The upstream kernel dropped support for ATM qdisc in fb38306ceb9e (net/sched: Retire ATM qdisc, 2023-02-14) Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-10-30tc: remove dsmark qdiscStephen Hemminger
The kernel has removed support for dsmark qdisc in commit bbe77c14ee61 (net/sched: Retire dsmark qdisc, 2023-02-14) Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-10-30tc: remove tcindex classifierStephen Hemminger
Support for tcindex classifier was removed by upstream commit 8c710f75256b (net/sched: Retire tcindex classifier, 2023-02-14) Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-10-30tc: remove support for RSVP classifierStephen Hemminger
The RSVP classifier was removed in 6.3 kernel by upstream commit 265b4da82dbf (net/sched: Retire rsvp classifier, 2023-02-14) Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-10-30tc: remove support for CBQStephen Hemminger
The CBQ qdisc was removed in 6.3 kernel by upstream 051d44209842 (net/sched: Retire CBQ qdisc, 2023-02-14) Remove associated support from iproute2 including dropping tests, man pages and fixing other references. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2023-10-04Merge remote-tracking branch 'main/main' into nextDavid Ahern
Signed-off-by: David Ahern <dsahern@kernel.org>
2023-09-17fix set-not-used warningsStephen Hemminger
Building with clang and warnings enabled finds several places where variable was set but not used. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>