mbox series

[ovs-dev,v7,00/12] Introduce infrastructure for plug providers

Message ID 20211019101348.3833652-1-frode.nordahl@canonical.com
Headers show
Series Introduce infrastructure for plug providers | expand

Message

Frode Nordahl Oct. 19, 2021, 10:13 a.m. UTC
Introduce infrastructure for plug providers and add feature to
ovn-controller to add and remove ports on the integration bridge as
directed by CMS through Logical_Switch_Port options.

Traditionally it has been the CMSs responsibility to create Virtual
Interfaces (VIFs) as part of instance (Container, Pod, Virtual
Machine etc.) life cycle, and subsequently manage plug/unplug
operations on the Open vSwitch integration bridge.

With the advent of NICs connected to multiple distinct CPUs we can
have a topology where the instance runs on one host and Open
vSwitch and OVN runs on a different host, the smartnic control plane
CPU.  The host facing interfaces will be visible to Open vSwitch
and OVN as representor ports.

The actions necessary for plugging and unplugging the representor
port in Open vSwitch running on the smartnic control plane CPU would
be the same for every CMS.

Hardware or platform specific details for initialization and lookup
of representor ports is provided by an plugging provider hosted
inside or outside the core OVN repository, and linked at OVN build
time.

RFC1 -> RFC2:
 - Introduce the plug-provider interface, remove hardware/platform
   dependent code.
 - Add ovsport module.
 - Integrate with binding module.
 - Split into multiple patches.

RFC2 -> v1:
 - Extend build system, `--with-plug-provider`.
 - Check for required data in b_ctx_in and lbinding data structures.
 - Split consider_plug_lport into update and create processing
   functions.
 - Consider unplug on release where relevant.
 - Add ovn-controller `--enable-dummy-plug` option for testing.
 - Consistent function naming and move ovsport module to controller/.
 - Rename plug-test.c -> plug-dummy.c.
 - Add functional- and unit- tests.

v1 -> v2:
 - Move update to controller/binding.h from patch 6 -> patch 5.
 - Fix lint problems reported by 0-day Robot.

v2 -> v3:
 - Fix build system extension for plug provider.
 - Implement DDlog version of northd change.
 - Rebase on tip.

v3 -> v4:
 - sb:Port_Binding:plugged_by -> sb:Port_Binding:requested_chassis.
 - Move documentation of plugin specific options to plugin
   implementation.
 - ovn-northd-ddlog: squash changes into same patch as C version, rework
   the DDlog implementation. 
 - controller: Use requested_chassis column instead of parsing options.
 - plug-provider: Remove the extra class instantiation layer and
   refcounting.  Add documentation and various tweaks.
 - controller: Add engine node for plug provider so that a plugin run
   function can run at an appropriate time and also allow feeding back
   information about changes that can not be handled incrementally.
 - binding: Fix return values for plug functions so they adhere to the
   incremental processing engine contract.
 - Add support for building in-tree plug providers.

v4 -> v5:
 - binding: Make some data structures and functions public to allow
   other modules to make use of its local binding tracking data
   structures.
 - Add separate incremental processing engine nodes for the plug
   provider.
 - Do change handling in the controller/plug module rather than piggy
   backing on the binding module.
 - Deal with asynchronous notification to plug provider class and
   subsequent freeing of data structures when the transaction commits.
 - Drop the representor plugin as in-tree plugin to address concerns about
   it being Linux-only and having netlink/kernel dependencies.  Will
   upstream to ovn-org/ovn-vif instead.

v5 -> v6:
 - Fix 0-day Robot documentation lexer warning treated as error:
    https://mail.openvswitch.org/pipermail/ovs-build/2021-September/017538.html

v6 -> v7:
 - lport: Fall back to strcmp when requested-chassis option is set
          but Port_Binding->requested_chassis is not filled yet.
 - physical: Make use of common lport_can_bind_on_this_chassis helper
             instead of duplicating the inverse check in the code.
 - tests: Add test cases to cover currently uncovered requested-chassis
          functionality.
 - plug: Make smaps struct members instead of pointers.
 - plug: Don't use is_deleted function when not iterating over tracked
         records.  Avoid adding multiple delete or update iface requests
         to the same transaction.
 - plug: For full recompute, don't process until northd has populated
         Port_Binding->requested_chassis to avoid thrashing on startup.
         Also fix order of processing.
 - plug: Handle failed transactions appropriately.
 - tests: Clean up and extend plug test case.

Previous discussion:
 - RFC1: https://patchwork.ozlabs.org/project/ovn/patch/20210509140305.1910796-1-frode.nordahl@canonical.com/
 - RFC2: https://patchwork.ozlabs.org/project/ovn/cover/20210805145013.3033919-1-frode.nordahl@gmail.com/

