mbox series

[ovs-dev,ovn,v8,0/2] Support logical switches with multiple localnet ports

Message ID 20200519155816.24508-1-ihrachys@redhat.com
Headers show
Series Support logical switches with multiple localnet ports | expand

Message

Ihar Hrachyshka May 19, 2020, 3:58 p.m. UTC
Hi all,

This series is to allow for multiple localnet ports to be present in a
logical switch. Even before the series, it was allowed to create
multiple ports of this kind but they were handled inconsistently.

This series uses logical switches with multiple localnet ports
(LSMLP) to implement what is called "routed provider networks" in
OpenStack. To elaborate, this allows to natively model a network that
has multiple segments with implied L3 routing between the segments
realized by the fabric. A user can operate such a network as a single
entity instead of deciding on which segment to choose for their
port bindings.

The assumption in this implementation is that while a logical switch can
have multiple localnet ports, each chassis has only one of corresponding
physical networks mapped. Meaning, if the same LS has localnet ports for
networks A, B, and C, then each chassis can either be mapped to A, B, or
C, but not several of the networks. (Note this doesn't mean that a
chassis can't be mapped to network D, as long as it doesn't have a
corresponding localnet port in this same logical switch.)

Ihar Hrachyshka (2):
  Support logical switches with multiple localnet ports
  Log missing bridge per localnet port just once

---
v2: - rebase on top of series that refactors code dealing with
      localnet ports.
    - tests: send packets both ways, more test scenarios covered.
    - use x2nrealloc to allocate ->localnet_ports.
    - use n_localnet_ports counter instead of localnet_ports pointer
      to detect switches with localnet ports.
v3: - adjusted documentation to be more explicit about how multiple
      localnet ports scenario should be used in practice.
    - more tests (broadcast, multiple co-hosted switches with multiple
      localnet ports)
v4: - sent as a series, fixed test description to reflect we test
      broadcast only.
v5: - fixed a test case failure on slower machines due to service
      broadcast traffic captured.
    - rearranged parameters in new functions to keep output parameters
      at the end.
v6: - fixed several memory leaks due to struct ds not destroyed /
      char* not freed.
    - explained why we don't rate limit messages about unbound
      localnet ports.
    - docs: fixed a missing space between sentences.
    - nit: rearranged code inside controller/patch.c to avoid an `if`.
v7: - simplified new build_* functions by removing stage_hint
      calculation.
    - simplified signature of build_pre_acl_flows_for_nbsp.
    - renamed build_pre_acl_flows_for_nbsp -> build_pre_acl_flows.
    - nit: removed redundant newlines between new build_* functions.
v8: - (drop refactoring patches that were already merged).
    - don't assume C99 pointer-to-bool conversion semantics.
    - allocated_localnet_ports -> n_allocated_localnet_ports.
    - define missed_bridges on file level and introduce
      patch_[init|destroy] functions.
---

 controller/binding.c        |  13 +
 controller/ovn-controller.c |   2 +
 controller/patch.c          |  44 +++-
 controller/patch.h          |   2 +
 northd/ovn-northd.c         |  62 +++--
 ovn-architecture.7.xml      |  50 +++-
 ovn-nb.xml                  |  23 +-
 ovn-sb.xml                  |  21 +-
 tests/ovn.at                | 504 ++++++++++++++++++++++++++++++++++++
 9 files changed, 667 insertions(+), 54 deletions(-)

Comments

Mark Michelson May 20, 2020, 2:35 p.m. UTC | #1
Acked-by: Mark Michelson <mmichels@redhat.com>

On 5/19/20 11:58 AM, Ihar Hrachyshka wrote:
> Hi all,
> 
> This series is to allow for multiple localnet ports to be present in a
> logical switch. Even before the series, it was allowed to create
> multiple ports of this kind but they were handled inconsistently.
> 
> This series uses logical switches with multiple localnet ports
> (LSMLP) to implement what is called "routed provider networks" in
> OpenStack. To elaborate, this allows to natively model a network that
> has multiple segments with implied L3 routing between the segments
> realized by the fabric. A user can operate such a network as a single
> entity instead of deciding on which segment to choose for their
> port bindings.
> 
> The assumption in this implementation is that while a logical switch can
> have multiple localnet ports, each chassis has only one of corresponding
> physical networks mapped. Meaning, if the same LS has localnet ports for
> networks A, B, and C, then each chassis can either be mapped to A, B, or
> C, but not several of the networks. (Note this doesn't mean that a
> chassis can't be mapped to network D, as long as it doesn't have a
> corresponding localnet port in this same logical switch.)
> 
> Ihar Hrachyshka (2):
>    Support logical switches with multiple localnet ports
>    Log missing bridge per localnet port just once
> 
> ---
> v2: - rebase on top of series that refactors code dealing with
>        localnet ports.
>      - tests: send packets both ways, more test scenarios covered.
>      - use x2nrealloc to allocate ->localnet_ports.
>      - use n_localnet_ports counter instead of localnet_ports pointer
>        to detect switches with localnet ports.
> v3: - adjusted documentation to be more explicit about how multiple
>        localnet ports scenario should be used in practice.
>      - more tests (broadcast, multiple co-hosted switches with multiple
>        localnet ports)
> v4: - sent as a series, fixed test description to reflect we test
>        broadcast only.
> v5: - fixed a test case failure on slower machines due to service
>        broadcast traffic captured.
>      - rearranged parameters in new functions to keep output parameters
>        at the end.
> v6: - fixed several memory leaks due to struct ds not destroyed /
>        char* not freed.
>      - explained why we don't rate limit messages about unbound
>        localnet ports.
>      - docs: fixed a missing space between sentences.
>      - nit: rearranged code inside controller/patch.c to avoid an `if`.
> v7: - simplified new build_* functions by removing stage_hint
>        calculation.
>      - simplified signature of build_pre_acl_flows_for_nbsp.
>      - renamed build_pre_acl_flows_for_nbsp -> build_pre_acl_flows.
>      - nit: removed redundant newlines between new build_* functions.
> v8: - (drop refactoring patches that were already merged).
>      - don't assume C99 pointer-to-bool conversion semantics.
>      - allocated_localnet_ports -> n_allocated_localnet_ports.
>      - define missed_bridges on file level and introduce
>        patch_[init|destroy] functions.
> ---
> 
>   controller/binding.c        |  13 +
>   controller/ovn-controller.c |   2 +
>   controller/patch.c          |  44 +++-
>   controller/patch.h          |   2 +
>   northd/ovn-northd.c         |  62 +++--
>   ovn-architecture.7.xml      |  50 +++-
>   ovn-nb.xml                  |  23 +-
>   ovn-sb.xml                  |  21 +-
>   tests/ovn.at                | 504 ++++++++++++++++++++++++++++++++++++
>   9 files changed, 667 insertions(+), 54 deletions(-)
>