diff mbox series

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

Message ID 3a728f05dd57f0d97fda3d86c883f7f86cf672ef.1592573751.git.tredaelli@redhat.com
State Accepted
Delegated to: Ilya Maximets
Headers show
Series [ovs-dev,v2] ovs-dpctl-top: Skip "eth()" element | expand

Commit Message

Timothy Redaelli June 19, 2020, 1:53 p.m. UTC
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@ovn.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
v2:
- Added missing Signed-off-by

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

Comments

Flavio Leitner Aug. 7, 2020, 2:38 p.m. UTC | #1
On Fri, Jun 19, 2020 at 03:53:52PM +0200, Timothy Redaelli wrote:
> 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@ovn.org
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> ---

Works for me, thanks!
Acked-by: Flavio Leitner <fbl@sysclose.org>
Ilya Maximets Aug. 26, 2020, 8:02 p.m. UTC | #2
On 8/7/20 4:38 PM, Flavio Leitner wrote:
> On Fri, Jun 19, 2020 at 03:53:52PM +0200, Timothy Redaelli wrote:
>> 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@ovn.org
>> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
>> ---
> 
> Works for me, thanks!
> Acked-by: Flavio Leitner <fbl@sysclose.org>

Thanks!

Applied to master and backported down to 2.9.

Best regards, Ilya Maximets.
diff mbox series

Patch

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)