ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_cfm_remote_mpids);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_cfm_health);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_cfm_remote_opstate);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_cfm_remote_mpids);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_cfm_health);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_cfm_remote_opstate);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_lacp_current);
ovsdb_idl_omit(idl, &ovsrec_interface_col_external_ids);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_lacp_current);
ovsdb_idl_omit(idl, &ovsrec_interface_col_external_ids);
iface_configure_cfm(iface);
iface_configure_qos(iface, port->cfg->qos);
iface_set_mac(iface);
iface_configure_cfm(iface);
iface_configure_qos(iface, port->cfg->qos);
iface_set_mac(iface);
if ((port_cfg->vlan_mode && !strcmp(port_cfg->vlan_mode, "splinter"))
|| iface_is_internal(iface_cfg, br->cfg)) {
if ((port_cfg->vlan_mode && !strcmp(port_cfg->vlan_mode, "splinter"))
|| iface_is_internal(iface_cfg, br->cfg)) {
IFACE_STAT(rx_crc_errors, "rx_crc_err") \
IFACE_STAT(collisions, "collisions")
IFACE_STAT(rx_crc_errors, "rx_crc_err") \
IFACE_STAT(collisions, "collisions")
-#define IFACE_STAT(MEMBER, NAME) NAME,
- static char *keys[] = { IFACE_STATS };
+#define IFACE_STAT(MEMBER, NAME) + 1
+ enum { N_IFACE_STATS = IFACE_STATS };
* all-1s, and we will deal with that correctly below. */
netdev_get_stats(iface->netdev, &stats);
* all-1s, and we will deal with that correctly below. */
netdev_get_stats(iface->netdev, &stats);
- /* Copy statistics into values[] array. */
- i = 0;
-#define IFACE_STAT(MEMBER, NAME) values[i++] = stats.MEMBER;
+ /* Copy statistics into keys[] and values[]. */
+ n = 0;
+#define IFACE_STAT(MEMBER, NAME) \
+ if (stats.MEMBER != UINT64_MAX) { \
+ keys[n] = NAME; \
+ values[n] = stats.MEMBER; \
+ n++; \
+ }
- ovsrec_interface_set_statistics(iface->cfg, keys, values,
- ARRAY_SIZE(keys));
+ ovsrec_interface_set_statistics(iface->cfg, keys, values, n);
ovsrec_interface_set_link_resets(iface->cfg, &link_resets, 1);
iface_refresh_cfm_stats(iface);
ovsrec_interface_set_link_resets(iface->cfg, &link_resets, 1);
iface_refresh_cfm_stats(iface);