diff mbox

[ovs-dev] vswitchd: Move config_ofproto_types call before bridge_add_port

Message ID 1487181760-54341-1-git-send-email-rams@vmware.com
State Accepted
Headers show

Commit Message

Shashank Ram Feb. 15, 2017, 6:02 p.m. UTC
Currently, the call to config_ofproto_types() happens at the end
of bridge_reconfigure(), after missing ofprotos and ports are created.
However, it might be usefull to make this call before adding missing
ports through the dpif interface. With the current use case
(dpif-netdev), this will save us a reconfiguration cycle.

The call to config_ofproto_types was intorduced as a
part of passing the Openvswitch other_config smap to dpif.
However, if we want to do this before the ports are added,
it needs to be done after ofproto_create() is called so that
dpif_backer is added to all_dpif_backers list. Once the
dpif_backer is added, the call to config_ofproto_types()
will ensure that the set_config handler in dpif-netdev/netlink.c
is called.

Signed-off-by: Shashank Ram <rams@vmware.com>
---
 vswitchd/bridge.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Daniele Di Proietto Feb. 15, 2017, 10:50 p.m. UTC | #1
2017-02-15 10:02 GMT-08:00 Shashank Ram <rams@vmware.com>:
> Currently, the call to config_ofproto_types() happens at the end
> of bridge_reconfigure(), after missing ofprotos and ports are created.
> However, it might be usefull to make this call before adding missing
> ports through the dpif interface. With the current use case
> (dpif-netdev), this will save us a reconfiguration cycle.
>
> The call to config_ofproto_types was intorduced as a
> part of passing the Openvswitch other_config smap to dpif.
> However, if we want to do this before the ports are added,
> it needs to be done after ofproto_create() is called so that
> dpif_backer is added to all_dpif_backers list. Once the
> dpif_backer is added, the call to config_ofproto_types()
> will ensure that the set_config handler in dpif-netdev/netlink.c
> is called.
>
> Signed-off-by: Shashank Ram <rams@vmware.com>

Thanks, applied to master

> ---
>  vswitchd/bridge.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index 21c3c79..2e10013 100644
> --- a/vswitchd/bridge.c
> +++ b/vswitchd/bridge.c
> @@ -654,6 +654,9 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
>              }
>          }
>      }
> +
> +    config_ofproto_types(&ovs_cfg->other_config);
> +
>      HMAP_FOR_EACH (br, node, &all_bridges) {
>          bridge_add_ports(br, &br->wanted_ports);
>          shash_destroy(&br->wanted_ports);
> @@ -706,8 +709,6 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
>      }
>      free(managers);
>
> -    config_ofproto_types(&ovs_cfg->other_config);
> -
>      /* The ofproto-dpif provider does some final reconfiguration in its
>       * ->type_run() function.  We have to call it before notifying the database
>       * client that reconfiguration is complete, otherwise there is a very
> --
> 2.6.2
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff mbox

Patch

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 21c3c79..2e10013 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -654,6 +654,9 @@  bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
             }
         }
     }
+
+    config_ofproto_types(&ovs_cfg->other_config);
+
     HMAP_FOR_EACH (br, node, &all_bridges) {
         bridge_add_ports(br, &br->wanted_ports);
         shash_destroy(&br->wanted_ports);
@@ -706,8 +709,6 @@  bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
     }
     free(managers);
 
-    config_ofproto_types(&ovs_cfg->other_config);
-
     /* The ofproto-dpif provider does some final reconfiguration in its
      * ->type_run() function.  We have to call it before notifying the database
      * client that reconfiguration is complete, otherwise there is a very