[ovs-dev] [PATCH v2] ovs-dpctl-top: Skip "eth()" element

Timothy Redaelli tredaelli at redhat.com
Fri Jun 19 13:53:52 UTC 2020


With commit efde188622ae ("odp-util: Print eth() for Ethernet flows if
packet_type is absent.") "eth()" is printed for Ethernet flows if packet_type
is absent, but this broke "ovs-dpctl-top" since it expects that every
element has a value.

This commit skips the parsing of the empty "eth()" element.

Fixes: efde188622ae ("odp-util: Print eth() for Ethernet flows if packet_type
is absent.")
Cc: blp at ovn.org
Signed-off-by: Timothy Redaelli <tredaelli at redhat.com>
---
v2:
- Added missing Signed-off-by

 utilities/ovs-dpctl-top.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/utilities/ovs-dpctl-top.in b/utilities/ovs-dpctl-top.in
index 011cc64b7..fbe6e4f56 100755
--- a/utilities/ovs-dpctl-top.in
+++ b/utilities/ovs-dpctl-top.in
@@ -480,6 +480,8 @@ def elements_to_dict(elements):
     """ Convert line to a hierarchy of dictionaries. """
     result = {}
     for element in elements:
+        if (element == "eth()"):
+            continue
         match = FIELDS_CMPND.search(element)
         if (match):
             key = match.group(1)
-- 
2.26.2



More information about the dev mailing list