return ofport->cfm ? cfm_get_fault(ofport->cfm) : -1;
}
+static int
+get_cfm_opup(const struct ofport *ofport_)
+{
+ struct ofport_dpif *ofport = ofport_dpif_cast(ofport_);
+
+ return ofport->cfm ? cfm_get_opup(ofport->cfm) : -1;
+}
+
static int
get_cfm_remote_mpids(const struct ofport *ofport_, const uint64_t **rmps,
size_t *n_rmps)
set_sflow,
set_cfm,
get_cfm_fault,
+ get_cfm_opup,
get_cfm_remote_mpids,
get_cfm_health,
set_stp,
* not support CFM. */
int (*get_cfm_fault)(const struct ofport *ofport);
+ /* Check the operational status reported by the remote CFM endpoint of
+ * 'ofp_port' Returns 1 if operationally up, 0 if operationally down, and
+ * -1 if CFM is not enabled on 'ofp_port' or does not support operational
+ * status.
+ *
+ * This function may be a null pointer if the ofproto implementation does
+ * not support CFM. */
+ int (*get_cfm_opup)(const struct ofport *ofport);
+
/* Gets the MPIDs of the remote maintenance points broadcasting to
* 'ofport'. Populates 'rmps' with a provider owned array of MPIDs, and
* 'n_rmps' with the number of MPIDs in 'rmps'. Returns a number less than
/* Checks the fault status of CFM for 'ofp_port' within 'ofproto'. Returns a
* bitmask of 'cfm_fault_reason's to indicate a CFM fault (generally
* indicating a connectivity problem). Returns zero if CFM is not faulted,
- * and -1 if CFM is not enabled on 'port'. */
+ * and -1 if CFM is not enabled on 'ofp_port'. */
int
ofproto_port_get_cfm_fault(const struct ofproto *ofproto, uint16_t ofp_port)
{
: -1);
}
+/* Checks the operational status reported by the remote CFM endpoint of
+ * 'ofp_port' Returns 1 if operationally up, 0 if operationally down, and -1
+ * if CFM is not enabled on 'ofp_port' or does not support operational status.
+ */
+int
+ofproto_port_get_cfm_opup(const struct ofproto *ofproto, uint16_t ofp_port)
+{
+ struct ofport *ofport = ofproto_get_port(ofproto, ofp_port);
+ return (ofport && ofproto->ofproto_class->get_cfm_opup
+ ? ofproto->ofproto_class->get_cfm_opup(ofport)
+ : -1);
+}
+
/* Gets the MPIDs of the remote maintenance points broadcasting to 'ofp_port'
* within 'ofproto'. Populates 'rmps' with an array of MPIDs owned by
* 'ofproto', and 'n_rmps' with the number of MPIDs in 'rmps'. Returns a
void ofproto_get_netflow_ids(const struct ofproto *,
uint8_t *engine_type, uint8_t *engine_id);
int ofproto_port_get_cfm_fault(const struct ofproto *, uint16_t ofp_port);
+int ofproto_port_get_cfm_opup(const struct ofproto *, uint16_t ofp_port);
int ofproto_port_get_cfm_remote_mpids(const struct ofproto *,
uint16_t ofp_port, const uint64_t **rmps,
size_t *n_rmps);
iface_refresh_cfm_stats(struct iface *iface)
{
const struct ovsrec_interface *cfg = iface->cfg;
- int fault, error;
+ int fault, opup, error;
const uint64_t *rmps;
size_t n_rmps;
int health;
ovsrec_interface_set_cfm_fault_status(cfg, NULL, 0);
}
+ opup = ofproto_port_get_cfm_opup(iface->port->bridge->ofproto,
+ iface->ofp_port);
+ if (opup >= 0) {
+ ovsrec_interface_set_cfm_remote_opstate(cfg, opup ? "up" : "down");
+ } else {
+ ovsrec_interface_set_cfm_remote_opstate(cfg, NULL);
+ }
+
error = ofproto_port_get_cfm_remote_mpids(iface->port->bridge->ofproto,
iface->ofp_port, &rmps, &n_rmps);
if (error >= 0) {
{"name": "Open_vSwitch",
- "version": "6.9.3",
- "cksum": "2110020336 16754",
+ "version": "6.10.0",
+ "cksum": "3699312094 16958",
"tables": {
"Open_vSwitch": {
"columns": {
"type": {
"key": "string", "min": 0, "max": "unlimited"},
"ephemeral": true},
+ "cfm_remote_opstate": {
+ "type": {"key": {"type": "string",
+ "enum": ["set", ["up", "down"]]},
+ "min": 0, "max": 1},
+ "ephemeral": true},
"cfm_health": {
"type": {"key": {"type": "integer",
"minInteger": 0,
frame having an invalid interval.
</column>
+ <column name="cfm_remote_opstate">
+ <p>When in extended mode, indicates the operational state of the
+ remote endpoint as either <code>up</code> or <code>down</code>. See
+ <ref column="other_config" key="cfm_opstate"/>.
+ </p>
+ </column>
+
<column name="cfm_health">
<p>
Indicates the health of the interface as a percentage of CCM frames