[ovs-dev] [PATCH 14/14] ofproto: Add support for master/slave controller coordination.

Ben Pfaff blp at nicira.com
Wed Apr 14 23:05:44 UTC 2010


On Wed, Apr 14, 2010 at 02:27:54PM -0700, Jeremy Stribling wrote:
> Ben Pfaff wrote:
> >+struct nx_role_request {
> >+    struct nicira_header nxh;
> >+    uint32_t role;              /* One of NX_ROLE_*. */
> >+};
> >+
> >+enum nx_role {
> >+    NX_ROLE_OTHER,              /* Default role, full access. */
> >+    NX_ROLE_MASTER,             /* Full access, at most one. */
> >+    NX_ROLE_SLAVE               /* Read-only access. */
> >+};
> 
> It seems strange that "role" is 32 bits long, when it's just
> encoding 3 possible states.  Perhaps this is for alignment purposes,
> but it just kind of jumped out at me (a different enum in
> openflow.h, ofp_type, is declared as uint8_t).  Not a big deal at
> all, mostly just curious.

I wanted to learn plenty of room for expansion.




More information about the dev mailing list