Skip to content

Commit

Permalink
Use primary/secondary, not master/slave, as names for OpenFlow roles.
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Alin Gabriel Serdean <[email protected]>
  • Loading branch information
blp committed Oct 17, 2020
1 parent bbe2e39 commit 807152a
Show file tree
Hide file tree
Showing 17 changed files with 308 additions and 296 deletions.
110 changes: 55 additions & 55 deletions Documentation/topics/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,79 +70,79 @@ that the message is suppressed.

.. table:: ``OFPT_PACKET_IN`` / ``NXT_PACKET_IN``

=========================================== ======= =====
master/
message and reason code other slave
=========================================== ======= =====
``OFPR_NO_MATCH`` yes ---
``OFPR_ACTION`` yes ---
``OFPR_INVALID_TTL`` --- ---
``OFPR_ACTION_SET`` (OF1.4+) yes ---
``OFPR_GROUP`` (OF1.4+) yes ---
``OFPR_PACKET_OUT`` (OF1.4+) yes ---
=========================================== ======= =====
=========================================== ======== =========
primary/
message and reason code other secondary
=========================================== ======== =========
``OFPR_NO_MATCH`` yes ---
``OFPR_ACTION`` yes ---
``OFPR_INVALID_TTL`` --- ---
``OFPR_ACTION_SET`` (OF1.4+) yes ---
``OFPR_GROUP`` (OF1.4+) yes ---
``OFPR_PACKET_OUT`` (OF1.4+) yes ---
=========================================== ======== =========

.. table:: ``OFPT_FLOW_REMOVED`` / ``NXT_FLOW_REMOVED``

=========================================== ======= =====
master/
message and reason code other slave
=========================================== ======= =====
``OFPRR_IDLE_TIMEOUT`` yes ---
``OFPRR_HARD_TIMEOUT`` yes ---
``OFPRR_DELETE`` yes ---
``OFPRR_GROUP_DELETE`` (OF1.3+) yes ---
``OFPRR_METER_DELETE`` (OF1.4+) yes ---
``OFPRR_EVICTION`` (OF1.4+) yes ---
=========================================== ======= =====
=========================================== ======== =========
primary/
message and reason code other secondary
=========================================== ======== =========
``OFPRR_IDLE_TIMEOUT`` yes ---
``OFPRR_HARD_TIMEOUT`` yes ---
``OFPRR_DELETE`` yes ---
``OFPRR_GROUP_DELETE`` (OF1.3+) yes ---
``OFPRR_METER_DELETE`` (OF1.4+) yes ---
``OFPRR_EVICTION`` (OF1.4+) yes ---
=========================================== ======== =========

.. table:: ``OFPT_PORT_STATUS``

=========================================== ======= =====
master/
message and reason code other slave
=========================================== ======= =====
``OFPPR_ADD`` yes yes
``OFPPR_DELETE`` yes yes
``OFPPR_MODIFY`` yes yes
=========================================== ======= =====

=========================================== ======== =========
primary/
message and reason code other secondary
=========================================== ======== =========
``OFPPR_ADD`` yes ---
``OFPPR_DELETE`` yes ---
``OFPPR_MODIFY`` yes ---
=========================================== ======== =========
.. table:: ``OFPT_ROLE_REQUEST`` / ``OFPT_ROLE_REPLY`` (OF1.4+)

=========================================== ======= =====
master/
message and reason code other slave
=========================================== ======= =====
``OFPCRR_MASTER_REQUEST`` --- ---
``OFPCRR_CONFIG`` --- ---
``OFPCRR_EXPERIMENTER`` --- ---
=========================================== ======= =====
=========================================== ======== =========
primary/
message and reason code other secondary
=========================================== ======== =========
``OFPCRR_PROMOTE_REQUEST`` --- ---
``OFPCRR_CONFIG`` --- ---
``OFPCRR_EXPERIMENTER`` --- ---
=========================================== ======== =========

.. table:: ``OFPT_TABLE_STATUS`` (OF1.4+)

=========================================== ======= =====
master/
message and reason code other slave
=========================================== ======= =====
``OFPTR_VACANCY_DOWN`` --- ---
``OFPTR_VACANCY_UP`` --- ---
=========================================== ======= =====
=========================================== ======== =========
primary/
message and reason code other secondary
=========================================== ======== =========
``OFPTR_VACANCY_DOWN`` --- ---
``OFPTR_VACANCY_UP`` --- ---
=========================================== ======== =========


