diff options
author | Ilya Maximets <i.maximets@samsung.com> | 2019-03-22 15:58:39 +0300 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-03-26 13:56:53 -0700 |
commit | 723b6ab2df688b8bfe2fd5e3e2275749040a616c (patch) | |
tree | 9a90a8676d7f6d58e53f56a15ab85a427b56eedc /ofproto/ofproto.c | |
parent | b80675c6b3f4c27952446b6dc681a50d4c92a64a (diff) | |
download | openvswitch-723b6ab2df688b8bfe2fd5e3e2275749040a616c.tar.gz |
bridge: Propagate patch port pairing errors to db.
Virtual ports like 'patch' ports that almost fully implemented on
'ofproto' layer could have internal to 'ofproto' statuses that
could not be retrieved from 'netdev' or other layers. For example,
in current implementation there is no way to get the patch port
pairing status (i.e. if it has usable peer?).
New 'ofproto-provider' API function 'vport_get_status' introduced to
cover this gap. It allowes 'bridge' layer to retrive current status
of ofproto virtual ports and propagate it to DB.
For now we're only interested in pairing errors of 'patch' ports.
That are propagated to the 'error' column of the 'Interface' table.
Ex.:
$ ovs-vsctl show
...
Bridge "br1"
...
Port "patch1"
Interface "patch1"
type: patch
options: {peer="patch0"}
error: "No usable peer 'patch0' exists in 'system' datapath."
Bridge "br0"
datapath_type: netdev
...
Port "patch0"
Interface "patch0"
type: patch
options: {peer="patch1"}
error: "No usable peer 'patch1' exists in 'netdev' datapath."
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto.c')
-rw-r--r-- | ofproto/ofproto.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 453239df2..3579aac0d 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2627,6 +2627,17 @@ ofproto_port_get_stats(const struct ofport *port, struct netdev_stats *stats) return error; } +int +ofproto_vport_get_status(const struct ofproto *ofproto, ofp_port_t ofp_port, + char **errp) +{ + struct ofport *ofport = ofproto_get_port(ofproto, ofp_port); + + return (ofport && ofproto->ofproto_class->vport_get_status) + ? ofproto->ofproto_class->vport_get_status(ofport, errp) + : EOPNOTSUPP; +} + static int update_port(struct ofproto *ofproto, const char *name) { |