Bug 1947320

Summary: [OVN] [Debugging] Add utilities for analyzing openflow table dump content.
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Dumitru Ceara <dceara>
Component: OVNAssignee: OVN Team <ovnteam>
Status: NEW --- QA Contact: Jianlin Shi <jishi>
Severity: low Docs Contact:
Priority: medium    
Version: FDP 20.HCC: amorenoz, ctrautma
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dumitru Ceara 2021-04-08 08:20:18 UTC
Description of problem:

The OVN code base has some utilities[0] (used for self tests) for trimming openflow table dumps and removing irrelevant information (e.g., n_packets, idle_time).  These make the format of an openflow table dump easier to grep and analyze.

It would probably be useful to expose these as externally available scripts/tools and also to enhance them to support advanced filtering like:
- group openflows that are identical except metadata (logical datapath) match.
- report openflows that are almost identical with upto X match different match terms.

[0] https://github.com/ovn-org/ovn/blob/110e670462a9ae580d40d14181c388fc2f0b1e1c/tests/ofproto-macros.at#L42

Comment 1 Adrián Moreno 2021-04-12 07:15:52 UTC
+1 for the feature and use case
Some question:
- Do these scripts have OVN-specific functionality. If not, should they live in OVS?
- I was planning in enhancing the openflow parsing support in insights-core, so I wonder whether we could reuse some parts. Would it make sense to have this processing functionality in, say, a python library?

Comment 2 Dumitru Ceara 2021-04-13 15:48:36 UTC
(In reply to Adrián Moreno from comment #1)
> +1 for the feature and use case
> Some question:
> - Do these scripts have OVN-specific functionality. If not, should they live
> in OVS?

I was thinking that the tools should be OVN aware.  E.g., two openflows
might differ only in metadata match in which case it means they are
generated from the same logical flow applied to multiple
logical_switches/routers.  But if the utilities allow grouping generic
openflows by a set of matches then I guess they don't need to be OVN
aware.

> - I was planning in enhancing the openflow parsing support in insights-core,
> so I wonder whether we could reuse some parts. Would it make sense to have
> this processing functionality in, say, a python library?

We have some shell helpers already that we might be able to reuse, but
if a higher level library makes more sense, that works fine too.