Frode Nordahl (12):
  ovn-sb: Add requested_chassis column to Port_Binding.
  controller: Make use of Port_Binding:requested_chassis.
  controller: Move OVS port functions to new module.
  patch: Consume ovsport functions.
  binding: Move can_bind helper to lport module.
  physical: Make use of common can bind helper.
  binding: Make local_binding data structure public.
  ovn-controller: Move shared functions to ovn-util.
  tests: Use built objects for unit test deps.
  lib: Add infrastructure for plug providers.
  ovn-controller: Prepare plug provider infrastructure.
  controller: Consider plugging of ports on CMS request.

 Documentation/automake.mk                     |   2 +
 Documentation/topics/index.rst                |   1 +
 Documentation/topics/plug_providers/index.rst |  32 +
 .../topics/plug_providers/plug-providers.rst  | 196 +++++
 acinclude.m4                                  |  49 ++
 configure.ac                                  |   2 +
 controller/automake.mk                        |   6 +-
 controller/binding.c                          |  67 +-
 controller/binding.h                          |  34 +
 controller/local_data.h                       |  11 +-
 controller/lport.c                            |  25 +
 controller/lport.h                            |   3 +
 controller/ovn-controller.c                   | 268 ++++++-
 controller/ovsport.c                          | 266 +++++++
 controller/ovsport.h                          |  60 ++
 controller/patch.c                            |  39 +-
 controller/physical.c                         |   6 +-
 controller/plug.c                             | 670 ++++++++++++++++++
 controller/plug.h                             |  83 +++
 controller/test-plug.c                        |  70 ++
 lib/automake.mk                               |  10 +-
 lib/chassis-index.c                           |  24 +
 lib/chassis-index.h                           |   3 +
 lib/ovn-util.c                                |  27 +
 lib/ovn-util.h                                |  18 +-
 lib/plug-provider.c                           | 204 ++++++
 lib/plug-provider.h                           | 164 +++++
 lib/plug_providers/dummy/plug-dummy.c         | 119 ++++
 northd/northd.c                               |  45 +-
 northd/northd.h                               |   1 +
 northd/ovn-northd.c                           |   9 +-
 northd/ovn_northd.dl                          | 123 +++-
 ovn-architecture.7.xml                        |  35 +-
 ovn-nb.xml                                    |  21 +
 ovn-sb.ovsschema                              |  10 +-
 ovn-sb.xml                                    |  21 +
 tests/automake.mk                             |  26 +-
 tests/ovn-controller.at                       |   1 -
 tests/ovn-macros.at                           |   2 +-
 tests/ovn-northd.at                           |  45 ++
 tests/ovn-plug.at                             |   8 +
 tests/ovn.at                                  | 220 ++++++
 42 files changed, 2856 insertions(+), 170 deletions(-)
 create mode 100644 Documentation/topics/plug_providers/index.rst
 create mode 100644 Documentation/topics/plug_providers/plug-providers.rst
 create mode 100644 controller/ovsport.c
 create mode 100644 controller/ovsport.h
 create mode 100644 controller/plug.c
 create mode 100644 controller/plug.h
 create mode 100644 controller/test-plug.c
 create mode 100644 lib/plug-provider.c
 create mode 100644 lib/plug-provider.h
 create mode 100644 lib/plug_providers/dummy/plug-dummy.c
 create mode 100644 tests/ovn-plug.at

Comments

