From patchwork Fri Aug 24 17:35:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 961963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41xpMp4Fgnz9s0n for ; Sat, 25 Aug 2018 03:35:34 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 58D64E9F; Fri, 24 Aug 2018 17:35:30 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E7FFDE4A for ; Fri, 24 Aug 2018 17:35:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id B4A9E2C3 for ; Fri, 24 Aug 2018 17:35:27 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id EF68FFF807; Fri, 24 Aug 2018 17:35:24 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 24 Aug 2018 10:35:16 -0700 Message-Id: <20180824173521.19922-1-blp@ovn.org> X-Mailer: git-send-email 2.16.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 1/6] connmgr: Suppress duplicate port status notifications. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org When the status of a port changes, ofproto calls into connmgr to notify controllers. Sometimes, particular changes are only visible to controllers running specific versions of OpenFlow. Until now, OVS would send those controllers duplicate port status notifications. This is unnecessary and somewhat confusing. This commit eliminates it. This commit updates one of the tests not to expect duplicate notifications. Signed-off-by: Ben Pfaff Acked-by: Numan Siddique for all the patches in this --- ofproto/connmgr.c | 38 ++++++++++++++++++++++++++++---------- ofproto/connmgr.h | 4 +++- ofproto/ofproto.c | 18 ++++++++++-------- tests/lacp.at | 3 --- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index f78b4c5ff411..50e0b8f991b5 100644 --- a/ofproto/connmgr.c +++ b/ofproto/connmgr.c @@ -1609,24 +1609,28 @@ ofconn_send(const struct ofconn *ofconn, struct ofpbuf *msg, /* Sending asynchronous messages. */ -/* Sends an OFPT_PORT_STATUS message with 'opp' and 'reason' to appropriate +/* Sends an OFPT_PORT_STATUS message with 'new_pp' and 'reason' to appropriate * controllers managed by 'mgr'. For messages caused by a controller * OFPT_PORT_MOD, specify 'source' as the controller connection that sent the - * request; otherwise, specify 'source' as NULL. */ + * request; otherwise, specify 'source' as NULL. + * + * If 'reason' is OFPPR_MODIFY and 'old_pp' is nonnull, then messages are + * suppressed in the case where the change would not be visible to a particular + * controller. For example, OpenFlow 1.0 does not have the OFPPS_LIVE flag, so + * this would suppress a change solely to that flag from being sent to an + * OpenFlow 1.0 controller. */ void connmgr_send_port_status(struct connmgr *mgr, struct ofconn *source, - const struct ofputil_phy_port *pp, uint8_t reason) + const struct ofputil_phy_port *old_pp, + const struct ofputil_phy_port *new_pp, + uint8_t reason) { /* XXX Should limit the number of queued port status change messages. */ - struct ofputil_port_status ps; - struct ofconn *ofconn; + struct ofputil_port_status new_ps = { reason, *new_pp }; - ps.reason = reason; - ps.desc = *pp; + struct ofconn *ofconn; LIST_FOR_EACH (ofconn, node, &mgr->all_conns) { if (ofconn_receives_async_msg(ofconn, OAM_PORT_STATUS, reason)) { - struct ofpbuf *msg; - /* Before 1.5, OpenFlow specified that OFPT_PORT_MOD should not * generate OFPT_PORT_STATUS messages. That requirement was a * relic of how OpenFlow originally supported a single controller, @@ -1651,7 +1655,21 @@ connmgr_send_port_status(struct connmgr *mgr, struct ofconn *source, continue; } - msg = ofputil_encode_port_status(&ps, ofconn_get_protocol(ofconn)); + enum ofputil_protocol protocol = ofconn_get_protocol(ofconn); + struct ofpbuf *msg = ofputil_encode_port_status(&new_ps, protocol); + if (reason == OFPPR_MODIFY && old_pp) { + struct ofputil_port_status old_ps = { reason, *old_pp }; + struct ofpbuf *old_msg = ofputil_encode_port_status(&old_ps, + protocol); + bool suppress = ofpbuf_equal(msg, old_msg); + ofpbuf_delete(old_msg); + + if (suppress) { + ofpbuf_delete(msg); + continue; + } + } + ofconn_send(ofconn, msg, NULL); } } diff --git a/ofproto/connmgr.h b/ofproto/connmgr.h index eb3be16686c5..4a22f1c26611 100644 --- a/ofproto/connmgr.h +++ b/ofproto/connmgr.h @@ -147,7 +147,9 @@ void ofconn_report_flow_mod(struct ofconn *, enum ofp_flow_mod_command); /* Sending asynchronous messages. */ bool connmgr_wants_packet_in_on_miss(struct connmgr *mgr); void connmgr_send_port_status(struct connmgr *, struct ofconn *source, - const struct ofputil_phy_port *, uint8_t reason); + const struct ofputil_phy_port *old_pp, + const struct ofputil_phy_port *new_pp, + uint8_t reason); void connmgr_send_flow_removed(struct connmgr *, const struct ofputil_flow_removed *) OVS_REQUIRES(ofproto_mutex); diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 9552a585d096..95235f21232c 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2417,7 +2417,7 @@ ofport_install(struct ofproto *p, if (error) { goto error; } - connmgr_send_port_status(p->connmgr, NULL, pp, OFPPR_ADD); + connmgr_send_port_status(p->connmgr, NULL, NULL, pp, OFPPR_ADD); return 0; error: @@ -2438,7 +2438,7 @@ ofport_remove(struct ofport *ofport) struct ofproto *p = ofport->ofproto; bool is_mtu_overridden = ofport_is_mtu_overridden(p, ofport); - connmgr_send_port_status(ofport->ofproto->connmgr, NULL, &ofport->pp, + connmgr_send_port_status(ofport->ofproto->connmgr, NULL, NULL, &ofport->pp, OFPPR_DELETE); ofport_destroy(ofport, true); if (!is_mtu_overridden) { @@ -2483,8 +2483,9 @@ void ofproto_port_set_state(struct ofport *port, enum ofputil_port_state state) { if (port->pp.state != state) { + struct ofputil_phy_port old_pp = port->pp; port->pp.state = state; - connmgr_send_port_status(port->ofproto->connmgr, NULL, + connmgr_send_port_status(port->ofproto->connmgr, NULL, &old_pp, &port->pp, OFPPR_MODIFY); } } @@ -2630,6 +2631,7 @@ update_port(struct ofproto *ofproto, const char *name) port = ofproto_get_port(ofproto, ofproto_port.ofp_port); if (port && !strcmp(netdev_get_name(port->netdev), name)) { struct netdev *old_netdev = port->netdev; + struct ofputil_phy_port old_pp = port->pp; /* 'name' hasn't changed location. Any properties changed? */ bool port_changed = !ofport_equal(&port->pp, &pp); @@ -2652,7 +2654,7 @@ update_port(struct ofproto *ofproto, const char *name) /* Send status update, if any port property changed */ if (port_changed) { connmgr_send_port_status(port->ofproto->connmgr, NULL, - &port->pp, OFPPR_MODIFY); + &old_pp, &port->pp, OFPPR_MODIFY); } netdev_close(old_netdev); @@ -3648,11 +3650,11 @@ update_port_config(struct ofconn *ofconn, struct ofport *port, } if (toggle) { - enum ofputil_port_config old_config = port->pp.config; + struct ofputil_phy_port old_pp = port->pp; port->pp.config ^= toggle; - port->ofproto->ofproto_class->port_reconfigured(port, old_config); - connmgr_send_port_status(port->ofproto->connmgr, ofconn, &port->pp, - OFPPR_MODIFY); + port->ofproto->ofproto_class->port_reconfigured(port, old_pp.config); + connmgr_send_port_status(port->ofproto->connmgr, ofconn, &old_pp, + &port->pp, OFPPR_MODIFY); } } diff --git a/tests/lacp.at b/tests/lacp.at index a7f75ac67acb..7b460d7be35e 100644 --- a/tests/lacp.at +++ b/tests/lacp.at @@ -805,7 +805,6 @@ check_liveness 1 LIVE AT_CHECK([ovs-vsctl \ -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \ -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1]) -check_liveness 2 LIVE # Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2. ovs-appctl time/warp 4100 100 @@ -901,7 +900,6 @@ check_liveness 1 LIVE AT_CHECK([ovs-vsctl \ -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \ -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1]) -check_liveness 2 LIVE # Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2. ovs-appctl time/warp 4100 100 @@ -997,7 +995,6 @@ check_liveness 1 LIVE AT_CHECK([ovs-vsctl \ -- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \ -- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1]) -check_liveness 2 LIVE # Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2. ovs-appctl time/warp 4100 100 From patchwork Fri Aug 24 17:35:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 961964 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41xpNJ68yzz9s0n for ; Sat, 25 Aug 2018 03:36:00 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1E664E9D; Fri, 24 Aug 2018 17:35:32 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 93B70E4A for ; Fri, 24 Aug 2018 17:35:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id F18492C3 for ; Fri, 24 Aug 2018 17:35:28 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 91482FF805; Fri, 24 Aug 2018 17:35:26 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 24 Aug 2018 10:35:17 -0700 Message-Id: <20180824173521.19922-2-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180824173521.19922-1-blp@ovn.org> References: <20180824173521.19922-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 2/6] ofproto: Refactor update_port(). X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org update_port() worked a little too hard to avoid copying and comparing some bits in the ofputil_phy_port. This seems like a simpler approach all around. It should behave the same way. Signed-off-by: Ben Pfaff --- ofproto/ofproto.c | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 95235f21232c..8a8a8494ca94 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2362,9 +2362,8 @@ ofport_open(struct ofproto *ofproto, return netdev; } -/* Returns true if most fields of 'a' and 'b' are equal. Differences in name, - * port number, and 'config' bits other than OFPUTIL_PC_PORT_DOWN are - * disregarded. */ +/* Returns true if most fields of 'a' and 'b' are equal. Differences in name + * and port number are disregarded. */ static bool ofport_equal(const struct ofputil_phy_port *a, const struct ofputil_phy_port *b) @@ -2372,7 +2371,7 @@ ofport_equal(const struct ofputil_phy_port *a, return (eth_addr_equals(a->hw_addr, b->hw_addr) && eth_addr64_equals(a->hw_addr64, b->hw_addr64) && a->state == b->state - && !((a->config ^ b->config) & OFPUTIL_PC_PORT_DOWN) + && a->config == b->config && a->curr == b->curr && a->advertised == b->advertised && a->supported == b->supported @@ -2457,26 +2456,6 @@ ofport_remove_with_name(struct ofproto *ofproto, const char *name) } } -/* Updates 'port' with new 'pp' description. - * - * Does not handle a name or port number change. The caller must implement - * such a change as a delete followed by an add. */ -static void -ofport_modified(struct ofport *port, struct ofputil_phy_port *pp) -{ - port->pp.hw_addr = pp->hw_addr; - port->pp.hw_addr64 = pp->hw_addr64; - port->pp.config = ((port->pp.config & ~OFPUTIL_PC_PORT_DOWN) - | (pp->config & OFPUTIL_PC_PORT_DOWN)); - port->pp.state = ((port->pp.state & ~OFPUTIL_PS_LINK_DOWN) - | (pp->state & OFPUTIL_PS_LINK_DOWN)); - port->pp.curr = pp->curr; - port->pp.advertised = pp->advertised; - port->pp.supported = pp->supported; - port->pp.peer = pp->peer; - port->pp.curr_speed = pp->curr_speed; - port->pp.max_speed = pp->max_speed; -} /* Update OpenFlow 'state' in 'port' and notify controller. */ void @@ -2633,10 +2612,15 @@ update_port(struct ofproto *ofproto, const char *name) struct netdev *old_netdev = port->netdev; struct ofputil_phy_port old_pp = port->pp; + /* ofport_open() only sets OFPUTIL_PC_PORT_DOWN and + * OFPUTIL_PS_LINK_DOWN. Keep the other config and state bits. */ + pp.config |= port->pp.config & ~OFPUTIL_PC_PORT_DOWN; + pp.state |= port->pp.state & ~OFPUTIL_PS_LINK_DOWN; + /* 'name' hasn't changed location. Any properties changed? */ bool port_changed = !ofport_equal(&port->pp, &pp); if (port_changed) { - ofport_modified(port, &pp); + port->pp = pp; } update_mtu(ofproto, port); From patchwork Fri Aug 24 17:35:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 961965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41xpNs33tTz9s0n for ; Sat, 25 Aug 2018 03:36:29 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D01FAEC3; Fri, 24 Aug 2018 17:35:32 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8F1ADE9C for ; Fri, 24 Aug 2018 17:35:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id BC268A8 for ; Fri, 24 Aug 2018 17:35:30 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 3C10FFF80F; Fri, 24 Aug 2018 17:35:27 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 24 Aug 2018 10:35:18 -0700 Message-Id: <20180824173521.19922-3-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180824173521.19922-1-blp@ovn.org> References: <20180824173521.19922-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 3/6] ofproto: Move may_enable from ofport_dpif to ofport. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This concept of whether a port is suitable to be "live" in the sense of the OpenFlow OFPPS_LIVE bit is a generic one that can be handled at the ofproto layer instead of needing to be part of ofproto-dpif. An upcoming commit will make more use of this at the ofproto layer. Signed-off-by: Ben Pfaff --- ofproto/ofproto-dpif.c | 14 ++++++-------- ofproto/ofproto-provider.h | 1 + ofproto/ofproto.c | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index e3abda571d31..643c2cf325f0 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -137,7 +137,6 @@ struct ofport_dpif { struct cfm *cfm; /* Connectivity Fault Management, if any. */ struct bfd *bfd; /* BFD, if any. */ struct lldp *lldp; /* lldp, if any. */ - bool may_enable; /* May be enabled in bonds. */ bool is_tunnel; /* This port is a tunnel. */ long long int carrier_seq; /* Carrier status changes. */ struct ofport_dpif *peer; /* Peer if patch port. */ @@ -479,7 +478,7 @@ type_run(const char *type) ofport->rstp_port, ofport->qdscp, ofport->n_qdscp, ofport->up.pp.config, ofport->up.pp.state, ofport->is_tunnel, - ofport->may_enable); + ofport->up.may_enable); } } xlate_txn_commit(); @@ -1848,7 +1847,6 @@ port_construct(struct ofport *port_) port->cfm = NULL; port->bfd = NULL; port->lldp = NULL; - port->may_enable = false; port->stp_port = NULL; port->stp_state = STP_DISABLED; port->rstp_port = NULL; @@ -2009,7 +2007,7 @@ port_modified(struct ofport *port_) * operationally down or link monitoring false */ if (!(port->up.pp.config & OFPUTIL_PC_PORT_DOWN) && !(port->up.pp.state & OFPUTIL_PS_LINK_DOWN) && - port->may_enable) { + port->up.may_enable) { port->up.pp.state |= OFPUTIL_PS_LIVE; } else { port->up.pp.state &= ~OFPUTIL_PS_LIVE; @@ -2792,7 +2790,7 @@ set_rstp_port(struct ofport *ofport_, ofport, netdev_get_name(ofport->up.netdev)); update_rstp_port_state(ofport); /* Synchronize operational status. */ - rstp_port_set_mac_operational(rp, ofport->may_enable); + rstp_port_set_mac_operational(rp, ofport->up.may_enable); } static void @@ -3341,7 +3339,7 @@ bundle_run(struct ofbundle *bundle) struct ofport_dpif *port; LIST_FOR_EACH (port, bundle_node, &bundle->ports) { - bond_slave_set_may_enable(bundle->bond, port, port->may_enable); + bond_slave_set_may_enable(bundle->bond, port, port->up.may_enable); } if (bond_run(bundle->bond, lacp_status(bundle->lacp))) { @@ -3607,7 +3605,7 @@ port_run(struct ofport_dpif *ofport) } } - if (ofport->may_enable != enable) { + if (ofport->up.may_enable != enable) { struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); ofproto->backer->need_revalidate = REV_PORT_TOGGLED; @@ -3630,7 +3628,7 @@ port_run(struct ofport_dpif *ofport) } } - ofport->may_enable = enable; + ofport->up.may_enable = enable; } static int diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h index 2b77b8993ada..28627cbd3902 100644 --- a/ofproto/ofproto-provider.h +++ b/ofproto/ofproto-provider.h @@ -162,6 +162,7 @@ struct ofport { uint64_t change_seq; long long int created; /* Time created, in msec. */ int mtu; + bool may_enable; /* May be live (OFPPS_LIVE) if link is up. */ }; void ofproto_port_set_state(struct ofport *, enum ofputil_port_state); diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 8a8a8494ca94..94e8b9576b06 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2403,6 +2403,7 @@ ofport_install(struct ofproto *p, ofport->pp = *pp; ofport->ofp_port = pp->port_no; ofport->created = time_msec(); + ofport->may_enable = false; /* Add port to 'p'. */ hmap_insert(&p->ports, &ofport->hmap_node, From patchwork Fri Aug 24 17:35:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 961966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41xpPT6XJvz9s0n for ; Sat, 25 Aug 2018 03:37:01 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C6962EC8; Fri, 24 Aug 2018 17:35:35 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 035D4EC5 for ; Fri, 24 Aug 2018 17:35:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 546E8A8 for ; Fri, 24 Aug 2018 17:35:32 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id EA283FF802; Fri, 24 Aug 2018 17:35:29 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 24 Aug 2018 10:35:19 -0700 Message-Id: <20180824173521.19922-4-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180824173521.19922-1-blp@ovn.org> References: <20180824173521.19922-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 4/6] ofproto-dpif: Refactor port_run(). X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This makes port_run() easier to understand but should not change its behavior. Signed-off-by: Ben Pfaff --- ofproto/ofproto-dpif.c | 62 ++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 643c2cf325f0..868c728c0c14 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -3569,45 +3569,49 @@ ofport_update_peer(struct ofport_dpif *ofport) free(peer_name); } -static void -port_run(struct ofport_dpif *ofport) +static bool +may_enable_port(struct ofport_dpif *ofport) { - long long int carrier_seq = netdev_get_carrier_resets(ofport->up.netdev); - bool carrier_changed = carrier_seq != ofport->carrier_seq; - bool enable = netdev_get_carrier(ofport->up.netdev); - bool cfm_enable = false; - bool bfd_enable = false; - - ofport->carrier_seq = carrier_seq; - - if (ofport->cfm) { - int cfm_opup = cfm_get_opup(ofport->cfm); - - cfm_enable = !cfm_get_fault(ofport->cfm); - - if (cfm_opup >= 0) { - cfm_enable = cfm_enable && cfm_opup; - } + /* Carrier must be up. */ + if (!netdev_get_carrier(ofport->up.netdev)) { + return false; } - if (ofport->bfd) { - bfd_enable = bfd_forwarding(ofport->bfd); + /* If CFM or BFD is enabled, then at least one of them must report that the + * port is up. */ + if ((ofport->bfd || ofport->cfm) + && !(ofport->cfm + && !cfm_get_fault(ofport->cfm) + && cfm_get_opup(ofport->cfm) != 0) + && !(ofport->bfd + && bfd_forwarding(ofport->bfd))) { + return false; } - if (ofport->bfd || ofport->cfm) { - enable = enable && (cfm_enable || bfd_enable); + /* If LACP is enabled, it must report that the link is enabled. */ + if (ofport->bundle + && !lacp_slave_may_enable(ofport->bundle->lacp, ofport)) { + return false; } - if (ofport->bundle) { - enable = enable && lacp_slave_may_enable(ofport->bundle->lacp, ofport); - if (carrier_changed) { - lacp_slave_carrier_changed(ofport->bundle->lacp, ofport); - } + return true; +} + +static void +port_run(struct ofport_dpif *ofport) +{ + long long int carrier_seq = netdev_get_carrier_resets(ofport->up.netdev); + bool carrier_changed = carrier_seq != ofport->carrier_seq; + ofport->carrier_seq = carrier_seq; + if (carrier_changed && ofport->bundle) { + lacp_slave_carrier_changed(ofport->bundle->lacp, ofport); } + bool enable = may_enable_port(ofport); if (ofport->up.may_enable != enable) { - struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); + ofport->up.may_enable = enable; + struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); ofproto->backer->need_revalidate = REV_PORT_TOGGLED; if (ofport->rstp_port) { @@ -3627,8 +3631,6 @@ port_run(struct ofport_dpif *ofport) ofproto_port_set_state(&ofport->up, of_state); } } - - ofport->up.may_enable = enable; } static int From patchwork Fri Aug 24 17:35:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 961967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41xpPz60sSz9s0n for ; Sat, 25 Aug 2018 03:37:27 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 5708DED6; Fri, 24 Aug 2018 17:35:36 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E32BAEB4 for ; Fri, 24 Aug 2018 17:35:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id F3DEBA8 for ; Fri, 24 Aug 2018 17:35:33 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 9B747FF805; Fri, 24 Aug 2018 17:35:31 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 24 Aug 2018 10:35:20 -0700 Message-Id: <20180824173521.19922-5-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180824173521.19922-1-blp@ovn.org> References: <20180824173521.19922-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 5/6] ofproto: Consistently force off OFPPS_LIVE if port or link is down. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org It doesn't make sense for a port that is down to be "live" from OpenFlow's point of view, but this could happen in OVS. Signed-off-by: Ben Pfaff --- ofproto/ofproto-dpif.c | 26 ++------------------------ ofproto/ofproto-provider.h | 1 + ofproto/ofproto.c | 43 +++++++++++++++++++++++++++++++++---------- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 868c728c0c14..1faf996b83c8 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -2003,16 +2003,6 @@ port_modified(struct ofport *port_) bfd_set_netdev(port->bfd, netdev); } - /* Set liveness, unless the link is administratively or - * operationally down or link monitoring false */ - if (!(port->up.pp.config & OFPUTIL_PC_PORT_DOWN) && - !(port->up.pp.state & OFPUTIL_PS_LINK_DOWN) && - port->up.may_enable) { - port->up.pp.state |= OFPUTIL_PS_LIVE; - } else { - port->up.pp.state &= ~OFPUTIL_PS_LIVE; - } - ofproto_dpif_monitor_port_update(port, port->bfd, port->cfm, port->lldp, &port->up.pp.hw_addr); @@ -2047,6 +2037,7 @@ port_reconfigured(struct ofport *port_, enum ofputil_port_config old_config) bundle_update(port->bundle); } } + port_run(port); } static int @@ -3609,7 +3600,7 @@ port_run(struct ofport_dpif *ofport) bool enable = may_enable_port(ofport); if (ofport->up.may_enable != enable) { - ofport->up.may_enable = enable; + ofproto_port_set_enable(&ofport->up, enable); struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); ofproto->backer->need_revalidate = REV_PORT_TOGGLED; @@ -3617,19 +3608,6 @@ port_run(struct ofport_dpif *ofport) if (ofport->rstp_port) { rstp_port_set_mac_operational(ofport->rstp_port, enable); } - - /* Propagate liveness, unless the link is administratively or - * operationally down. */ - if (!(ofport->up.pp.config & OFPUTIL_PC_PORT_DOWN) && - !(ofport->up.pp.state & OFPUTIL_PS_LINK_DOWN)) { - enum ofputil_port_state of_state = ofport->up.pp.state; - if (enable) { - of_state |= OFPUTIL_PS_LIVE; - } else { - of_state &= ~OFPUTIL_PS_LIVE; - } - ofproto_port_set_state(&ofport->up, of_state); - } } } diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h index 28627cbd3902..4fd8cb14ed40 100644 --- a/ofproto/ofproto-provider.h +++ b/ofproto/ofproto-provider.h @@ -165,6 +165,7 @@ struct ofport { bool may_enable; /* May be live (OFPPS_LIVE) if link is up. */ }; +void ofproto_port_set_enable(struct ofport *, bool enable); void ofproto_port_set_state(struct ofport *, enum ofputil_port_state); /* OpenFlow table flags: diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 94e8b9576b06..9594427a2fa6 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -2457,11 +2457,34 @@ ofport_remove_with_name(struct ofproto *ofproto, const char *name) } } +static enum ofputil_port_state +normalize_state(enum ofputil_port_config config, + enum ofputil_port_state state, + bool may_enable) +{ + return (config & OFPUTIL_PC_PORT_DOWN + || state & OFPUTIL_PS_LINK_DOWN + || !may_enable + ? state & ~OFPUTIL_PS_LIVE + : state | OFPUTIL_PS_LIVE); +} + +void +ofproto_port_set_enable(struct ofport *port, bool enable) +{ + if (enable != port->may_enable) { + port->may_enable = enable; + ofproto_port_set_state(port, normalize_state(port->pp.config, + port->pp.state, + port->may_enable)); + } +} /* Update OpenFlow 'state' in 'port' and notify controller. */ void ofproto_port_set_state(struct ofport *port, enum ofputil_port_state state) { + state = normalize_state(port->pp.config, state, port->may_enable); if (port->pp.state != state) { struct ofputil_phy_port old_pp = port->pp; port->pp.state = state; @@ -2611,16 +2634,18 @@ update_port(struct ofproto *ofproto, const char *name) port = ofproto_get_port(ofproto, ofproto_port.ofp_port); if (port && !strcmp(netdev_get_name(port->netdev), name)) { struct netdev *old_netdev = port->netdev; - struct ofputil_phy_port old_pp = port->pp; /* ofport_open() only sets OFPUTIL_PC_PORT_DOWN and - * OFPUTIL_PS_LINK_DOWN. Keep the other config and state bits. */ + * OFPUTIL_PS_LINK_DOWN. Keep the other config and state bits (but + * a port that is down cannot be live). */ pp.config |= port->pp.config & ~OFPUTIL_PC_PORT_DOWN; pp.state |= port->pp.state & ~OFPUTIL_PS_LINK_DOWN; + pp.state = normalize_state(pp.config, pp.state, port->may_enable); /* 'name' hasn't changed location. Any properties changed? */ - bool port_changed = !ofport_equal(&port->pp, &pp); - if (port_changed) { + if (!ofport_equal(&port->pp, &pp)) { + connmgr_send_port_status(port->ofproto->connmgr, NULL, + &port->pp, &pp, OFPPR_MODIFY); port->pp = pp; } @@ -2636,12 +2661,6 @@ update_port(struct ofproto *ofproto, const char *name) port->ofproto->ofproto_class->port_modified(port); } - /* Send status update, if any port property changed */ - if (port_changed) { - connmgr_send_port_status(port->ofproto->connmgr, NULL, - &old_pp, &port->pp, OFPPR_MODIFY); - } - netdev_close(old_netdev); } else { /* If 'port' is nonnull then its name differs from 'name' and thus @@ -3636,7 +3655,11 @@ update_port_config(struct ofconn *ofconn, struct ofport *port, if (toggle) { struct ofputil_phy_port old_pp = port->pp; + port->pp.config ^= toggle; + port->pp.state = normalize_state(port->pp.config, port->pp.state, + port->may_enable); + port->ofproto->ofproto_class->port_reconfigured(port, old_pp.config); connmgr_send_port_status(port->ofproto->connmgr, ofconn, &old_pp, &port->pp, OFPPR_MODIFY); From patchwork Fri Aug 24 17:35:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 961968 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41xpQQ2rJfz9s0n for ; Sat, 25 Aug 2018 03:37:50 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 13773EE0; Fri, 24 Aug 2018 17:35:40 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id B9388EB4 for ; Fri, 24 Aug 2018 17:35:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0201CA8 for ; Fri, 24 Aug 2018 17:35:36 +0000 (UTC) X-Originating-IP: 208.91.3.26 Received: from sigabrt.benpfaff.org (unknown [208.91.3.26]) (Authenticated sender: blp@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 38197FF802; Fri, 24 Aug 2018 17:35:32 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Fri, 24 Aug 2018 10:35:21 -0700 Message-Id: <20180824173521.19922-6-blp@ovn.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180824173521.19922-1-blp@ovn.org> References: <20180824173521.19922-1-blp@ovn.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff , Brad Cowie Subject: [ovs-dev] [PATCH 6/6] netdev-dummy: Initialize new dummy ports as "up". X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Dummy ports started out down and hardly any of the tests ever brought them up. This led to some odd test results and caused problems for testing with controllers that didn't bother with ports that were down, like recent versions of Faucet. There doesn't seem to be a big reason for them to be down by default, so this commit changes them to be up by default. It also updates the tests to match the new behavior. Reported-by: Brad Cowie Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-August/047234.html Signed-off-by: Ben Pfaff --- lib/netdev-dummy.c | 2 +- tests/ofproto-dpif.at | 20 ++--- tests/ofproto.at | 206 +++++++++++++++++++++++++++----------------------- 3 files changed, 124 insertions(+), 104 deletions(-) diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c index d4984674fb53..e7c2e3375b5f 100644 --- a/lib/netdev-dummy.c +++ b/lib/netdev-dummy.c @@ -683,7 +683,7 @@ netdev_dummy_construct(struct netdev *netdev_) netdev->hwaddr.ea[4] = n >> 8; netdev->hwaddr.ea[5] = n; netdev->mtu = 1500; - netdev->flags = 0; + netdev->flags = NETDEV_UP; netdev->ifindex = -EOPNOTSUPP; netdev->requested_n_rxq = netdev_->n_rxq; netdev->requested_n_txq = netdev_->n_txq; diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 362c58db437b..0953bffbaea6 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -713,7 +713,7 @@ AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=ff,bucket=wa AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)']) AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: drop + [Datapath actions: 10 ]) OVS_VSWITCHD_STOP AT_CLEANUP @@ -2395,13 +2395,13 @@ OVS_APP_EXIT_AND_WAIT(ovs-ofctl) AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) -tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745 +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 dnl NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) -tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745 +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 dnl NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered) -tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745 +tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744 ]) AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore]) @@ -6228,7 +6228,7 @@ IFCOUNTERS type=6 ifspeed=100000000 direction=0 - status=0 + status=3 in_octets=202 in_unicasts=3 in_multicasts=4294967295 @@ -6251,7 +6251,7 @@ IFCOUNTERS type=6 ifspeed=100000000 direction=0 - status=0 + status=3 in_octets=148 in_unicasts=2 in_multicasts=4294967295 @@ -6274,7 +6274,7 @@ IFCOUNTERS type=6 ifspeed=100000000 direction=0 - status=0 + status=3 in_octets=0 in_unicasts=0 in_multicasts=4294967295 @@ -6297,7 +6297,7 @@ IFCOUNTERS type=6 ifspeed=100000000 direction=0 - status=0 + status=3 in_octets=0 in_unicasts=0 in_multicasts=4294967295 @@ -6320,7 +6320,7 @@ IFCOUNTERS type=6 ifspeed=100000000 direction=0 - status=0 + status=3 in_octets=202 in_unicasts=3 in_multicasts=4294967295 @@ -6343,7 +6343,7 @@ IFCOUNTERS type=6 ifspeed=100000000 direction=0 - status=0 + status=3 in_octets=148 in_unicasts=2 in_multicasts=4294967295 diff --git a/tests/ofproto.at b/tests/ofproto.at index 9819bc577bdd..c92339a34fef 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -39,8 +39,8 @@ n_tables:254, n_buffers:0 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst LOCAL(br0): addr:aa:55:aa:55:00:00 - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 speed: 0 Mbps now, 0 Mbps max OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 ]) @@ -61,16 +61,16 @@ n_tables:254, n_buffers:0 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst 1(p1): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 speed: 0 Mbps now, 0 Mbps max 99(p2): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 speed: 0 Mbps now, 0 Mbps max LOCAL(br0): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 speed: 0 Mbps now, 0 Mbps max OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0 ]) @@ -125,8 +125,8 @@ AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout]) AT_CHECK([strip_xids < stdout], [0], [dnl OFPST_PORT_DESC reply: LOCAL(br0): addr:aa:55:aa:55:00:00 - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 speed: 0 Mbps now, 0 Mbps max ]) OVS_VSWITCHD_STOP @@ -140,8 +140,8 @@ AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0], [0], [stdout]) AT_CHECK([strip_xids < stdout], [0], [dnl OFPST_PORT_DESC reply (OF1.2): LOCAL(br0): addr:aa:55:aa:55:00:00 - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max ]) OVS_VSWITCHD_STOP @@ -154,28 +154,28 @@ AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0], AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl OFPST_PORT_DESC reply (OF1.5): 1(p1): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max 2(p2): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max 3(p3): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max LOCAL(br0): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max ]) AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2], [0], [stdout]) AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl OFPST_PORT_DESC reply (OF1.5): 2(p2): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max ]) OVS_VSWITCHD_STOP @@ -188,28 +188,28 @@ AT_CHECK([ovs-ofctl -F OXM-OpenFlow16 -O OpenFlow16 -vwarn dump-ports-desc br0], AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl OFPST_PORT_DESC reply (OF1.6): 1(p1): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max 2(p2): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max 3(p3): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max LOCAL(br0): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max ]) AT_CHECK([ovs-ofctl -F OXM-OpenFlow16 -O OpenFlow16 -vwarn dump-ports-desc br0 2], [0], [stdout]) AT_CHECK([strip_xids < stdout | sed 's/00:0./00:0x/'], [0], [dnl OFPST_PORT_DESC reply (OF1.6): 2(p2): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max ]) OVS_VSWITCHD_STOP @@ -1265,16 +1265,17 @@ OVS_VSWITCHD_START for command_config_state in \ 'up 0 0' \ 'noflood NO_FLOOD 0' \ - 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \ - 'flood PORT_DOWN LINK_DOWN' \ - 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \ - 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \ - 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \ - 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \ - 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \ + 'flood 0 0' \ + 'no-receive NO_RECV 0' \ + 'no-forward NO_RECV,NO_FWD 0' \ + 'no-packet-in NO_RECV,NO_FWD,NO_PACKET_IN 0' \ + 'forward NO_RECV,NO_PACKET_IN 0' \ + 'packet-in NO_RECV 0' \ 'up NO_RECV 0' \ - 'receive 0 0' + 'receive 0 0' \ + 'down PORT_DOWN LINK_DOWN' do + printf '\n--- %s --- \n\n' "$command_config_state" set $command_config_state command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3] AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command]) @@ -1298,15 +1299,16 @@ AT_SETUP([ofproto - mod-port (OpenFlow 1.2)]) OVS_VSWITCHD_START for command_config_state in \ 'up 0 LIVE' \ - 'down PORT_DOWN LINK_DOWN' \ - 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \ - 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \ - 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \ - 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \ - 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \ + 'no-receive NO_RECV LIVE' \ + 'no-forward NO_RECV,NO_FWD LIVE' \ + 'no-packet-in NO_RECV,NO_FWD,NO_PACKET_IN LIVE' \ + 'forward NO_RECV,NO_PACKET_IN LIVE' \ + 'packet-in NO_RECV LIVE' \ 'up NO_RECV LIVE' \ - 'receive 0 LIVE' + 'receive 0 LIVE' \ + 'down PORT_DOWN LINK_DOWN' do + printf '\n--- %s --- \n\n' "$command_config_state" set $command_config_state command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3] AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command]) @@ -1329,15 +1331,16 @@ AT_SETUP([ofproto - mod-port (OpenFlow 1.4)]) OVS_VSWITCHD_START for command_config_state in \ 'up 0 LIVE' \ - 'down PORT_DOWN LINK_DOWN' \ - 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \ - 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \ - 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \ - 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \ - 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \ + 'no-receive NO_RECV LIVE' \ + 'no-forward NO_RECV,NO_FWD LIVE' \ + 'no-packet-in NO_RECV,NO_FWD,NO_PACKET_IN LIVE' \ + 'forward NO_RECV,NO_PACKET_IN LIVE' \ + 'packet-in NO_RECV LIVE' \ 'up NO_RECV LIVE' \ - 'receive 0 LIVE' + 'receive 0 LIVE' \ + 'down PORT_DOWN LINK_DOWN' do + printf '\n--- %s --- \n\n' "$command_config_state" set $command_config_state command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3] AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command]) @@ -1361,15 +1364,16 @@ AT_SETUP([ofproto - mod-port (OpenFlow 1.6)]) OVS_VSWITCHD_START for command_config_state in \ 'up 0 LIVE' \ - 'down PORT_DOWN LINK_DOWN' \ - 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \ - 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \ - 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \ - 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \ - 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \ + 'no-receive NO_RECV LIVE' \ + 'no-forward NO_RECV,NO_FWD LIVE' \ + 'no-packet-in NO_RECV,NO_FWD,NO_PACKET_IN LIVE' \ + 'forward NO_RECV,NO_PACKET_IN LIVE' \ + 'packet-in NO_RECV LIVE' \ 'up NO_RECV LIVE' \ - 'receive 0 LIVE' + 'receive 0 LIVE' \ + 'down PORT_DOWN LINK_DOWN' do + printf '\n--- %s --- \n\n' "$command_config_state" set $command_config_state command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3] AT_CHECK([ovs-ofctl -O OpenFlow16 -vwarn mod-port br0 br0 $command]) @@ -3280,7 +3284,7 @@ OVS_VSWITCHD_STOP AT_CLEANUP AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)]) -OVS_VSWITCHD_START +OVS_VSWITCHD_START([set bridge br0 other_config:hwaddr=00:01:02:03:04:05]) AT_CHECK([ovs-ofctl -P standard monitor br0 --detach --no-chdir --pidfile]) check_async () { printf '\n\n--- check_async %d ---\n\n\n' $1 @@ -3315,8 +3319,8 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1 if test X"$1" = X"OFPPR_ADD"; then shift; echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 speed: 0 Mbps now, 0 Mbps max" fi @@ -3324,8 +3328,8 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172 ovs-vsctl del-port br0 test if test X"$1" = X"OFPPR_DELETE"; then shift; echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 speed: 0 Mbps now, 0 Mbps max" fi @@ -3418,8 +3422,12 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172 ovs-vsctl add-port br0 test -- set Interface test type=dummy if test X"$1" = X"OFPPR_ADD"; then shift; echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 + speed: 0 Mbps now, 0 Mbps max +OFPT_PORT_STATUS (OF1.2): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max" fi @@ -3427,8 +3435,8 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172 ovs-vsctl del-port br0 test if test X"$1" = X"OFPPR_DELETE"; then shift; echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max" fi @@ -3528,8 +3536,12 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172 ovs-vsctl add-port br0 test -- set Interface test type=dummy if test X"$1" = X"OFPPR_ADD"; then shift; echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 + speed: 0 Mbps now, 0 Mbps max +OFPT_PORT_STATUS (OF1.3): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max" fi @@ -3537,8 +3549,8 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172 ovs-vsctl del-port br0 test if test X"$1" = X"OFPPR_DELETE"; then shift; echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max" fi @@ -3646,21 +3658,25 @@ udp,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172 ovs-vsctl add-port br0 test -- set Interface test type=dummy if test X"$1" = X"OFPPR_ADD"; then shift; echo >>expout "OFPT_PORT_STATUS (OF1.4): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 + speed: 0 Mbps now, 0 Mbps max +OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max" fi # OFPT_PORT_STATUS, OFPPR_MODIFY - ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 test up + ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 test down if test X"$1" = X"OFPPR_MODIFY"; then shift; echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: 0 - state: LINK_DOWN + config: PORT_DOWN + state: 0 speed: 0 Mbps now, 0 Mbps max OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: 0 - state: LIVE + config: PORT_DOWN + state: LINK_DOWN speed: 0 Mbps now, 0 Mbps max" fi @@ -3668,8 +3684,8 @@ OFPT_PORT_STATUS (OF1.4): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x ovs-vsctl del-port br0 test if test X"$1" = X"OFPPR_DELETE"; then shift; echo >>expout "OFPT_PORT_STATUS (OF1.4): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: 0 - state: LIVE + config: PORT_DOWN + state: LINK_DOWN speed: 0 Mbps now, 0 Mbps max" fi @@ -3827,21 +3843,25 @@ check_async () { ovs-vsctl add-port br0 test -- set Interface test type=dummy if test X"$1" = X"OFPPR_ADD"; then shift; echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: PORT_DOWN - state: LINK_DOWN + config: 0 + state: 0 + speed: 0 Mbps now, 0 Mbps max +OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: 0 + state: LIVE speed: 0 Mbps now, 0 Mbps max" fi # OFPT_PORT_STATUS, OFPPR_MODIFY - ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up + ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test down if test X"$1" = X"OFPPR_MODIFY"; then shift; echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: 0 - state: LINK_DOWN + config: PORT_DOWN + state: 0 speed: 0 Mbps now, 0 Mbps max -OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x - config: 0 - state: LIVE +OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x + config: PORT_DOWN + state: LINK_DOWN speed: 0 Mbps now, 0 Mbps max" fi @@ -3849,8 +3869,8 @@ OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x ovs-vsctl del-port br0 test if test X"$1" = X"OFPPR_DELETE"; then shift; echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x - config: 0 - state: LIVE + config: PORT_DOWN + state: LINK_DOWN speed: 0 Mbps now, 0 Mbps max" fi