Re: [PATCH iproute2-next 11/15] lib: Extract from iplink_vlan a helper to parse key:value arrays

2020-10-20 Thread Roman Mashak
Petr Machata writes: [...] > +static int parse_qos_mapping(__u32 key, char *value, void *data) > +{ > + struct nlmsghdr *n = data; > + struct ifla_vlan_qos_mapping m = { > + .from = key, > + }; > + > + if (get_u32(&m.to, value, 0)) > + return 1; > + > +

[PATCH iproute2 1/1] ip: updated ip-link man page

2020-09-01 Thread Roman Mashak
Added description of link flags allmulticast, promisc and trailers. Signed-off-by: Roman Mashak --- man/man8/ip-link.8.in | 22 ++ 1 file changed, 22 insertions(+) diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 367105b72f44..f451ecf3418f 100644 --- a/man

Re: [PATCH iproute2-next v2] iproute2: ss: add support to expose various inet sockopts

2020-08-19 Thread Roman Mashak
Wei Wang writes: > This commit adds support to expose the following inet socket options: > -- recverr > -- is_icsk > -- freebind > -- hdrincl > -- mc_loop > -- transparent > -- mc_all > -- nodefrag > -- bind_address_no_port > -- recverr_rfc4884 > -- defer_connect > with the option --inet-sockopt.

Re: [PATCH net v2] sched: consistently handle layer3 header accesses in the presence of VLANs

2020-07-03 Thread Roman Mashak
Toke Høiland-Jørgensen writes: [...] > +/* A getter for the SKB protocol field which will handle VLAN tags > consistently > + * whether VLAN acceleration is enabled or not. > + */ > +static inline __be16 skb_protocol(const struct sk_buff *skb, bool skip_vlan) > +{ > + unsigned int offset =

[PATCH v2 iproute2-next 1/1] tc: report time an action was first used

2020-05-27 Thread Roman Mashak
Have print_tm() dump firstuse value along with install, lastuse and expires. v2: Resubmit after 'master' merged into next Signed-off-by: Roman Mashak --- tc/tc_util.c | 4 1 file changed, 4 insertions(+) diff --git a/tc/tc_util.c b/tc/tc_util.c index fd5fcb242b64..b7ff911b6

Re: [PATCH iproute2-next 1/1] tc: report time an action was first used

2020-05-24 Thread Roman Mashak
David Ahern writes: > On 5/17/20 7:28 AM, Roman Mashak wrote: >> Have print_tm() dump firstuse value along with install, lastuse >> and expires. >> >> Signed-off-by: Roman Mashak >> --- >> tc/tc_util.c | 5 + >> 1 file changed, 5 insertio

[PATCH iproute2 v2 1/1] tc: action: fix time values output in JSON format

2020-05-19 Thread Roman Mashak
Report tcf_t values in seconds, not jiffies, in JSON format as it is now for stdout. v2: use PRINT_ANY, drop the useless casts and fix the style (Stephen Hemminger) Fixes: 2704bd625583 ("tc: jsonify actions core") Cc: Jiri Pirko Signed-off-by: Roman Mashak --- tc/tc_u

Re: [PATCH iproute2 1/1] tc: action: fix time values output in JSON format

2020-05-19 Thread Roman Mashak
Stephen Hemminger writes: > On Mon, 18 May 2020 13:29:18 -0400 > Roman Mashak wrote: > >> Report tcf_t values in seconds, not jiffies, in JSON format as it is now >> for stdout. >> >> Fixes: 2704bd625583 ("tc: jsonify actions core") >&g

[PATCH iproute2 1/1] tc: action: fix time values output in JSON format

2020-05-18 Thread Roman Mashak
Report tcf_t values in seconds, not jiffies, in JSON format as it is now for stdout. Fixes: 2704bd625583 ("tc: jsonify actions core") Cc: Jiri Pirko Signed-off-by: Roman Mashak --- tc/tc_util.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tc/tc_u

Re: [PATCH iproute2-next 1/1] tc: report time an action was first used

2020-05-18 Thread Roman Mashak
David Ahern writes: > On 5/17/20 7:28 AM, Roman Mashak wrote: >> Have print_tm() dump firstuse value along with install, lastuse >> and expires. >> >> Signed-off-by: Roman Mashak >> --- >> tc/tc_util.c | 5 + >> 1 file changed, 5 insert

Re: [PATCH net 1/1] net sched: fix reporting the first-time use timestamp

2020-05-17 Thread Roman Mashak
Cong Wang writes: > On Sun, May 17, 2020 at 5:47 AM Roman Mashak wrote: >> >> When a new action is installed, firstuse field of 'tcf_t' is explicitly set >> to 0. Value of zero means "new action, not yet used"; as a packet hits the >> action, '

[PATCH iproute2-next 1/1] tc: report time an action was first used

2020-05-17 Thread Roman Mashak
Have print_tm() dump firstuse value along with install, lastuse and expires. Signed-off-by: Roman Mashak --- tc/tc_util.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tc/tc_util.c b/tc/tc_util.c index 12f865cc71bf..f6aa2ed552a9 100644 --- a/tc/tc_util.c +++ b/tc/tc_util.c @@ -760,6

[PATCH net 1/1] net sched: fix reporting the first-time use timestamp

2020-05-17 Thread Roman Mashak
n has not yet been hit. Fixes: 48d8ee1694dd ("net sched actions: aggregate dumping of actions timeinfo") Cc: Jamal Hadi Salim Signed-off-by: Roman Mashak Acked-by: Jamal Hadi Salim --- include/net/act_api.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/net

[PATCH net 1/1] neigh: send protocol value in neighbor create notification

2020-05-01 Thread Roman Mashak
Signed-off-by: Roman Mashak --- net/core/neighbour.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 39d37d0ef575..116139233d57 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1956,6 +1956,9 @@ static int

Re: [PATCH net-next 00/13] Control action percpu counters allocation by netlink flag

2019-10-22 Thread Roman Mashak
Vlad Buslov writes: > On Tue 22 Oct 2019 at 17:35, Marcelo Ricardo Leitner > wrote: >> On Tue, Oct 22, 2019 at 05:17:51PM +0300, Vlad Buslov wrote: >>> Currently, significant fraction of CPU time during TC filter allocation >>> is spent in percpu allocator. Moreover, percpu allocator is protect

[PATCH net-next 1/1] tc-testing: updated pedit TDC tests

2019-10-19 Thread Roman Mashak
Added test cases for IP header operations: - set tos/precedence - add value to tos/precedence - clear tos/precedence - invert tos/precedence Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/pedit.json | 200 + 1 file changed, 200 insertions(+) diff

[PATCH net-next 1/1] tc-testing: updated pedit test cases

2019-10-14 Thread Roman Mashak
Added TDC test cases for Ethernet LAYERED_OP operations: - set single source Ethernet MAC - set single destination Ethernet MAC - set single invalid destination Ethernet MAC - set Ethernet type - invert source/destination/type fields - add operation on Ethernet type field Signed-off-by: Roman

[PATCH net-next 1/1] tc-testing: updated pedit test cases

2019-10-09 Thread Roman Mashak
Added test case for layered IP operation for a single source IP4/IP6 address and a single destination IP4/IP6 address. Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/pedit.json | 101 - 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a

[PATCH net-next 1/1] tc-testing: added tdc tests for matchall filter

2019-08-09 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/filters/matchall.json | 391 + 1 file changed, 391 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/filters/matchall.json diff --git a/tools/testing/selftests/tc-testing/tc-tests

[PATCH net 1/2] net sched: update skbedit action for batched events operations

2019-08-07 Thread Roman Mashak
Add get_fill_size() routine used to calculate the action size when building a batch of events. Fixes: ca9b0e27e ("pkt_action: add new action skbedit") Signed-off-by: Roman Mashak --- net/sched/act_skbedit.c | 12 1 file changed, 12 insertions(+) diff --git a

[PATCH net 0/2] Fix batched event generation for skbedit action

2019-08-07 Thread Roman Mashak
ack in tc_action_ops of skbedit action, which calculates the action size, and passes size to tcf_add_notify()/tcf_del_notify(). patch 2 updates the TDC test suite with relevant skbedit test cases. Roman Mashak (2): net sched: update skbedit action for batched events operations tc-testing: up

[PATCH net 2/2] tc-testing: updated skbedit action tests with batch create/delete

2019-08-07 Thread Roman Mashak
Update TDC tests with cases varifying ability of TC to install or delete batches of skbedit actions. Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/skbedit.json | 47 ++ 1 file changed, 47 insertions(+) diff --git a/tools/testing/selftests/tc-testing

[PATCH net 0/2] Fix batched event generation for vlan action

2019-08-02 Thread Roman Mashak
ion size, and passes size to tcf_add_notify()/tcf_del_notify(). patch 2 updates the TDC test suite with relevant vlan test cases. Roman Mashak (2): net sched: update vlan action for batched events operations tc-testing: updated vlan action tests with batch create/delete

[PATCH net 1/2] net sched: update vlan action for batched events operations

2019-08-02 Thread Roman Mashak
Add get_fill_size() routine used to calculate the action size when building a batch of events. Fixes: c7e2b9689 ("sched: introduce vlan action") Signed-off-by: Roman Mashak --- net/sched/act_vlan.c | 9 + 1 file changed, 9 insertions(+) diff --git a/net/sched/act_vlan.c b

[PATCH net 2/2] tc-testing: updated vlan action tests with batch create/delete

2019-08-02 Thread Roman Mashak
Update TDC tests with cases varifying ability of TC to install or delete batches of vlan actions. Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/vlan.json | 94 ++ 1 file changed, 94 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc

Re: [PATCH net-next 1/2] net sched: update skbedit action for batched events operations

2019-07-25 Thread Roman Mashak
David Miller writes: > From: Roman Mashak > Date: Fri, 12 Jul 2019 18:21:59 -0400 > >> Add get_fill_size() routine used to calculate the action size >> when building a batch of events. >> >> Signed-off-by: Roman Mashak > > Please add an appropriate Fi

[PATCH net-next 1/1] tc-testing: added tdc tests for [b|p]fifo qdisc

2019-07-23 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../selftests/tc-testing/tc-tests/qdiscs/fifo.json | 304 + 1 file changed, 304 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/fifo.json diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs

[PATCH net-next v2 2/2] tc-testing: updated skbedit action tests with batch create/delete

2019-07-17 Thread Roman Mashak
Update TDC tests with cases varifying ability of TC to install or delete batches of skbedit actions. Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/skbedit.json | 47 ++ 1 file changed, 47 insertions(+) diff --git a/tools/testing/selftests/tc-testing

[PATCH net-next v2 0/2] Fix batched event generation for skbedit action

2019-07-17 Thread Roman Mashak
, and passes size to tcf_add_notify()/tcf_del_notify(). patch 2 updates the TDC test suite with relevant skbedit test cases. v2: Added Fixes: tag Added cover letter with details on the patchset Roman Mashak (2): net sched: update skbedit action for batched events operations tc-testing: updated skbed

[PATCH net-next v2 1/2] net sched: update skbedit action for batched events operations

2019-07-17 Thread Roman Mashak
Add get_fill_size() routine used to calculate the action size when building a batch of events. Fixes: ca9b0e27e ("pkt_action: add new action skbedit") Signed-off-by: Roman Mashak --- net/sched/act_skbedit.c | 12 1 file changed, 12 insertions(+) diff --git a

[PATCH net-next 2/2] tc-testing: updated skbedit action tests with batch create/delete

2019-07-12 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/skbedit.json | 47 ++ 1 file changed, 47 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/skbedit.json b/tools/testing/selftests/tc-testing/tc-tests/actions/skbedit.json

[PATCH net-next 1/2] net sched: update skbedit action for batched events operations

2019-07-12 Thread Roman Mashak
Add get_fill_size() routine used to calculate the action size when building a batch of events. Signed-off-by: Roman Mashak --- net/sched/act_skbedit.c | 12 1 file changed, 12 insertions(+) diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index 215a06705cef

[PATCH net-next 1/1] tc-tests: updated skbedit tests

2019-07-11 Thread Roman Mashak
- Added mask upper bound test case - Added mask validation test case - Added mask replacement case Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/skbedit.json | 117 + 1 file changed, 117 insertions(+) diff --git a/tools/testing/selftests/tc-testing

[PATCH iproute2 v2 2/2] tc: document 'mask' parameter in skbedit man page

2019-07-08 Thread Roman Mashak
Signed-off-by: Roman Mashak --- man/man8/tc-skbedit.8 | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/man/man8/tc-skbedit.8 b/man/man8/tc-skbedit.8 index 2459198261e6..704f63bdb061 100644 --- a/man/man8/tc-skbedit.8 +++ b/man/man8/tc-skbedit.8 @@ -9,8 +9,7 @@ skbedit

[PATCH iproute2 v2 1/2] tc: added mask parameter in skbedit action

2019-07-08 Thread Roman Mashak
Add 32-bit missing mask attribute in iproute2/tc, which has been long supported by the kernel side. v2: print value in hex with print_hex() as suggested by Stephen Hemminger. Signed-off-by: Roman Mashak --- tc/m_skbedit.c | 30 ++ 1 file changed, 26 insertions(+), 4

Re: [PATCH iproute2 1/2] tc: added mask parameter in skbedit action

2019-07-08 Thread Roman Mashak
Stephen Hemminger writes: > On Wed, 3 Jul 2019 19:05:31 -0400 > Roman Mashak wrote: > >> +if (tb[TCA_SKBEDIT_MASK]) { >> +print_uint(PRINT_ANY, "mask", "/0x%x", >> + rta_getattr_u32(tb[TCA_SKBEDIT_MASK])); >

Re: [PATCH net-next v6 5/5] selftests: tc-tests: actions: add MPLS tests

2019-07-05 Thread Roman Mashak
John Hurley writes: > Add a new series of selftests to verify the functionality of act_mpls in > TC. > > Signed-off-by: John Hurley > Reviewed-by: Simon Horman > Acked-by: Jakub Kicinski > --- > tools/testing/selftests/tc-testing/config | 1 + > .../tc-testing/tc-tests/actions/mpls

[PATCH iproute2 1/2] tc: added mask parameter in skbedit action

2019-07-03 Thread Roman Mashak
Add 32-bit missing mask attribute in iproute2/tc, which has been long supported by the kernel side. Signed-off-by: Roman Mashak --- tc/m_skbedit.c | 30 ++ 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/tc/m_skbedit.c b/tc/m_skbedit.c index

[PATCH iproute2 2/2] tc: document 'mask' parameter in skbedit man page

2019-07-03 Thread Roman Mashak
Signed-off-by: Roman Mashak --- man/man8/tc-skbedit.8 | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/man/man8/tc-skbedit.8 b/man/man8/tc-skbedit.8 index 2459198261e6..704f63bdb061 100644 --- a/man/man8/tc-skbedit.8 +++ b/man/man8/tc-skbedit.8 @@ -9,8 +9,7 @@ skbedit

[PATCH net-next 1/1] tc-testing: added tdc tests for prio qdisc

2019-06-28 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../selftests/tc-testing/tc-tests/qdiscs/prio.json | 276 + 1 file changed, 276 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/prio.json diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs

[PATCH net-next 2/2] tc-testing: updated mirred action tests with batch create/delete

2019-06-28 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/mirred.json| 94 ++ 1 file changed, 94 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json b/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json index

[PATCH net-next 1/2] net sched: update mirred action for batched events operations

2019-06-28 Thread Roman Mashak
Add get_fill_size() routine used to calculate the action size when building a batch of events. Signed-off-by: Roman Mashak --- net/sched/act_mirred.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 58e7573dded4..2857c8dd4c04 100644

[PATCH net-next 0/2] Fix batched event generation for mirred action

2019-06-28 Thread Roman Mashak
h 1 adds callback in tc_action_ops of mirred action, which calculates the action size, and passes size to tcf_add_notify()/tcf_del_notify(). patch 2 updates the TDC test suite with relevant test cases. Roman Mashak (2): net sched: update mirred action for batched events operations tc-testing: updated

[PATCH net-next 1/1] tc-testing: add ingress qdisc tests

2019-06-25 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/qdiscs/ingress.json| 102 + 1 file changed, 102 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/ingress.json diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs

[PATCH net-next 1/1] tc-tests: updated skbedit tests

2019-06-15 Thread Roman Mashak
- Added index upper bound test case - Added mark upper bound test case - Re-worded descriptions to few cases for clarity Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/skbedit.json | 62 ++ 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a

[PATCH net-next 1/1] tc-tests: added path to ip command in tdc

2019-06-15 Thread Roman Mashak
This macro $IP will be used in upcoming tc tests, which require to create interfaces etc. Signed-off-by: Roman Mashak --- tools/testing/selftests/tc-testing/tdc_config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tdc_config.py b/tools/testing

Re: [iproute2 net-next PATCH] ip: add a new parameter -Numeric

2019-06-14 Thread Roman Mashak
David Ahern writes: > On 6/12/19 10:01 AM, Roman Mashak wrote: >> Hangbin Liu writes: >> >>> Add a new parameter '-Numeric' to show the number of protocol, scope, >>> dsfield, etc directly instead of converting it to human readable name. >>

Re: [iproute2 net-next PATCH] ip: add a new parameter -Numeric

2019-06-12 Thread Roman Mashak
Hangbin Liu writes: > Add a new parameter '-Numeric' to show the number of protocol, scope, > dsfield, etc directly instead of converting it to human readable name. > Do the same on tc and ss. > > This patch is based on David Ahern's previous patch. > [...] It would be good idea to specify the

[PATCH net-next 1/1] tc-tests: updated fw with bind actions by reference use cases

2019-06-11 Thread Roman Mashak
Extended fw TDC tests with use cases where actions are pre-created and attached to a filter by reference, i.e. by action index. Signed-off-by: Roman Mashak --- .../selftests/tc-testing/tc-tests/filters/fw.json | 144 + 1 file changed, 144 insertions(+) diff --git a/tools

[PATCH iproute2 1/1] tc: Fix binding of gact action by index.

2019-06-06 Thread Roman Mashak
the order of keywords passed on the command line, we can teach gact to skip parsing arguments as soon as it sees 'gact' followed by 'index' keyword. Signed-off-by: Roman Mashak --- tc/m_gact.c | 4 1 file changed, 4 insertions(+) diff --git a/tc/m_gact.c b/tc/m_gact.

Re: [PATCH iproute2 v2] m_mirred: don't bail if the control action is missing

2019-05-20 Thread Roman Mashak
On Mon, May 20, 2019 at 5:58 AM Paolo Abeni wrote: > > The mirred act admits an optional control action, defaulting > to TC_ACT_PIPE. The parsing code currently emits an error message > if the control action is not provided on the command line, even > if the command itself completes with no error.

Re: broken behaviour of TC filter delete

2018-08-24 Thread Roman Mashak
Jiri Pirko writes: > Thu, Aug 23, 2018 at 11:39:22PM CEST, m...@mojatatu.com wrote: >> >> >>It appears that the following commit changed the behaviour of scenario where a >>filter is deleted twice: >> >>commit f71e0ca4db187af7c44987e9d21e9042c3046070 >>Author: Jiri Pirko >>Date: Mon Jul 23 09:

broken behaviour of TC filter delete

2018-08-23 Thread Roman Mashak
It appears that the following commit changed the behaviour of scenario where a filter is deleted twice: commit f71e0ca4db187af7c44987e9d21e9042c3046070 Author: Jiri Pirko Date: Mon Jul 23 09:23:05 2018 +0200 net: sched: Avoid implicit chain 0 creation Steps to reproduce : 1) create d

Re: how to (cross)connect two (physical) eth ports for ping test?

2018-08-19 Thread Roman Mashak
"Robert P. J. Day" writes: > (i'm sure this has been explained many times before, so a link > covering this will almost certainly do just fine.) > > i want to loop one physical ethernet port into another, and just > ping the daylights from one to the other for stress testing. my fedora > lapt

Re: [PATCH iproute2/next 1/2] tc/act_tunnel_key: Enable setup of tos and ttl

2018-07-19 Thread Roman Mashak
Or Gerlitz writes: > Allow to set tos and ttl for the tunnel. > > For example, here's encap rule that sets tos to the tunnel: > > tc filter add dev eth0_0 protocol ip parent : prio 10 flower \ >src_mac e4:11:22:33:44:50 dst_mac e4:11:22:33:44:70 \ >action tunnel_key set src_ip 192.168

Re: [PATCH iproute2-next] tc: m_tunnel_key: Add tunnel option support to act_tunnel_key

2018-07-06 Thread Roman Mashak
Jakub Kicinski writes: > From: Simon Horman > > Allow setting tunnel options using the act_tunnel_key action. > > Options are expressed as class:type:data and multiple options > may be listed using a comma delimiter. > > # ip link add name geneve0 type geneve dstport 0 external > # tc qdisc ad

[PATCH net-next 1/1] net sched actions: add extack messages in pedit action

2018-07-01 Thread Roman Mashak
Signed-off-by: Roman Mashak --- net/sched/act_pedit.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index ab151346d3d4..55bc96b610e8 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c @@ -144,8

[PATCH v2 net-next 3/6] net sched actions: fix sparse warning

2018-06-27 Thread Roman Mashak
eviewed-by: Simon Horman Signed-off-by: Roman Mashak --- net/sched/act_pedit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index e4b29ee79ba8..9c2d8a31a5c5 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c

[PATCH v2 net-next 2/6] net sched actions: fix coding style in pedit headers

2018-06-27 Thread Roman Mashak
Fix coding style issues in tc pedit headers detected by the checkpatch script. Reviewed-by: Simon Horman Signed-off-by: Roman Mashak --- include/net/tc_act/tc_pedit.h| 1 + include/uapi/linux/tc_act/tc_pedit.h | 9 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git

[PATCH v2 net-next 5/6] net sched actions: fix misleading text strings in pedit action

2018-06-27 Thread Roman Mashak
Change "tc filter pedit .." to "tc actions pedit .." in error messages to clearly refer to pedit action. Reviewed-by: Simon Horman Signed-off-by: Roman Mashak --- net/sched/act_pedit.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/sch

[PATCH v2 net-next 0/6] net sched actions: code style cleanup and fixes

2018-06-27 Thread Roman Mashak
ator instead of magic number for buffer length Patch 5 fixes typos in diagnostics messages Patch 6 explicitly sets unsigned char for bitwise operation v2: - submit for net-next - added Reviewed-by tags - use u8* instead of char* as per Davide Caratti suggestion Roman Mashak (6): net s

[PATCH v2 net-next 4/6] net sched actions: use sizeof operator for buffer length

2018-06-27 Thread Roman Mashak
Replace constant integer with sizeof() to clearly indicate the destination buffer length in skb_header_pointer() calls. Reviewed-by: Simon Horman Signed-off-by: Roman Mashak --- net/sched/act_pedit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sched/act_pedit.c

[PATCH v2 net-next 1/6] net sched actions: fix coding style in pedit action

2018-06-27 Thread Roman Mashak
Fix coding style issues in tc pedit action detected by the checkpatch script. Reviewed-by: Simon Horman Signed-off-by: Roman Mashak --- net/sched/act_pedit.c | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/net/sched/act_pedit.c b/net/sched

[PATCH v2 net-next 6/6] net sched actions: avoid bitwise operation on signed value in pedit

2018-06-27 Thread Roman Mashak
Since char can be unsigned or signed, and bitwise operators may have implementation-dependent results when performed on signed operands, declare 'u8 *' operand instead. Suggested-by: Davide Caratti Signed-off-by: Roman Mashak --- net/sched/act_pedit.c | 2 +- 1 file changed, 1 inser

Re: [PATCH net 1/5] net sched actions: fix coding style in pedit action

2018-06-20 Thread Roman Mashak
Davide Caratti writes: > On Tue, 2018-06-19 at 12:56 -0400, Roman Mashak wrote: >> Fix coding style issues in tc pedit action detected by the >> checkpatch script. >> >> Signed-off-by: Roman Mashak > ... > >> --- >> @@ -316,16 +318,15 @@ static in

Re: [PATCH net 5/5] net sched actions: fix misleading text strings in pedit action

2018-06-19 Thread Roman Mashak
Stephen Hemminger writes: > On Tue, 19 Jun 2018 12:56:08 -0400 [...] >> @@ -326,12 +326,12 @@ static int tcf_pedit(struct sk_buff *skb, const struct >> tc_action *a, >> } >> >> if (offset % 4) { >> -pr_info("tc filter pedi

[PATCH net 0/5] net sched actions: code style cleanup and fixes

2018-06-19 Thread Roman Mashak
ator instead of magic number for buffer length Patch 5 fixes typos in diagnostics messages Roman Mashak (5): net sched actions: fix coding style in pedit action net sched actions: fix coding style in pedit headers net sched actions: fix sparse warning net sched actions: use sizeof operator

[PATCH net 4/5] net sched actions: use sizeof operator for buffer length

2018-06-19 Thread Roman Mashak
Replace constant integer with sizeof() to clearly indicate the destination buffer length in skb_header_pointer() calls. Signed-off-by: Roman Mashak --- net/sched/act_pedit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c

[PATCH net 3/5] net sched actions: fix sparse warning

2018-06-19 Thread Roman Mashak
ned-off-by: Roman Mashak --- net/sched/act_pedit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index e4b29ee79ba8..9c2d8a31a5c5 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c @@ -290,7 +290,7 @@ static int

[PATCH net 2/5] net sched actions: fix coding style in pedit headers

2018-06-19 Thread Roman Mashak
Fix coding style issues in tc pedit headers detected by the checkpatch script. Signed-off-by: Roman Mashak --- include/net/tc_act/tc_pedit.h| 1 + include/uapi/linux/tc_act/tc_pedit.h | 9 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/net/tc_act

[PATCH net 5/5] net sched actions: fix misleading text strings in pedit action

2018-06-19 Thread Roman Mashak
Change "tc filter pedit .." to "tc actions pedit .." in error messages to clearly refer to pedit action. Signed-off-by: Roman Mashak --- net/sched/act_pedit.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/sched/act_pedit.c b/net/sch

[PATCH net 1/5] net sched actions: fix coding style in pedit action

2018-06-19 Thread Roman Mashak
Fix coding style issues in tc pedit action detected by the checkpatch script. Signed-off-by: Roman Mashak --- net/sched/act_pedit.c | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index

[PATCH iproute2-next 1/1] tc: add missing space symbol in ife output

2018-05-17 Thread Roman Mashak
In order to make TDC tests match the output patterns, the missing space character must be added in the mode output string. Signed-off-by: Roman Mashak --- tc/m_ife.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/m_ife.c b/tc/m_ife.c index 5320e94dbd48..20e9c73d9a0e

[PATCH net-next 1/1] tc-testing: fixed copy-pasting error in ife tests

2018-05-17 Thread Roman Mashak
Reported-by: Vlad Buslov Reported-by: Davide Caratti Signed-off-by: Roman Mashak --- .../selftests/tc-testing/tc-tests/actions/ife.json | 28 +++--- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/ife.json b

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-16 Thread Roman Mashak
Vlad Buslov writes: > On Wed 16 May 2018 at 14:38, Roman Mashak wrote: >> On Wed, May 16, 2018 at 2:43 AM, Vlad Buslov wrote: >>>>>>> I'm trying to run tdc, but keep getting following error even on clean >>>>>>> branch without my p

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-16 Thread Roman Mashak
On Wed, May 16, 2018 at 2:43 AM, Vlad Buslov wrote: > I'm trying to run tdc, but keep getting following error even on clean > branch without my patches: Vlad, not sure if you saw my email: Apply Roman's patch and try again https://marc.info/?l=linux-netdev&m=152639

[PATCH net-next 1/1] tc-testing: updated mirred and vlan with more tests

2018-05-15 Thread Roman Mashak
Added extra test cases for different control actions (reclassify, pipe etc.), cookies, max values & exceeding maximum, and replace existing actions unit tests. Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/mirred.json| 24 +- .../tc-testing/tc-tests/actions/vlan.

[PATCH net-next 1/1] tc-testing: fixed copy-pasting error in police tests

2018-05-15 Thread Roman Mashak
Signed-off-by: Roman Mashak --- tools/testing/selftests/tc-testing/tc-tests/actions/police.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/police.json b/tools/testing/selftests/tc-testing/tc-tests/actions

[PATCH net 1/1] net sched actions: fix refcnt leak in skbmod

2018-05-11 Thread Roman Mashak
patch fixes this by calling tcf_idr_release() on existing actions. Fixes: 86da71b57383d ("net_sched: Introduce skbmod action") Signed-off-by: Roman Mashak --- net/sched/act_skbmod.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/sched/act_skbmod.c b

[PATCH v2 net 1/1] net sched actions: fix invalid pointer dereferencing if skbedit flags missing

2018-05-11 Thread Roman Mashak
ncing it is an error as happens in tcf_idr_release, where refcnt is decremented. So in case of missing flags tcf_idr_release must be called only for existing actions. v2: - prepare patch for net tree Signed-off-by: Roman Mashak --- net/sched/act_skbedit.c | 3 ++- 1 file changed, 2 insertions(+), 1 d

[PATCH net-next 1/1] net sched actions: fix invalid pointer dereferencing if skbedit flags missing

2018-05-09 Thread Roman Mashak
rror. So checking flags should be done as early as possible, before idr lookups. Signed-off-by: Roman Mashak --- net/sched/act_skbedit.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index ddf69fc01bdf..6c88037faf51 10

[PATCH net-next 1/1] tc-testing: updated ife test cases

2018-04-20 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../selftests/tc-testing/tc-tests/actions/ife.json | 1036 +++- 1 file changed, 1024 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/ife.json b/tools/testing/selftests/tc-testing/tc-tests/actions

[PATCH iproute2 1/1] tc: return on invalid smac or dmac in ife action

2018-04-20 Thread Roman Mashak
Return on invalid smac/dmac and use invarg consistently for invalid arguments report. Signed-off-by: Roman Mashak --- tc/m_ife.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tc/m_ife.c b/tc/m_ife.c index d7e61703f666..ed0913a379aa 100644 --- a/tc/m_ife.c

[PATCH net-next 1/1] tc-testing: add sample action tests

2018-04-16 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/sample.json| 588 + 1 file changed, 588 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/sample.json diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions

[PATCH iproute2-next 1/1] tc: jsonify ife action

2018-04-13 Thread Roman Mashak
Signed-off-by: Roman Mashak --- tc/m_ife.c | 54 -- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/tc/m_ife.c b/tc/m_ife.c index d7e61703f666..15d09a167450 100644 --- a/tc/m_ife.c +++ b/tc/m_ife.c @@ -240,22 +240,24 @@ static

[PATCH v2 iproute2-next 1/1] tc: jsonify skbedit action

2018-04-10 Thread Roman Mashak
v2: FIxed strings format in print_string() Signed-off-by: Roman Mashak --- tc/m_skbedit.c | 53 + 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/tc/m_skbedit.c b/tc/m_skbedit.c index db5c64caf2ba..7391fc7f158c 100644 --- a

Re: [PATCH iproute2-next 1/1] tc: jsonify skbedit action

2018-04-09 Thread Roman Mashak
David Ahern writes: > On 4/3/18 1:24 PM, Roman Mashak wrote: >> if (tb[TCA_SKBEDIT_PTYPE] != NULL) { >> -ptype = RTA_DATA(tb[TCA_SKBEDIT_PTYPE]); >> -if (*ptype == PACKET_HOST) >> -fprintf(f, " ptype host&qu

Re: [PATCH iproute2-next] tc: Correct json output for actions

2018-04-04 Thread Roman Mashak
"order": 1, > "kind": "gact", > "control_action": { > > Relocate the open/close of the JSON object to declare the object only > for the case that needs it. > > Signed-off-by: Yuval Mintz [...] Good catch, thanks Yuval. Tested-by: Roman Mashak

[PATCH iproute2-next 1/1] tc: jsonify tunnel_key action

2018-04-04 Thread Roman Mashak
Signed-off-by: Roman Mashak --- tc/m_tunnel_key.c | 36 +--- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/tc/m_tunnel_key.c b/tc/m_tunnel_key.c index bac3c07fa90b..0fa461549ad9 100644 --- a/tc/m_tunnel_key.c +++ b/tc/m_tunnel_key.c @@ -221,7

[PATCH iproute2-next 1/1] tc: jsonify skbedit action

2018-04-03 Thread Roman Mashak
Signed-off-by: Roman Mashak --- tc/m_skbedit.c | 53 + 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/tc/m_skbedit.c b/tc/m_skbedit.c index db5c64caf2ba..070280cea29e 100644 --- a/tc/m_skbedit.c +++ b/tc/m_skbedit.c @@ -168,9

[PATCH iproute2-next 1/1] tc: jsonify connmark action

2018-04-03 Thread Roman Mashak
Signed-off-by: Roman Mashak --- tc/m_connmark.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tc/m_connmark.c b/tc/m_connmark.c index bcce41391398..45e2d05f1a91 100644 --- a/tc/m_connmark.c +++ b/tc/m_connmark.c @@ -114,16 +114,20 @@ static int

[PATCH iproute2-next 1/1] tc: jsonify sample action

2018-03-30 Thread Roman Mashak
Signed-off-by: Roman Mashak --- tc/m_sample.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tc/m_sample.c b/tc/m_sample.c index 1e18c5154fe6..39a99246a8ea 100644 --- a/tc/m_sample.c +++ b/tc/m_sample.c @@ -149,23 +149,27 @@ static int print_sample

[PATCH iproute2-next 1/1] tc: support oneline mode in action generic printer functions

2018-03-30 Thread Roman Mashak
Signed-off-by: Roman Mashak --- tc/m_action.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tc/m_action.c b/tc/m_action.c index 8891659ae15a..2f85d353279a 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -301,19 +301,21 @@ static int tc_print_one_action(FILE

[PATCH iproute2-next 1/1] tc: add online mode

2018-03-29 Thread Roman Mashak
Add initial support for oneline mode in tc; actions, filters and qdiscs will be gradually updated in the follow-up patches. Signed-off-by: Roman Mashak --- man/man8/tc.8 | 15 ++- tc/tc.c | 8 +++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/man/man8

[PATCH net-next 1/1] tc-testing: add connmark action tests

2018-03-29 Thread Roman Mashak
Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/connmark.json | 291 + 1 file changed, 291 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/connmark.json diff --git a/tools/testing/selftests/tc-testing/tc-tests

[PATCH iproute2-next 1/1] tc: enable json output for actions

2018-03-28 Thread Roman Mashak
Signed-off-by: Roman Mashak --- tc/m_action.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tc/m_action.c b/tc/m_action.c index 6c3049c7db88..8891659ae15a 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -364,6 +364,7 @@ tc_print_action(FILE *f

Re: [PATCH v3 iproute2 1/1] tc: fix conversion types when printing actions unsigned values

2018-03-27 Thread Roman Mashak
Stephen Hemminger writes: > On Mon, 19 Mar 2018 17:05:41 -0400 > Roman Mashak wrote: > >> diff --git a/tc/m_gact.c b/tc/m_gact.c >> index 16c4413f4217..52022415db48 100644 >> --- a/tc/m_gact.c >> +++ b/tc/m_gact.c >> @@ -194,7 +194,7 @@ print_gact(

Re: [PATCH iproute2 1/1] tc: print index, refcnt & bindcnt for nat action

2018-03-27 Thread Roman Mashak
Stephen Hemminger writes: > On Tue, 20 Mar 2018 14:21:47 -0400 > Roman Mashak wrote: > >> Signed-off-by: Roman Mashak >> --- >> tc/m_nat.c | 5 + >> 1 file changed, 5 insertions(+) >> >> diff --git a/tc/m_nat.c b/tc/m_nat.c >> index 1e

[RESEND PATCH net-next 1/1] tc-testing: updated police, mirred, skbedit and skbmod with more tests

2018-03-25 Thread Roman Mashak
Added extra test cases for control actions (reclassify, pipe etc.), cookies, max index value and police args sanity check. Signed-off-by: Roman Mashak --- .../tc-testing/tc-tests/actions/mirred.json| 192 + .../tc-testing/tc-tests/actions/police.json| 144

Re: [PATCH iproute2] ss: Fix rendering of continuous output (-E, --events)

2018-03-23 Thread Roman Mashak
Stefano Brivio writes: > Roman Mashak reported that ss currently shows no output when it > should continuously report information about terminated sockets > (-E, --events switch). > > This happens because I missed this case in 691bd854bf4a ("ss: > Buffer raw fields first

  1   2   3   >