Numan Siddique Oct. 21, 2021, 1:32 a.m. UTC | #1
On Tue, Oct 19, 2021 at 6:15 AM Frode Nordahl
<frode.nordahl@canonical.com> wrote:
>
> Introduce infrastructure for plug providers and add feature to
> ovn-controller to add and remove ports on the integration bridge as
> directed by CMS through Logical_Switch_Port options.
>
> Traditionally it has been the CMSs responsibility to create Virtual
> Interfaces (VIFs) as part of instance (Container, Pod, Virtual
> Machine etc.) life cycle, and subsequently manage plug/unplug
> operations on the Open vSwitch integration bridge.
>
> With the advent of NICs connected to multiple distinct CPUs we can
> have a topology where the instance runs on one host and Open
> vSwitch and OVN runs on a different host, the smartnic control plane
> CPU.  The host facing interfaces will be visible to Open vSwitch
> and OVN as representor ports.
>
> The actions necessary for plugging and unplugging the representor
> port in Open vSwitch running on the smartnic control plane CPU would
> be the same for every CMS.
>
> Hardware or platform specific details for initialization and lookup
> of representor ports is provided by an plugging provider hosted
> inside or outside the core OVN repository, and linked at OVN build
> time.
>
> RFC1 -> RFC2:
>  - Introduce the plug-provider interface, remove hardware/platform
>    dependent code.
>  - Add ovsport module.
>  - Integrate with binding module.
>  - Split into multiple patches.
>
> RFC2 -> v1:
>  - Extend build system, `--with-plug-provider`.
>  - Check for required data in b_ctx_in and lbinding data structures.
>  - Split consider_plug_lport into update and create processing
>    functions.
>  - Consider unplug on release where relevant.
>  - Add ovn-controller `--enable-dummy-plug` option for testing.
>  - Consistent function naming and move ovsport module to controller/.
>  - Rename plug-test.c -> plug-dummy.c.
>  - Add functional- and unit- tests.
>
> v1 -> v2:
>  - Move update to controller/binding.h from patch 6 -> patch 5.
>  - Fix lint problems reported by 0-day Robot.
>
> v2 -> v3:
>  - Fix build system extension for plug provider.
>  - Implement DDlog version of northd change.
>  - Rebase on tip.
>
> v3 -> v4:
>  - sb:Port_Binding:plugged_by -> sb:Port_Binding:requested_chassis.
>  - Move documentation of plugin specific options to plugin
>    implementation.
>  - ovn-northd-ddlog: squash changes into same patch as C version, rework
>    the DDlog implementation.
>  - controller: Use requested_chassis column instead of parsing options.
>  - plug-provider: Remove the extra class instantiation layer and
>    refcounting.  Add documentation and various tweaks.
>  - controller: Add engine node for plug provider so that a plugin run
>    function can run at an appropriate time and also allow feeding back
>    information about changes that can not be handled incrementally.
>  - binding: Fix return values for plug functions so they adhere to the
>    incremental processing engine contract.
>  - Add support for building in-tree plug providers.
>
> v4 -> v5:
>  - binding: Make some data structures and functions public to allow
>    other modules to make use of its local binding tracking data
>    structures.
>  - Add separate incremental processing engine nodes for the plug
>    provider.
>  - Do change handling in the controller/plug module rather than piggy
>    backing on the binding module.
>  - Deal with asynchronous notification to plug provider class and
>    subsequent freeing of data structures when the transaction commits.
>  - Drop the representor plugin as in-tree plugin to address concerns about
>    it being Linux-only and having netlink/kernel dependencies.  Will
>    upstream to ovn-org/ovn-vif instead.
>
> v5 -> v6:
>  - Fix 0-day Robot documentation lexer warning treated as error:
>     https://mail.openvswitch.org/pipermail/ovs-build/2021-September/017538.html
>
> v6 -> v7:
>  - lport: Fall back to strcmp when requested-chassis option is set
>           but Port_Binding->requested_chassis is not filled yet.
>  - physical: Make use of common lport_can_bind_on_this_chassis helper
>              instead of duplicating the inverse check in the code.
>  - tests: Add test cases to cover currently uncovered requested-chassis
>           functionality.
>  - plug: Make smaps struct members instead of pointers.
>  - plug: Don't use is_deleted function when not iterating over tracked
>          records.  Avoid adding multiple delete or update iface requests
>          to the same transaction.
>  - plug: For full recompute, don't process until northd has populated
>          Port_Binding->requested_chassis to avoid thrashing on startup.
>          Also fix order of processing.
>  - plug: Handle failed transactions appropriately.
>  - tests: Clean up and extend plug test case.
>
> Previous discussion:
>  - RFC1: https://patchwork.ozlabs.org/project/ovn/patch/20210509140305.1910796-1-frode.nordahl@canonical.com/
>  - RFC2: https://patchwork.ozlabs.org/project/ovn/cover/20210805145013.3033919-1-frode.nordahl@gmail.com/
>
> Frode Nordahl (12):
>   ovn-sb: Add requested_chassis column to Port_Binding.
>   controller: Make use of Port_Binding:requested_chassis.
>   controller: Move OVS port functions to new module.
>   patch: Consume ovsport functions.
>   binding: Move can_bind helper to lport module.
>   physical: Make use of common can bind helper.
>   binding: Make local_binding data structure public.
>   ovn-controller: Move shared functions to ovn-util.
>   tests: Use built objects for unit test deps.
>   lib: Add infrastructure for plug providers.
>   ovn-controller: Prepare plug provider infrastructure.
>   controller: Consider plugging of ports on CMS request.
>
>  Documentation/automake.mk                     |   2 +
>  Documentation/topics/index.rst                |   1 +
>  Documentation/topics/plug_providers/index.rst |  32 +
>  .../topics/plug_providers/plug-providers.rst  | 196 +++++
>  acinclude.m4                                  |  49 ++
>  configure.ac                                  |   2 +
>  controller/automake.mk                        |   6 +-
>  controller/binding.c                          |  67 +-
>  controller/binding.h                          |  34 +
>  controller/local_data.h                       |  11 +-
>  controller/lport.c                            |  25 +
>  controller/lport.h                            |   3 +
>  controller/ovn-controller.c                   | 268 ++++++-
>  controller/ovsport.c                          | 266 +++++++
>  controller/ovsport.h                          |  60 ++
>  controller/patch.c                            |  39 +-
>  controller/physical.c                         |   6 +-
>  controller/plug.c                             | 670 ++++++++++++++++++
>  controller/plug.h                             |  83 +++
>  controller/test-plug.c                        |  70 ++
>  lib/automake.mk                               |  10 +-
>  lib/chassis-index.c                           |  24 +
>  lib/chassis-index.h                           |   3 +
>  lib/ovn-util.c                                |  27 +
>  lib/ovn-util.h                                |  18 +-
>  lib/plug-provider.c                           | 204 ++++++
>  lib/plug-provider.h                           | 164 +++++
>  lib/plug_providers/dummy/plug-dummy.c         | 119 ++++
>  northd/northd.c                               |  45 +-
>  northd/northd.h                               |   1 +
>  northd/ovn-northd.c                           |   9 +-
>  northd/ovn_northd.dl                          | 123 +++-
>  ovn-architecture.7.xml                        |  35 +-
>  ovn-nb.xml                                    |  21 +
>  ovn-sb.ovsschema                              |  10 +-
>  ovn-sb.xml                                    |  21 +
>  tests/automake.mk                             |  26 +-
>  tests/ovn-controller.at                       |   1 -
>  tests/ovn-macros.at                           |   2 +-
>  tests/ovn-northd.at                           |  45 ++
>  tests/ovn-plug.at                             |   8 +
>  tests/ovn.at                                  | 220 ++++++
>  42 files changed, 2856 insertions(+), 170 deletions(-)
>  create mode 100644 Documentation/topics/plug_providers/index.rst
>  create mode 100644 Documentation/topics/plug_providers/plug-providers.rst
>  create mode 100644 controller/ovsport.c
>  create mode 100644 controller/ovsport.h
>  create mode 100644 controller/plug.c
>  create mode 100644 controller/plug.h
>  create mode 100644 controller/test-plug.c
>  create mode 100644 lib/plug-provider.c
>  create mode 100644 lib/plug-provider.h
>  create mode 100644 lib/plug_providers/dummy/plug-dummy.c
>  create mode 100644 tests/ovn-plug.at