.. table:: ``OFPT_REQUESTFORWARD`` (OF1.4+)

=========================================== ======= =====
master/
message and reason code other slave
=========================================== ======= =====
``OFPRFR_GROUP_MOD`` --- ---
``OFPRFR_METER_MOD`` --- ---
=========================================== ======= =====
=========================================== ======== =========
primary/
message and reason code other secondary
=========================================== ======== =========
``OFPRFR_GROUP_MOD`` --- ---
``OFPRFR_METER_MOD`` --- ---
=========================================== ======== =========

The ``NXT_SET_ASYNC_CONFIG`` message directly sets all of the values in this
table for the current connection. The ``OFPC_INVALID_TTL_TO_CONTROLLER`` bit
in the ``OFPT_SET_CONFIG`` message controls the setting for
``OFPR_INVALID_TTL`` for the "master" role.
``OFPR_INVALID_TTL`` for the "primary" role.

``OFPAT_ENQUEUE``
-----------------
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ v2.14.0 - 17 Aug 2020
- Tunnels: TC Flower offload
* Tunnel Local endpoint address masked match are supported.
* Tunnel Romte endpoint address masked match are supported.
- Terminology:
* The terms "master" and "slave" have been replaced by "primary" and
"secondary", respectively, for OpenFlow connection roles.


