[ovs-dev] [mirror 08/13] odp-util: New function ovs_key_attr_to_string().

Ben Pfaff blp at nicira.com
Thu Nov 17 18:11:44 UTC 2011


On Sun, Nov 13, 2011 at 04:41:39PM -0800, Justin Pettit wrote:
> On Oct 26, 2011, at 10:09 AM, Ben Pfaff wrote:
> 
> > +static const char *
> > +ovs_key_attr_to_string(enum ovs_key_attr attr)
> > +{
> > +    switch (attr) {
> 
> I think it was added after this patch went out, but you may want to add OVS_KEY_ATTR_PRIORITY.
> 
> > +	case OVS_KEY_ATTR_UNSPEC: return "unspec";
> > +	case OVS_KEY_ATTR_TUN_ID: return "tun_id";
> 
> Not sure if you care about the ordering, but "TUN_ID" is currently after "ND" in the ovs_key_attr enum.  Otherwise, the list is in order.

These comments are too late, this patch was already merged as part of
another series :-)

I added a patch to update the order:

--8<--------------------------cut here-------------------------->8--

From: Ben Pfaff <blp at nicira.com>
Date: Thu, 17 Nov 2011 10:11:12 -0800
Subject: [PATCH] odp-util: Reorder OVS_KEY_ATTR_* cases for consistency.

This matches the order of their definition in openvswitch.h.

Reported-by: Justin Pettit <jpettit at nicira.com>
---
 lib/odp-util.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index 3821553..171b5fd 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -86,7 +86,6 @@ ovs_key_attr_to_string(enum ovs_key_attr attr)
     case OVS_KEY_ATTR_UNSPEC: return "unspec";
     case OVS_KEY_ATTR_ENCAP: return "encap";
     case OVS_KEY_ATTR_PRIORITY: return "priority";
-    case OVS_KEY_ATTR_TUN_ID: return "tun_id";
     case OVS_KEY_ATTR_IN_PORT: return "in_port";
     case OVS_KEY_ATTR_ETHERNET: return "eth";
     case OVS_KEY_ATTR_VLAN: return "vlan";
@@ -99,6 +98,7 @@ ovs_key_attr_to_string(enum ovs_key_attr attr)
     case OVS_KEY_ATTR_ICMPV6: return "icmpv6";
     case OVS_KEY_ATTR_ARP: return "arp";
     case OVS_KEY_ATTR_ND: return "nd";
+    case OVS_KEY_ATTR_TUN_ID: return "tun_id";
 
     case __OVS_KEY_ATTR_MAX:
     default:
-- 
1.7.4.4




More information about the dev mailing list