Hi Frode,

Thanks for working on this feature.

I went ahead and applied the patches 1-9 to the main branch.

For the remaining patches - 10-12 :

Acked-by: Numan Siddique <numans@ovn.org>

Since these remaining patches add the main functionality I'd prefer if
it goes through
a review from other reviewers.

@Han Zhou   It would be great if you plan to take a look at these patches.

Thanks
Numan

>
> --
> 2.32.0
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Numan Siddique Oct. 21, 2021, 1:34 a.m. UTC | #2
On Wed, Oct 20, 2021 at 9:32 PM Numan Siddique <numans@ovn.org> wrote:
>
> On Tue, Oct 19, 2021 at 6:15 AM Frode Nordahl
> <frode.nordahl@canonical.com> wrote:
> >
> > Introduce infrastructure for plug providers and add feature to
> > ovn-controller to add and remove ports on the integration bridge as
> > directed by CMS through Logical_Switch_Port options.
> >
> > Traditionally it has been the CMSs responsibility to create Virtual
> > Interfaces (VIFs) as part of instance (Container, Pod, Virtual
> > Machine etc.) life cycle, and subsequently manage plug/unplug
> > operations on the Open vSwitch integration bridge.
> >
> > With the advent of NICs connected to multiple distinct CPUs we can
> > have a topology where the instance runs on one host and Open
> > vSwitch and OVN runs on a different host, the smartnic control plane
> > CPU.  The host facing interfaces will be visible to Open vSwitch
> > and OVN as representor ports.
> >
> > The actions necessary for plugging and unplugging the representor
> > port in Open vSwitch running on the smartnic control plane CPU would
> > be the same for every CMS.
> >
> > Hardware or platform specific details for initialization and lookup
> > of representor ports is provided by an plugging provider hosted
> > inside or outside the core OVN repository, and linked at OVN build
> > time.
> >
> > RFC1 -> RFC2:
> >  - Introduce the plug-provider interface, remove hardware/platform
> >    dependent code.
> >  - Add ovsport module.
> >  - Integrate with binding module.
> >  - Split into multiple patches.
> >
> > RFC2 -> v1:
> >  - Extend build system, `--with-plug-provider`.
> >  - Check for required data in b_ctx_in and lbinding data structures.
> >  - Split consider_plug_lport into update and create processing
> >    functions.
> >  - Consider unplug on release where relevant.
> >  - Add ovn-controller `--enable-dummy-plug` option for testing.
> >  - Consistent function naming and move ovsport module to controller/.
> >  - Rename plug-test.c -> plug-dummy.c.
> >  - Add functional- and unit- tests.
> >
> > v1 -> v2:
> >  - Move update to controller/binding.h from patch 6 -> patch 5.
> >  - Fix lint problems reported by 0-day Robot.
> >
> > v2 -> v3:
> >  - Fix build system extension for plug provider.
> >  - Implement DDlog version of northd change.
> >  - Rebase on tip.
> >
> > v3 -> v4:
> >  - sb:Port_Binding:plugged_by -> sb:Port_Binding:requested_chassis.
> >  - Move documentation of plugin specific options to plugin
> >    implementation.
> >  - ovn-northd-ddlog: squash changes into same patch as C version, rework
> >    the DDlog implementation.
> >  - controller: Use requested_chassis column instead of parsing options.
> >  - plug-provider: Remove the extra class instantiation layer and
> >    refcounting.  Add documentation and various tweaks.
> >  - controller: Add engine node for plug provider so that a plugin run
> >    function can run at an appropriate time and also allow feeding back
> >    information about changes that can not be handled incrementally.
> >  - binding: Fix return values for plug functions so they adhere to the
> >    incremental processing engine contract.
> >  - Add support for building in-tree plug providers.
> >
> > v4 -> v5:
> >  - binding: Make some data structures and functions public to allow
> >    other modules to make use of its local binding tracking data
> >    structures.
> >  - Add separate incremental processing engine nodes for the plug
> >    provider.
> >  - Do change handling in the controller/plug module rather than piggy
> >    backing on the binding module.
> >  - Deal with asynchronous notification to plug provider class and
> >    subsequent freeing of data structures when the transaction commits.
> >  - Drop the representor plugin as in-tree plugin to address concerns about
> >    it being Linux-only and having netlink/kernel dependencies.  Will
> >    upstream to ovn-org/ovn-vif instead.
> >
> > v5 -> v6:
> >  - Fix 0-day Robot documentation lexer warning treated as error:
> >     https://mail.openvswitch.org/pipermail/ovs-build/2021-September/017538.html
> >
> > v6 -> v7:
> >  - lport: Fall back to strcmp when requested-chassis option is set
> >           but Port_Binding->requested_chassis is not filled yet.
> >  - physical: Make use of common lport_can_bind_on_this_chassis helper
> >              instead of duplicating the inverse check in the code.
> >  - tests: Add test cases to cover currently uncovered requested-chassis
> >           functionality.
> >  - plug: Make smaps struct members instead of pointers.
> >  - plug: Don't use is_deleted function when not iterating over tracked
> >          records.  Avoid adding multiple delete or update iface requests
> >          to the same transaction.
> >  - plug: For full recompute, don't process until northd has populated
> >          Port_Binding->requested_chassis to avoid thrashing on startup.
> >          Also fix order of processing.
> >  - plug: Handle failed transactions appropriately.
> >  - tests: Clean up and extend plug test case.
> >
> > Previous discussion:
> >  - RFC1: https://patchwork.ozlabs.org/project/ovn/patch/20210509140305.1910796-1-frode.nordahl@canonical.com/
> >  - RFC2: https://patchwork.ozlabs.org/project/ovn/cover/20210805145013.3033919-1-frode.nordahl@gmail.com/
> >
> > Frode Nordahl (12):
> >   ovn-sb: Add requested_chassis column to Port_Binding.
> >   controller: Make use of Port_Binding:requested_chassis.
> >   controller: Move OVS port functions to new module.
> >   patch: Consume ovsport functions.
> >   binding: Move can_bind helper to lport module.
> >   physical: Make use of common can bind helper.
> >   binding: Make local_binding data structure public.
> >   ovn-controller: Move shared functions to ovn-util.
> >   tests: Use built objects for unit test deps.
> >   lib: Add infrastructure for plug providers.
> >   ovn-controller: Prepare plug provider infrastructure.
> >   controller: Consider plugging of ports on CMS request.
> >
> >  Documentation/automake.mk                     |   2 +
> >  Documentation/topics/index.rst                |   1 +
> >  Documentation/topics/plug_providers/index.rst |  32 +
> >  .../topics/plug_providers/plug-providers.rst  | 196 +++++
> >  acinclude.m4                                  |  49 ++
> >  configure.ac                                  |   2 +
> >  controller/automake.mk                        |   6 +-
> >  controller/binding.c                          |  67 +-
> >  controller/binding.h                          |  34 +
> >  controller/local_data.h                       |  11 +-
> >  controller/lport.c                            |  25 +
> >  controller/lport.h                            |   3 +
> >  controller/ovn-controller.c                   | 268 ++++++-
> >  controller/ovsport.c                          | 266 +++++++
> >  controller/ovsport.h                          |  60 ++
> >  controller/patch.c                            |  39 +-
> >  controller/physical.c                         |   6 +-
> >  controller/plug.c                             | 670 ++++++++++++++++++
> >  controller/plug.h                             |  83 +++
> >  controller/test-plug.c                        |  70 ++
> >  lib/automake.mk                               |  10 +-
> >  lib/chassis-index.c                           |  24 +
> >  lib/chassis-index.h                           |   3 +
> >  lib/ovn-util.c                                |  27 +
> >  lib/ovn-util.h                                |  18 +-
> >  lib/plug-provider.c                           | 204 ++++++
> >  lib/plug-provider.h                           | 164 +++++
> >  lib/plug_providers/dummy/plug-dummy.c         | 119 ++++
> >  northd/northd.c                               |  45 +-
> >  northd/northd.h                               |   1 +
> >  northd/ovn-northd.c                           |   9 +-
> >  northd/ovn_northd.dl                          | 123 +++-
> >  ovn-architecture.7.xml                        |  35 +-
> >  ovn-nb.xml                                    |  21 +
> >  ovn-sb.ovsschema                              |  10 +-
> >  ovn-sb.xml                                    |  21 +
> >  tests/automake.mk                             |  26 +-
> >  tests/ovn-controller.at                       |   1 -
> >  tests/ovn-macros.at                           |   2 +-
> >  tests/ovn-northd.at                           |  45 ++
> >  tests/ovn-plug.at                             |   8 +
> >  tests/ovn.at                                  | 220 ++++++
> >  42 files changed, 2856 insertions(+), 170 deletions(-)
> >  create mode 100644 Documentation/topics/plug_providers/index.rst
> >  create mode 100644 Documentation/topics/plug_providers/plug-providers.rst
> >  create mode 100644 controller/ovsport.c
> >  create mode 100644 controller/ovsport.h
> >  create mode 100644 controller/plug.c
> >  create mode 100644 controller/plug.h
> >  create mode 100644 controller/test-plug.c
> >  create mode 100644 lib/plug-provider.c
> >  create mode 100644 lib/plug-provider.h
> >  create mode 100644 lib/plug_providers/dummy/plug-dummy.c
> >  create mode 100644 tests/ovn-plug.at
>
>
> Hi Frode,
>
> Thanks for working on this feature.
>
> I went ahead and applied the patches 1-9 to the main branch.
>
> For the remaining patches - 10-12 :
>
> Acked-by: Numan Siddique <numans@ovn.org>
>
> Since these remaining patches add the main functionality I'd prefer if
> it goes through
> a review from other reviewers.
>
> @Han Zhou   It would be great if you plan to take a look at these patches.
>

