Re: [ovs-dev] [PATCH] ofproto: Fix resource usage explosion while processing bundled FLOW_MOD.

2021-11-22 Thread Vladislav Odintsov
Thanks for the patch Ilya! I’ve tested this with my setup in OVN similar to described in message by link at "Reported-at". ovs-vswitchd with this patch applied seems working fine. It processed flows and though with high CPU load during ~3-5 seconds after start, it went to normal CPU load about

Re: [ovs-dev] [PATCH] ofproto: Fix resource usage explosion while processing bundled FLOW_MOD.

2021-11-22 Thread Vladislav Odintsov
Ilya, there’s a problem still in place, just with another case. Initially I’ve tested only creation of topology, but didn’t think about testing the modification of those flows. Create topology from initial mail, and then modify it somehow. For instance, change the LSPs in port group. Consider w

[ovs-dev] [PATCH v1 02/18] python: add mask, ip and eth decoders

2021-11-22 Thread Adrian Moreno
Add more decoders that can be used by KVParser. For IPv4 and IPv6 addresses, create a new class that wraps netaddr.IPAddress. For Ethernet addresses, create a new class that wraps netaddr.EUI. For Integers, create a new class that performs basic bitwise mask comparisons Signed-off-by: Adrian More

[ovs-dev] [PATCH v1 01/18] python: add generic Key-Value parser

2021-11-22 Thread Adrian Moreno
Most of ofproto and dpif flows are based on key-value pairs. These key-value pairs can be represented in several ways, eg: key:value, key=value, key(value). Add the following classes that allow parsing of key-value strings: * KeyValue: holds a key-value pair * KeyMetadata: holds some metadata asso

[ovs-dev] [PATCH v1 03/18] python: add list parser

2021-11-22 Thread Adrian Moreno
Some openflow or dpif flows encode their arguments in lists, eg: "some_action(arg1,arg2,arg3)". In order to decode this in a way that can be then stored and queried, add ListParser and ListDecoders classes that parse lists into KeyValue instances. The ListParser / ListDecoders mechanism is quite s

[ovs-dev] [PATCH v1 00/18] python: add flow parsing library

