[ovs-dev] [lacp 05/10] packets: Rename LACP portid and sysid to port_id and sys_id.

Ethan Jackson ethan at nicira.com
Tue Mar 15 23:03:18 UTC 2011


This seems more stylistically consistent with the rest of the
code base and the sys_priority and port_priority in the same
struct.
---
 lib/packets.h     |   12 ++++++------
 vswitchd/bridge.c |   32 ++++++++++++++++----------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/lib/packets.h b/lib/packets.h
index dcb5b9f..c858fc0 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -429,12 +429,12 @@ bool ipv6_is_cidr(const struct in6_addr *netmask);
 
 #define LACP_INFO_LEN 15
 struct lacp_info {
-    ovs_be16 sys_priority;       /* System priority. */
-    uint8_t sysid[ETH_ADDR_LEN]; /* System ID. */
-    ovs_be16 key;                /* Operational key. */
-    ovs_be16 port_priority;      /* Port priority. */
-    ovs_be16 portid;             /* Port ID. */
-    uint8_t state;               /* State mask.  See LACP_STATE macros. */
+    ovs_be16 sys_priority;            /* System priority. */
+    uint8_t sys_id[ETH_ADDR_LEN];     /* System ID. */
+    ovs_be16 key;                     /* Operational key. */
+    ovs_be16 port_priority;           /* Port priority. */
+    ovs_be16 port_id;                 /* Port ID. */
+    uint8_t state;                    /* State mask.  See LACP_STATE macros. */
 } __attribute__((packed));
 BUILD_ASSERT_DECL(LACP_INFO_LEN == sizeof(struct lacp_info));
 
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 774664e..85a5bdb 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -3189,8 +3189,8 @@ lacp_update_ifaces(struct port *port)
         ofproto_revalidate(port->bridge->ofproto, iface->tag);
 
         /* Don't allow loopback interfaces to send traffic or lead. */
-        if (eth_addr_equals(iface->lacp_partner.sysid,
-                            iface->lacp_actor.sysid)) {
+        if (eth_addr_equals(iface->lacp_partner.sys_id,
+                            iface->lacp_actor.sys_id)) {
             VLOG_WARN_RL(&rl, "iface %s: Loopback detected. Interface is "
                          "connected to its own bridge", iface->name);
             iface->lacp_status &= ~LACP_ATTACHED;
@@ -3221,8 +3221,8 @@ lacp_update_ifaces(struct port *port)
 
         if (iface->lacp_status & LACP_DEFAULTED
             || lead->lacp_partner.key != iface->lacp_partner.key
-            || !eth_addr_equals(lead->lacp_partner.sysid,
-                                iface->lacp_partner.sysid)) {
+            || !eth_addr_equals(lead->lacp_partner.sys_id,
+                                iface->lacp_partner.sys_id)) {
             iface->lacp_status &= ~LACP_ATTACHED;
         }
     }
@@ -3880,16 +3880,16 @@ bond_unixctl_show(struct unixctl_conn *conn,
 
             ds_put_cstr(&ds, "\n");
 
-            ds_put_cstr(&ds, "\n\tactor sysid: ");
+            ds_put_cstr(&ds, "\n\tactor sys_id: ");
             ds_put_format(&ds, ETH_ADDR_FMT,
-                          ETH_ADDR_ARGS(iface->lacp_actor.sysid));
+                          ETH_ADDR_ARGS(iface->lacp_actor.sys_id));
             ds_put_cstr(&ds, "\n");
 
             ds_put_format(&ds, "\tactor sys_priority: %u\n",
                           ntohs(iface->lacp_actor.sys_priority));
 
-            ds_put_format(&ds, "\tactor portid: %u\n",
-                          ntohs(iface->lacp_actor.portid));
+            ds_put_format(&ds, "\tactor port_id: %u\n",
+                          ntohs(iface->lacp_actor.port_id));
 
             ds_put_format(&ds, "\tactor port_priority: %u\n",
                           ntohs(iface->lacp_actor.port_priority));
@@ -3901,16 +3901,16 @@ bond_unixctl_show(struct unixctl_conn *conn,
             ds_put_lacp_state(&ds, iface_get_lacp_state(iface));
             ds_put_cstr(&ds, "\n\n");
 
-            ds_put_cstr(&ds, "\tpartner sysid: ");
+            ds_put_cstr(&ds, "\tpartner sys_id: ");
             ds_put_format(&ds, ETH_ADDR_FMT,
-                          ETH_ADDR_ARGS(iface->lacp_partner.sysid));
+                          ETH_ADDR_ARGS(iface->lacp_partner.sys_id));
             ds_put_cstr(&ds, "\n");
 
             ds_put_format(&ds, "\tpartner sys_priority: %u\n",
                           ntohs(iface->lacp_partner.sys_priority));
 
-            ds_put_format(&ds, "\tpartner portid: %u\n",
-                          ntohs(iface->lacp_partner.portid));
+            ds_put_format(&ds, "\tpartner port_id: %u\n",
+                          ntohs(iface->lacp_partner.port_id));
 
             ds_put_format(&ds, "\tpartner port_priority: %u\n",
                           ntohs(iface->lacp_partner.port_priority));
@@ -4601,10 +4601,10 @@ port_update_lacp(struct port *port)
         struct iface *iface = port->ifaces[i];
 
         iface->lacp_actor.sys_priority = htons(port->lacp_priority);
-        memcpy(&iface->lacp_actor.sysid, port->bridge->ea, ETH_ADDR_LEN);
+        memcpy(&iface->lacp_actor.sys_id, port->bridge->ea, ETH_ADDR_LEN);
 
         iface->lacp_actor.port_priority = htons(iface->lacp_priority);
-        iface->lacp_actor.portid = htons(iface->dp_ifidx);
+        iface->lacp_actor.port_id = htons(iface->dp_ifidx);
         iface->lacp_actor.key = htons(port->lacp_key);
 
         iface->lacp_tx = 0;
@@ -4729,8 +4729,8 @@ iface_get_lacp_priority(struct iface *iface, struct lacp_info *priority)
         *priority = iface->lacp_actor;
     } else if (partner_priority < actor_priority) {
         *priority = iface->lacp_partner;
-    } else if (eth_addr_compare_3way(iface->lacp_actor.sysid,
-                                     iface->lacp_partner.sysid) < 0) {
+    } else if (eth_addr_compare_3way(iface->lacp_actor.sys_id,
+                                     iface->lacp_partner.sys_id) < 0) {
         *priority = iface->lacp_actor;
     } else {
         *priority = iface->lacp_partner;
-- 
1.7.4.1




More information about the dev mailing list