v2.13.0 - 14 Feb 2020
Expand Down
22 changes: 11 additions & 11 deletions include/openflow/nicira-ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,16 @@ enum nx_packet_in2_prop_type {
*
* The other possible roles are a related pair:
*
* - Master (NX_ROLE_MASTER) is equivalent to Other, except that there may
* be at most one Master controller at a time: when a controller
* configures itself as Master, any existing Master is demoted to the
* Slave role.
* - Primary (NX_ROLE_PRIMARY) is equivalent to Other, except that there may
* be at most one Primary controller at a time: when a controller
* configures itself as Primary, any existing Primary is demoted to the
* Secondary role.
*
* - Slave (NX_ROLE_SLAVE) allows the controller read-only access to
* - Secondary (NX_ROLE_SECONDARY) allows the controller read-only access to
* OpenFlow features. In particular attempts to modify the flow table
* will be rejected with an OFPBRC_EPERM error.
*
* Slave controllers do not receive OFPT_PACKET_IN or OFPT_FLOW_REMOVED
* Secondary controllers do not receive OFPT_PACKET_IN or OFPT_FLOW_REMOVED
* messages, but they do receive OFPT_PORT_STATUS messages.
*/
struct nx_role_request {
Expand All @@ -315,23 +315,23 @@ OFP_ASSERT(sizeof(struct nx_role_request) == 4);

enum nx_role {
NX_ROLE_OTHER, /* Default role, full access. */
NX_ROLE_MASTER, /* Full access, at most one. */
NX_ROLE_SLAVE /* Read-only access. */
NX_ROLE_PRIMARY, /* Full access, at most one. */
NX_ROLE_SECONDARY /* Read-only access. */
};

/* NXT_SET_ASYNC_CONFIG.
*
* Sent by a controller, this message configures the asynchronous messages that
* the controller wants to receive. Element 0 in each array specifies messages
* of interest when the controller has an "other" or "master" role; element 1,
* when the controller has a "slave" role.
* of interest when the controller has an "other" or "primary" role; element 1,
* when the controller has a "secondary" role.
*
* Each array element is a bitmask in which a 0-bit disables receiving a
* particular message and a 1-bit enables receiving it. Each bit controls the
* message whose 'reason' corresponds to the bit index. For example, the bit
* with value 1<<2 == 4 in port_status_mask[1] determines whether the
* controller will receive OFPT_PORT_STATUS messages with reason OFPPR_MODIFY
* (value 2) when the controller has a "slave" role.
* (value 2) when the controller has a "secondary" role.
*
* As a side effect, for service controllers, this message changes the
* miss_send_len from default of zero to OFP_DEFAULT_MISS_SEND_LEN (128).
Expand Down
6 changes: 3 additions & 3 deletions include/openflow/openflow-1.2.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,16 @@ enum ofp12_group_capabilities {
struct ofp12_role_request {
ovs_be32 role; /* One of OFPCR12_ROLE_*. */
uint8_t pad[4]; /* Align to 64 bits. */
ovs_be64 generation_id; /* Master Election Generation Id */
ovs_be64 generation_id; /* Primary Election Generation Id */
};
OFP_ASSERT(sizeof(struct ofp12_role_request) == 16);

/* Controller roles. */
enum ofp12_controller_role {
OFPCR12_ROLE_NOCHANGE, /* Don't change current role. */
OFPCR12_ROLE_EQUAL, /* Default role, full access. */
OFPCR12_ROLE_MASTER, /* Full access, at most one master. */
OFPCR12_ROLE_SLAVE, /* Read-only access. */
OFPCR12_ROLE_PRIMARY, /* Full access, at most one primary. */
OFPCR12_ROLE_SECONDARY, /* Read-only access. */
};

/* Packet received on port (datapath -> controller). */
Expand Down
8 changes: 4 additions & 4 deletions include/openflow/openflow-1.4.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,17 +274,17 @@ struct ofp14_role_status {
ovs_be32 role; /* One of OFPCR_ROLE_*. */
uint8_t reason; /* One of OFPCRR_*. */
uint8_t pad[3]; /* Align to 64 bits. */
ovs_be64 generation_id; /* Master Election Generation Id */
ovs_be64 generation_id; /* Primary Election Generation Id */

/* Followed by a list of struct ofp14_role_prop_header */
};
OFP_ASSERT(sizeof(struct ofp14_role_status) == 16);

/* What changed about the controller role */
enum ofp14_controller_role_reason {
OFPCRR_MASTER_REQUEST = 0, /* Another controller asked to be master. */
OFPCRR_CONFIG = 1, /* Configuration changed on the switch. */
OFPCRR_EXPERIMENTER = 2, /* Experimenter data changed. */
OFPCRR_PRIMARY_REQUEST = 0, /* Another controller asked to be primary. */
OFPCRR_CONFIG = 1, /* Configuration changed on the switch. */
OFPCRR_EXPERIMENTER = 2, /* Experimenter data changed. */
OFPCRR_N_REASONS /* Denotes number of reasons. */
};

Expand Down
6 changes: 3 additions & 3 deletions include/openvswitch/ofp-connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ enum ofputil_async_msg_type {
const char *ofputil_async_msg_type_to_string(enum ofputil_async_msg_type);

struct ofputil_async_cfg {
uint32_t master[OAM_N_TYPES];
uint32_t slave[OAM_N_TYPES];
uint32_t primary[OAM_N_TYPES];
uint32_t secondary[OAM_N_TYPES];
};
#define OFPUTIL_ASYNC_CFG_INIT (struct ofputil_async_cfg) { .master[0] = 0 }
#define OFPUTIL_ASYNC_CFG_INIT (struct ofputil_async_cfg) { .primary[0] = 0 }

enum ofperr ofputil_decode_set_async_config(const struct ofp_header *,
bool loose,
Expand Down
9 changes: 5 additions & 4 deletions include/openvswitch/ofp-errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ enum ofperr {
* OFPBIC_BAD_EXP_TYPE. */

/* Expected: 0x0,1,5 in OF1.0 means both OFPBRC_EPERM and
* OFPBRC_IS_SLAVE. */
* OFPBRC_IS_SECONDARY. */

/* Expected: 0x0,1,5 in OF1.1 means both OFPBRC_EPERM and
* OFPBRC_IS_SLAVE. */
* OFPBRC_IS_SECONDARY. */

/* ## ------------------ ## */
/* ## OFPET_HELLO_FAILED ## */
Expand Down Expand Up @@ -168,8 +168,9 @@ enum ofperr {
* code defined the specification. ] */
OFPERR_OFPBRC_BAD_TABLE_ID,

/* OF1.0-1.1(1,5), OF1.2+(1,10). Denied because controller is slave. */
OFPERR_OFPBRC_IS_SLAVE,
/* OF1.0-1.1(1,5), OF1.2+(1,10). Denied because controller has secondary
* role. (Secondary controllers have only read-only access.) */
OFPERR_OFPBRC_IS_SECONDARY,

/* NX1.0-1.1(1,514), OF1.2+(1,11). Invalid or missing port. [ A
* non-standard error (1,514), formerly OFPERR_NXBRC_BAD_IN_PORT is used
Expand Down
Loading

0 comments on commit 807152a

Please sign in to comment.