Hi Chenjie,

Yes, the dump-ports-desc can be used to obtain the current port state and negotiated state with the peer.  This data will need to be mapped back to the data interface mapping of the host so that the appropriate alarms may be raised against the proper entity.

 

In addition, if the data interface is a bond, the following information will also have to be retrieved in order to obtain the full state of the bond interface, including LACP information (if applicable).

 

ovs-appctl bond/show

ovs-appctl lacp/show

 

Finally, the alarming behavior should be the following:

 

Data port is down and does not belong to a bond – Critical Alarm

Data port(s) down, but enabled port remains in bond – Major Alarm (degraded service)

All data ports down in a bond – Critical Alarm

 

From: "Xu, Chenjie" <chenjie.xu@intel.com>
Date: Monday, September 16, 2019 at 11:32 PM
To: "Peters, Matt" <Matt.Peters@windriver.com>
Cc: "starlingx-discuss@lists.starlingx.io" <starlingx-discuss@lists.starlingx.io>, "Zhao, Forrest" <forrest.zhao@intel.com>, Ghada Khalil <Ghada.Khalil@windriver.com>
Subject: [Starlingx-discuss] OVS collectd interface/port state monitoring

 

 

Hi Matt,

For task “OVS collectd interface/port state monitoring”, which parts should be monitored? For example: Bridge, Port.

https://storyboard.openstack.org/#!/story/2002948

https://bugs.launchpad.net/starlingx/+bug/1834512

Bridge "br-phy1"

        Port "br-phy1"

            Interface "br-phy1"

                type: internal

        Port "eth1"

            Interface "eth1"

                type: dpdk

                options: {dpdk-devargs="0000:18:00.1", n_rxq="1"}

        Port "lldp8a3c28ca-7f"

            Interface "lldp8a3c28ca-7f"

                type: internal

 

The command “ovs-ofctl dump-ports-desc $ovs_bridge” can be used with collectd for both OVS and OVS-DPDK. The link status for interfaces can be detected as below:

For OVS:

After pull the cabel:

controller-0:/home/sysadmin# ovs-ofctl dump-ports-desc br-phy0

OFPST_PORT_DESC reply (xid=0x2):

1(enp51s0f3): addr:0c:c4:7a:ff:5f:ef

     config:     0

     state:      LINK_DOWN

     current:    COPPER AUTO_NEG

     advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG AUTO_PAUSE

     supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG AUTO_PAUSE

     speed: 0 Mbps now, 1000 Mbps max

2(phy-br-phy0): addr:1a:0a:21:03:6a:1e

     config:     0

     state:      0

     speed: 0 Mbps now, 0 Mbps max

LOCAL(br-phy0): addr:0c:c4:7a:ff:5f:ef

     config:     PORT_DOWN

     state:      LINK_DOWN

     speed: 0 Mbps now, 0 Mbps max

After plug in the cable:

controller-0:/home/sysadmin# ovs-ofctl dump-ports-desc br-phy0

OFPST_PORT_DESC reply (xid=0x2):

1(enp51s0f3): addr:0c:c4:7a:ff:5f:ef

     config:     0

     state:      0

     current:    1GB-FD COPPER AUTO_NEG

     advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG AUTO_PAUSE

     supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG AUTO_PAUSE

     speed: 1000 Mbps now, 1000 Mbps max

2(phy-br-phy0): addr:1a:0a:21:03:6a:1e

     config:     0

     state:      0

     speed: 0 Mbps now, 0 Mbps max

LOCAL(br-phy0): addr:0c:c4:7a:ff:5f:ef

     config:     PORT_DOWN

     state:      LINK_DOWN

     speed: 0 Mbps now, 0 Mbps max

 

For OVS-DPDK:

After pull the cabel:

controller-0:/home/sysadmin# ovs-ofctl dump-ports-desc br-phy1

OFPST_PORT_DESC reply (xid=0x2):

1(eth1): addr:3c:fd:fe:da:e8:85

     config:     0

     state:      LINK_DOWN

     current:    AUTO_NEG

     speed: 0 Mbps now, 0 Mbps max

2(lldp8a3c28ca-7f): addr:52:97:0b:a4:ef:23

     config:     0

     state:      0

     current:    10MB-FD COPPER

     speed: 10 Mbps now, 0 Mbps max

LOCAL(br-phy1): addr:3c:fd:fe:da:e8:85

     config:     0

     state:      0

     current:    10MB-FD COPPER

     speed: 10 Mbps now, 0 Mbps max

After plug in the cable:

controller-0:/home/sysadmin# ovs-ofctl dump-ports-desc br-phy1

OFPST_PORT_DESC reply (xid=0x2):

1(eth1): addr:3c:fd:fe:da:e8:85

     config:     0

     state:      0

     current:    10GB-FD AUTO_NEG

     speed: 10000 Mbps now, 0 Mbps max

2(lldp8a3c28ca-7f): addr:52:97:0b:a4:ef:23

     config:     0

     state:      0

     current:    10MB-FD COPPER

     speed: 10 Mbps now, 0 Mbps max

LOCAL(br-phy1): addr:3c:fd:fe:da:e8:85

     config:     0

     state:      0

     current:    10MB-FD COPPER

     speed: 10 Mbps now, 0 Mbps max

 

Best Regards,

Xu, Chenjie