2021-11-22 Thread Adrian Moreno
While troubleshooting or developing new features in OVS, a considerable amount of time is spent analyzing flows (whether that's Openflow flows or datapath flows). Currently, OVS has tools to dump flows with different levels of verbosity as well as to filter flows prior to dumping them, e.g: 'ovs-of

[ovs-dev] [PATCH v1 04/18] build-aux: split extract-ofp-fields

2021-11-22 Thread Adrian Moreno
In order to be able to reuse the core extaction logic, split the command in two parts. The core extraction logic is moved to python/build while the command that writes the different files out of the extracted field info is kept in build-aux Signed-off-by: Adrian Moreno --- build-aux/extract-ofp-

[ovs-dev] [PATCH v1 05/18] build-aux: generate ofp field decoders

2021-11-22 Thread Adrian Moreno
Based on meta-field information extracted by extract_ofp_fields, autogenerate the right decoder to be used Signed-off-by: Adrian Moreno --- build-aux/automake.mk| 3 +- build-aux/gen_ofp_field_decoders | 73 python/.gitignore| 1 + p

[ovs-dev] [PATCH v1 06/18] python: add flow base class

2021-11-22 Thread Adrian Moreno
It simplifies the implementation of different types of flows by creating the concept of Section (e.g: match, action) and automatic accessors for all the provided Sections Signed-off-by: Adrian Moreno --- python/automake.mk | 3 +- python/ovs/flows/flow.py | 94

[ovs-dev] [PATCH v1 08/18] python: add ovs datapath flow parsing

2021-11-22 Thread Adrian Moreno
A ODPFlow is a Flow with the following sections: ufid info (e.g: bytes, packets, dp, etc) match actions Use a factory class ODPFlowFactory to cache the decoder objects. Only three datapath actions require special handling: gre: because it has double parenthesys geneve: because it supports many co

[ovs-dev] [PATCH v1 07/18] python: introduce OpenFlow Flow parsing

2021-11-22 Thread Adrian Moreno
Introduce OFPFlow class and all its decoders. Most of the decoders are generic (from decoders.py). Some have special syntax and need a specific implementation. Decoders for nat are moved to the common decoders.py because it's syntax is shared with other types of flows (e.g: dpif flows). Signed-o

[ovs-dev] [PATCH v1 10/18] python: add a json encoder to flow fields

2021-11-22 Thread Adrian Moreno
The json encoder can be used to convert Flows to json Signed-off-by: Adrian Moreno --- python/ovs/flows/decoders.py | 15 +++ 1 file changed, 15 insertions(+) diff --git a/python/ovs/flows/decoders.py b/python/ovs/flows/decoders.py index 3def9f279..96bb56c06 100644 --- a/python/ovs/

[ovs-dev] [PATCH v1 09/18] python: add flow filtering syntax

2021-11-22 Thread Adrian Moreno
Based on pyparsing, create a very simple filtering syntax It supports basic logic statements (and, &, or, ||, not, !), numerical operations (<, >), equality (=) and masking (~=). The latter is only supported in certain fields (IntMask, EthMask, IPMask). Masking operation is semantically equivalen

[ovs-dev] [PATCH v1 11/18] tests: wrap ovs-ofctl calls to test python parser

2021-11-22 Thread Adrian Moreno
Some ovs-ofctl commands are used to parse or dump openflow flows, specially in ofp-actions.at Use a wrapper around ovs-ofctl, called ovs-test-ofparse.py that, apart from calling ovs-ofctl, also parses its output (or input, depending on the command) to make sure the python flow parsing library can

[ovs-dev] [PATCH v1 14/18] python: introduce unit tests

2021-11-22 Thread Adrian Moreno
Use pytest to run unit tests Signed-off-by: Adrian Moreno --- .ci/linux-prepare.sh| 2 +- .gitignore | 1 + Documentation/intro/install/general.rst | 2 + Vagrantfile | 2 +- configure.ac

[ovs-dev] [PATCH v1 13/18] python: detect changes in flow formatting code

2021-11-22 Thread Adrian Moreno
In order to minimize the risk of having the python flow parsing code and the C flow formatting code divert, add a target that checks if the formatting code has been changed since the last revision and warn the developer if it has. The script also makes it easy to update the dependency file so hope

[ovs-dev] [PATCH v1 12/18] tests: Wrap test-odp to also run python parsers

2021-11-22 Thread Adrian Moreno
test-odp is used to parse datapath flow actions and matches within the odp tests. Wrap calls to this tool in a python script that also parses them using the python flow parsing library. Signed-off-by: Adrian Moreno --- tests/automake.mk | 3 +- tests/odp.at | 36 ---

[ovs-dev] [PATCH v1 15/18] python: add unit tests for list

2021-11-22 Thread Adrian Moreno
Signed-off-by: Adrian Moreno --- python/automake.mk| 4 ++- python/ovs/tests/test_list.py | 67 +++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 python/ovs/tests/test_list.py diff --git a/python/automake.mk b/python/automake.mk

[ovs-dev] [PATCH v1 16/18] python: add unit tests for openflow parsing

2021-11-22 Thread Adrian Moreno
Signed-off-by: Adrian Moreno --- python/automake.mk | 3 +- python/ovs/tests/test_ofp.py | 524 +++ 2 files changed, 526 insertions(+), 1 deletion(-) create mode 100644 python/ovs/tests/test_ofp.py diff --git a/python/automake.mk b/python/automake.mk

[ovs-dev] [PATCH v1 17/18] python: add unit tests to datapath parsing

2021-11-22 Thread Adrian Moreno
Signed-off-by: Adrian Moreno --- python/automake.mk | 3 +- python/ovs/tests/test_odp.py | 527 +++ 2 files changed, 529 insertions(+), 1 deletion(-) create mode 100644 python/ovs/tests/test_odp.py diff --git a/python/automake.mk b/python/automake.mk

[ovs-dev] [PATCH v1 18/18] python: add unit tests for filtering engine

2021-11-22 Thread Adrian Moreno
Signed-off-by: Adrian Moreno --- python/automake.mk | 3 +- python/ovs/tests/test_filter.py | 225 2 files changed, 227 insertions(+), 1 deletion(-) create mode 100644 python/ovs/tests/test_filter.py diff --git a/python/automake.mk b/python/automa

Re: [ovs-dev] [PATCH v1 02/18] python: add mask, ip and eth decoders

2021-11-22 Thread Timothy Redaelli
On Mon, 22 Nov 2021 12:22:40 +0100 Adrian Moreno wrote: > Add more decoders that can be used by KVParser. > > For IPv4 and IPv6 addresses, create a new class that wraps > netaddr.IPAddress. > For Ethernet addresses, create a new class that wraps netaddr.EUI. > For Integers, create a new class th

Re: [ovs-dev] [PATCH] dpif-netdev: avoid hw_miss_packet_recover() for devices with no support

2021-11-22 Thread Sriharsha Basavapatna via dev
Hi Eli, On Sun, Nov 21, 2021 at 12:03 PM Eli Britstein via dev wrote: > > Hi Harsha, > > It's a clever idea, though have some problems in the implementation. PSB. Thanks, please see my response below. > > > On 11/20/2021 11:20 AM, Sriharsha Basavapatna wrote: > > The hw_miss_packet_recover() API

Re: [ovs-dev] [PATCH] dpif-netdev: avoid hw_miss_packet_recover() for devices with no support

2021-11-22 Thread Eli Britstein via dev
On 11/22/2021 3:19 PM, Sriharsha Basavapatna wrote: Hi Eli, On Sun, Nov 21, 2021 at 12:03 PM Eli Britstein via dev wrote: Hi Harsha, It's a clever idea, though have some problems in the implementation. PSB. Thanks, please see my response below. On 11/20/2021 11:20 AM, Sriharsha Basavapatn

[ovs-dev] [RFC PATCH 00/10] Introduce ovs-ofparse utility

2021-11-22 Thread Adrian Moreno
This series is based on the ofenflow and datapath flow parsing library series [1]. This series introduces a python tool called "ovs-ofparse". This tool aims to make it much more easy to analyze and troubleshoot issues involving openflow or datapath flows. It is essentially a CLI program that read

[ovs-dev] [RFC PATCH 03/10] python/ovs-ofparse: add formatting framework

2021-11-22 Thread Adrian Moreno
Add a generic formatting framework. The framework is composed of 3 elements: FlowStyle, FlowFormatter and FlowBuffer A FlowStyle is a class that contains information on what style to use for each key, value and delimiter. It supports style lookups based on keyname, value type and supports highligh

[ovs-dev] [RFC PATCH 04/10] python/ovs-ofparse: add json format

2021-11-22 Thread Adrian Moreno
Add a FlowProcessor that is able to return the flows in json format and a subcommand to both "datapath" and "openflow" to print flows in that format Signed-off-by: Adrian Moreno --- python/ovs/ovs_ofparse/datapath.py | 17 +- python/ovs/ovs_ofparse/openflow.py | 16 + pyt

[ovs-dev] [RFC PATCH 02/10] python/ovs-ofparse: Create basic flow processing

2021-11-22 Thread Adrian Moreno
Create a FlowProcessor base class that can read files from multiple input files, create flows based on a provided factory object and offer some hooks for expansion. Derived classes can implement different processing logics by overriding some of the hook methods During the processing, flows can be

[ovs-dev] [RFC PATCH 01/10] python: introduce scheleton of ovs_ofparse utility

2021-11-22 Thread Adrian Moreno
ovs-ofparse is a python program that uses ovs.flows library to provide rich formatting of openflow and datapath flows. It uses 'click' as the command line argument framework and has the following syntax: ovs-ofparse [OPTIONS] [openflow | datapath] FORMAT [FORMAT OPTIONS] OPTIONS: describe genera

[ovs-dev] [RFC PATCH 05/10] python/ovs-ofparse: Add rich console formatting

2021-11-22 Thread Adrian Moreno
Using 'rich' library, add a console formatter that supports: - rich style definition based on a configuration file where any key-value can be asssigned a specific color. The style to use is selected using the "--style" general option - paging based on rich's paging support. If colors are printe

[ovs-dev] [RFC PATCH 07/10] python/ovs-ofparse: add datapath logic processing

2021-11-22 Thread Adrian Moreno
Create a generic Datapath Tree procesing engine. A FlowTree arranges datapath flows based on their recirc_id. The logic is made generic as long as the elements in the tree is derived from TreElem Filtering is not performed on normal processing time. Instead the filtering is performed after the tr

[ovs-dev] [RFC PATCH 08/10] python/ovs-ofparse: add html formatter

2021-11-22 Thread Adrian Moreno
Add a HTML formatting system. The HTMLStyle includes a color and a anchor generator so links can be added to each key and value. Styles are extracted from the configuration file Signed-off-by: Adrian Moreno --- python/automake.mk | 3 +- python/ovs/ovs_ofparse/etc/ovs

[ovs-dev] [RFC PATCH 06/10] python/ovs-ofparse: add openflow logic processing

2021-11-22 Thread Adrian Moreno
Create a new FlowProcessor that is able to squash "logical" flows together. A logical flow combines flows that have: - Same set of matches (regardless of their value) - Same set of actions regardless of their value except for "output" and "resubmit" for which values do matter - Same cookie if "--

[ovs-dev] [RFC PATCH 09/10] python/ovs-ofparse: add openflow html format

2021-11-22 Thread Adrian Moreno
Create a flow table that uses a hyperlink from resubmit() to the target table Signed-off-by: Adrian Moreno --- python/ovs/ovs_ofparse/openflow.py | 70 ++ 1 file changed, 70 insertions(+) diff --git a/python/ovs/ovs_ofparse/openflow.py b/python/ovs/ovs_ofparse/openf

[ovs-dev] [RFC PATCH 10/10] python:ovs-ofparse: add datapath html format

2021-11-22 Thread Adrian Moreno
Create a collapsable and selectable flow tree html table based on the datapath tree. Signed-off-by: Adrian Moreno --- python/ovs/ovs_ofparse/datapath.py | 247 + 1 file changed, 247 insertions(+) diff --git a/python/ovs/ovs_ofparse/datapath.py b/python/ovs/ovs_ofpar

[ovs-dev] [PATCH] ofproto: Fix resource usage explosion due to removal of large number of flows.

2021-11-22 Thread Ilya Maximets
While removing flows, removal itself is deferred, so classifier changes performed already from the RCU thread. This way every deferred removal triggers classifier change and reallocation of a pvector. Freeing of old version of a pvector is postponed. Since all this is happening from an RCU threa

Re: [ovs-dev] [PATCH] ofproto: Fix resource usage explosion while processing bundled FLOW_MOD.

2021-11-22 Thread Ilya Maximets
On 11/22/21 10:18, Vladislav Odintsov wrote: > Ilya, > > there’s a problem still in place, just with another case. > Initially I’ve tested only creation of topology, but didn’t think about > testing the modification of those flows. > > Create topology from initial mail, and then modify it someho

Re: [ovs-dev] [PATCH ovn v2] northd: Generate ARP responder flows only for reachable VIPs.

2021-11-22 Thread Mark Michelson
Acked-by: Mark Michelson On 11/19/21 06:51, Dumitru Ceara wrote: It's not useful to generate ARP responder flows for VIPs that are not reachable on any port of a logical router port. On scaled ovn-kubernetes deployments the VIP ARP responder Southbound address sets become quite large, wasting

Re: [ovs-dev] [PATCH v3] checkpatch: Detect "trojan source" attack

2021-11-22 Thread Gaëtan Rivet
On Thu, Nov 18, 2021, at 16:45, Mike Pattrick wrote: > Recently there has been a lot of press about the "trojan source" attack, > where Unicode characters are used to obfuscate the true functionality of > code. This attack didn't effect OVS, but adding the check here will help > guard against it sn

Re: [ovs-dev] 回复: [PATCH v2] netdev-vport : Fix userspace tunnel ioctl(SIOCGIFINDEX) info logs.

2021-11-22 Thread Mike Pattrick
Hello linhuang, This is a good idea, but I've run into a few issues with this patch. There's still one instance of "type" that needs to be changed to dpif_type to fix compile. Also, the behaviour of strcmp is undefined if one of the pointers is NULL. On my system, it throws SIGSEGV. This causes

Re: [ovs-dev] [PATCH] netlink-socket: Check for null sock in nl_sock_recv__()

2021-11-22 Thread Murilo Opsfelder Araújo
Hi, Ilya Maximets. On 11/19/21 13:23, Ilya Maximets wrote: On 11/18/21 22:19, David Christensen wrote: On 11/18/21 11:56 AM, Murilo Opsfelder Araújo wrote: On 11/16/21 19:31, Ilya Maximets wrote: On 10/25/21 19:45, David Christensen wrote: In certain high load situations, such as when crea

Re: [ovs-dev] [PATCH] ofproto: Fix resource usage explosion while processing bundled FLOW_MOD.

2021-11-22 Thread Vladislav Odintsov
Hi Ilya, I’ve tested both patches, the problem with high CPU seems to be solved, thanks. I noticed see that if I add/delete one lsp to/from port group with a negative match rule, ovs-vswitchd each time (add or remove) consumes +4-18 MB RSS. # ovn-nbctl pg-set-ports pg_1 lsp1 lsp2 lsp3 lsp4 [roo

Re: [ovs-dev] [PATCH ovn v9 0/6] Add multiple routing tables support to Logical Routers

2021-11-22 Thread Numan Siddique
On Fri, Nov 19, 2021 at 11:07 AM Vladislav Odintsov wrote: > > v8 -> v9: > - Fix documentation errors. > - Fix commit messages. > > v7 -> v8: > - Updated manpages with and commit messages according to latest changes. > - Small fixes. > > v6 -> v7: > - Addressed Han's comments regarding s

[ovs-dev] OVN release proposals 1/3: Semi-annual releases

2021-11-22 Thread Mark Michelson
For the past two years, OVN has had quarterly releases. This allowed for new features to be released more rapidly than if OVN were released at a slower pace. During 2021, there were two trends: 1) "Small" new features were less frequent. Most features that added in the past couple of years (e.

[ovs-dev] OVN release proposals 2/3: Monthly point releases

2021-11-22 Thread Mark Michelson
Currently, we tend to release a .0 version of OVN. It's rare to release any follow-up point releases unless there is a major regression or if a "critical" new feature barely missed the soft-freeze deadline. Since it is rare to have point releases, it sometimes seems pointless(ha!) to backport

[ovs-dev] OVN release proposals 3/3: Make 22.03 release series an LTS

2021-11-22 Thread Mark Michelson
Development in the 21.09 cycle of OVN saw an unprecedented push towards performance and scalability improvements. Development in the 21.12 cycle has seen stability enhancements and even more performance improvements. It's reached the point where I think it would be safe (and a good idea) to lab

Re: [ovs-dev] [PATCH] ofproto: Fix resource usage explosion while processing bundled FLOW_MOD.

2021-11-22 Thread Ilya Maximets
On 11/22/21 20:54, Vladislav Odintsov wrote: > Hi Ilya, > > I’ve tested both patches, the problem with high CPU seems to be solved, > thanks. > I noticed see that if I add/delete one lsp to/from port group with a negative > match rule, ovs-vswitchd each time (add or remove) consumes +4-18 MB RSS

Re: [ovs-dev] [PATCH ovn v2] northd: Generate ARP responder flows only for reachable VIPs.

2021-11-22 Thread Numan Siddique
On Mon, Nov 22, 2021 at 11:03 AM Mark Michelson wrote: > > Acked-by: Mark Michelson Thanks Dumitru and Mark. I applied this patch to the main branch with the below changes as the patch needed some updates in the ovn-northd.8.xml documentation. Numan -- diff --git a/northd/ovn

Re: [ovs-dev] [PATCH ovn] binding: Log iface-id-ver mismatch.

2021-11-22 Thread Numan Siddique
On Fri, Nov 19, 2021 at 6:58 AM Dumitru Ceara wrote: > > This is useful for debugging. > > Signed-off-by: Dumitru Ceara Thanks. I applied this patch to the main branch. Numan > --- > controller/binding.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/controller/binding.c b/con

Re: [ovs-dev] [PATCH ovn] northd: I-P add explicit dependency on Load_Balancer_Group.

2021-11-22 Thread Numan Siddique
On Fri, Nov 19, 2021 at 6:43 AM Dumitru Ceara wrote: > > The commit that added I-P for northd missed to add this explicit > dependency. This didn't really affect functionality because: > a. ovn-northd monitors the whole NB database > b. changes to the Load_Balancer_Group table mark rows in Logica