[ovs-dev] [PATCHv2] bridge: Rate limit port creations and deletions.
Chris Wright
chrisw at sous-sol.org
Thu Apr 12 17:40:13 PDT 2012
* Ethan Jackson (ethan at nicira.com) wrote:
> @@ -1039,7 +1079,8 @@ add_del_bridges(const struct ovsrec_open_vswitch *cfg)
> * port already belongs to a different datapath, so we must do all port
> * deletions before any port additions. */
> static void
> -bridge_del_ofproto_ports(struct bridge *br)
> +bridge_del_ofproto_ports(struct bridge *br,
> + long long int port_action_timer)
> {
> struct ofproto_port_dump dump;
> struct ofproto_port ofproto_port;
> @@ -1070,10 +1111,16 @@ bridge_del_ofproto_ports(struct bridge *br)
> || !strcmp(netdev_get_type(iface->netdev), type))) {
> continue;
> }
> - error = ofproto_port_del(br->ofproto, ofproto_port.ofp_port);
> - if (error) {
> - VLOG_WARN("bridge %s: failed to remove %s interface (%s)",
> - br->name, name, strerror(error));
> +
> + if (may_port_action(port_action_timer)) {
> + error = ofproto_port_del(br->ofproto, ofproto_port.ofp_port);
> + if (error) {
> + VLOG_WARN("bridge %s: failed to remove %s interface (%s)",
> + br->name, name, strerror(error));
> + } else {
> + VLOG_INFO("bridge %s: removed interface %s (%d)", br->name,
> + name, ofproto_port.ofp_port);
> + }
> }
> if (iface) {
> netdev_close(iface->netdev);
Is this part correct when !may_port_action?
More information about the dev
mailing list