I forgot to mention one thing.  Can you please submit another patch to
update the NEWS about this feature ?

Thanks
Numan

> Thanks
> Numan
>
> >
> > --
> > 2.32.0
> >
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >
Frode Nordahl Oct. 21, 2021, 4:15 p.m. UTC | #3
On Thu, Oct 21, 2021 at 3:34 AM Numan Siddique <numans@ovn.org> wrote:
>
> On Wed, Oct 20, 2021 at 9:32 PM Numan Siddique <numans@ovn.org> wrote:
> >
> > On Tue, Oct 19, 2021 at 6:15 AM Frode Nordahl
> > <frode.nordahl@canonical.com> wrote:
> > >
> > > Introduce infrastructure for plug providers and add feature to
> > > ovn-controller to add and remove ports on the integration bridge as
> > > directed by CMS through Logical_Switch_Port options.
> > >
> > > Traditionally it has been the CMSs responsibility to create Virtual
> > > Interfaces (VIFs) as part of instance (Container, Pod, Virtual
> > > Machine etc.) life cycle, and subsequently manage plug/unplug
> > > operations on the Open vSwitch integration bridge.
> > >
> > > With the advent of NICs connected to multiple distinct CPUs we can
> > > have a topology where the instance runs on one host and Open
> > > vSwitch and OVN runs on a different host, the smartnic control plane
> > > CPU.  The host facing interfaces will be visible to Open vSwitch
> > > and OVN as representor ports.
> > >
> > > The actions necessary for plugging and unplugging the representor
> > > port in Open vSwitch running on the smartnic control plane CPU would
> > > be the same for every CMS.
> > >
> > > Hardware or platform specific details for initialization and lookup
> > > of representor ports is provided by an plugging provider hosted
> > > inside or outside the core OVN repository, and linked at OVN build
> > > time.
> > >
> > > RFC1 -> RFC2:
> > >  - Introduce the plug-provider interface, remove hardware/platform
> > >    dependent code.
> > >  - Add ovsport module.
> > >  - Integrate with binding module.
> > >  - Split into multiple patches.
> > >
> > > RFC2 -> v1:
> > >  - Extend build system, `--with-plug-provider`.
> > >  - Check for required data in b_ctx_in and lbinding data structures.
> > >  - Split consider_plug_lport into update and create processing
> > >    functions.
> > >  - Consider unplug on release where relevant.
> > >  - Add ovn-controller `--enable-dummy-plug` option for testing.
> > >  - Consistent function naming and move ovsport module to controller/.
> > >  - Rename plug-test.c -> plug-dummy.c.
> > >  - Add functional- and unit- tests.
> > >
> > > v1 -> v2:
> > >  - Move update to controller/binding.h from patch 6 -> patch 5.
> > >  - Fix lint problems reported by 0-day Robot.
> > >
> > > v2 -> v3:
> > >  - Fix build system extension for plug provider.
> > >  - Implement DDlog version of northd change.
> > >  - Rebase on tip.
> > >
> > > v3 -> v4:
> > >  - sb:Port_Binding:plugged_by -> sb:Port_Binding:requested_chassis.
> > >  - Move documentation of plugin specific options to plugin
> > >    implementation.
> > >  - ovn-northd-ddlog: squash changes into same patch as C version, rework
> > >    the DDlog implementation.
> > >  - controller: Use requested_chassis column instead of parsing options.
> > >  - plug-provider: Remove the extra class instantiation layer and
> > >    refcounting.  Add documentation and various tweaks.
> > >  - controller: Add engine node for plug provider so that a plugin run
> > >    function can run at an appropriate time and also allow feeding back
> > >    information about changes that can not be handled incrementally.
> > >  - binding: Fix return values for plug functions so they adhere to the
> > >    incremental processing engine contract.
> > >  - Add support for building in-tree plug providers.
> > >
> > > v4 -> v5:
> > >  - binding: Make some data structures and functions public to allow
> > >    other modules to make use of its local binding tracking data
> > >    structures.
> > >  - Add separate incremental processing engine nodes for the plug
> > >    provider.
> > >  - Do change handling in the controller/plug module rather than piggy
> > >    backing on the binding module.
> > >  - Deal with asynchronous notification to plug provider class and
> > >    subsequent freeing of data structures when the transaction commits.
> > >  - Drop the representor plugin as in-tree plugin to address concerns about
> > >    it being Linux-only and having netlink/kernel dependencies.  Will
> > >    upstream to ovn-org/ovn-vif instead.
> > >
> > > v5 -> v6:
> > >  - Fix 0-day Robot documentation lexer warning treated as error:
> > >     https://mail.openvswitch.org/pipermail/ovs-build/2021-September/017538.html
> > >
> > > v6 -> v7:
> > >  - lport: Fall back to strcmp when requested-chassis option is set
> > >           but Port_Binding->requested_chassis is not filled yet.
> > >  - physical: Make use of common lport_can_bind_on_this_chassis helper
> > >              instead of duplicating the inverse check in the code.
> > >  - tests: Add test cases to cover currently uncovered requested-chassis
> > >           functionality.
> > >  - plug: Make smaps struct members instead of pointers.
> > >  - plug: Don't use is_deleted function when not iterating over tracked
> > >          records.  Avoid adding multiple delete or update iface requests
> > >          to the same transaction.
> > >  - plug: For full recompute, don't process until northd has populated
> > >          Port_Binding->requested_chassis to avoid thrashing on startup.
> > >          Also fix order of processing.
> > >  - plug: Handle failed transactions appropriately.
> > >  - tests: Clean up and extend plug test case.
> > >
> > > Previous discussion:
> > >  - RFC1: https://patchwork.ozlabs.org/project/ovn/patch/20210509140305.1910796-1-frode.nordahl@canonical.com/
> > >  - RFC2: https://patchwork.ozlabs.org/project/ovn/cover/20210805145013.3033919-1-frode.nordahl@gmail.com/
> > >
> > > Frode Nordahl (12):
> > >   ovn-sb: Add requested_chassis column to Port_Binding.
> > >   controller: Make use of Port_Binding:requested_chassis.
> > >   controller: Move OVS port functions to new module.
> > >   patch: Consume ovsport functions.
> > >   binding: Move can_bind helper to lport module.
> > >   physical: Make use of common can bind helper.
> > >   binding: Make local_binding data structure public.
> > >   ovn-controller: Move shared functions to ovn-util.
> > >   tests: Use built objects for unit test deps.
> > >   lib: Add infrastructure for plug providers.
> > >   ovn-controller: Prepare plug provider infrastructure.
> > >   controller: Consider plugging of ports on CMS request.
> > >
> > >  Documentation/automake.mk                     |   2 +
> > >  Documentation/topics/index.rst                |   1 +
> > >  Documentation/topics/plug_providers/index.rst |  32 +
> > >  .../topics/plug_providers/plug-providers.rst  | 196 +++++
> > >  acinclude.m4                                  |  49 ++
> > >  configure.ac                                  |   2 +
> > >  controller/automake.mk                        |   6 +-
> > >  controller/binding.c                          |  67 +-
> > >  controller/binding.h                          |  34 +
> > >  controller/local_data.h                       |  11 +-
> > >  controller/lport.c                            |  25 +
> > >  controller/lport.h                            |   3 +
> > >  controller/ovn-controller.c                   | 268 ++++++-
> > >  controller/ovsport.c                          | 266 +++++++
> > >  controller/ovsport.h                          |  60 ++
> > >  controller/patch.c                            |  39 +-
> > >  controller/physical.c                         |   6 +-
> > >  controller/plug.c                             | 670 ++++++++++++++++++
> > >  controller/plug.h                             |  83 +++
> > >  controller/test-plug.c                        |  70 ++
> > >  lib/automake.mk                               |  10 +-
> > >  lib/chassis-index.c                           |  24 +
> > >  lib/chassis-index.h                           |   3 +
> > >  lib/ovn-util.c                                |  27 +
> > >  lib/ovn-util.h                                |  18 +-
> > >  lib/plug-provider.c                           | 204 ++++++
> > >  lib/plug-provider.h                           | 164 +++++
> > >  lib/plug_providers/dummy/plug-dummy.c         | 119 ++++
> > >  northd/northd.c                               |  45 +-
> > >  northd/northd.h                               |   1 +
> > >  northd/ovn-northd.c                           |   9 +-
> > >  northd/ovn_northd.dl                          | 123 +++-
> > >  ovn-architecture.7.xml                        |  35 +-
> > >  ovn-nb.xml                                    |  21 +
> > >  ovn-sb.ovsschema                              |  10 +-
> > >  ovn-sb.xml                                    |  21 +
> > >  tests/automake.mk                             |  26 +-
> > >  tests/ovn-controller.at                       |   1 -
> > >  tests/ovn-macros.at                           |   2 +-
> > >  tests/ovn-northd.at                           |  45 ++
> > >  tests/ovn-plug.at                             |   8 +
> > >  tests/ovn.at                                  | 220 ++++++
> > >  42 files changed, 2856 insertions(+), 170 deletions(-)
> > >  create mode 100644 Documentation/topics/plug_providers/index.rst
> > >  create mode 100644 Documentation/topics/plug_providers/plug-providers.rst
> > >  create mode 100644 controller/ovsport.c
> > >  create mode 100644 controller/ovsport.h
> > >  create mode 100644 controller/plug.c
> > >  create mode 100644 controller/plug.h
> > >  create mode 100644 controller/test-plug.c
> > >  create mode 100644 lib/plug-provider.c
> > >  create mode 100644 lib/plug-provider.h
> > >  create mode 100644 lib/plug_providers/dummy/plug-dummy.c
> > >  create mode 100644 tests/ovn-plug.at
> >
> >
> > Hi Frode,
> >
> > Thanks for working on this feature.
> >
> > I went ahead and applied the patches 1-9 to the main branch.
> >
> > For the remaining patches - 10-12 :
> >
> > Acked-by: Numan Siddique <numans@ovn.org>

Thank you for reviews and merges, Numan!

> > Since these remaining patches add the main functionality I'd prefer if
> > it goes through
> > a review from other reviewers.
> >
> > @Han Zhou   It would be great if you plan to take a look at these patches.

Makes sense to me, happy to answer any questions when you get to it, Han.

> I forgot to mention one thing.  Can you please submit another patch to
> update the NEWS about this feature ?

Sure, I'll push one at the end of the series or a separate patch
depending on me getting to it before the rest of the series being
reviewed or not.

Cheers!