mbox series

[ovs-dev,0/6] MAC learning support in OVN.

Message ID 20210205065622.39226-1-numans@ovn.org
Headers show
Series MAC learning support in OVN. | expand

Message

Numan Siddique Feb. 5, 2021, 6:56 a.m. UTC
From: Numan Siddique <numans@ovn.org>

This series adds the support to learn the macs seen on logical port
VIF's whose port security is disabled and 'unknown' address set.

A new table - FDB is added in Southboud database to store the
port-to-mac mappings.

The first patch is a small refactor and moves the mac_binding related
code from pinctrl.c to a separate file - mac-learn.c. pinctrl.c still
writes the learnt mac_bindings to the MAC_Binding table.

The remaining patches actually adds the mac learning support.

The main usecase of this patch series is to stop flooding of the packet
to all the logical ports which accept unknown destinations once the
mac is learnt from such ports.  This patch excludes learning the macs
from the localnet ports as this could cause lot of FDB entries since
such ports can receive the broad cast traffic fron the physical network.

Numan Siddique (6):
  controller: Split mac learning code to a separate file.
  MAC learning: Add a new FDB table in southbound db.
  MAC learning: Add new actions - put_fdb, get_fdb and lookup_fdb.
  controller: MAC learning: Add OF rules for the FDB entries.
  northd: MAC learning: Add logical flows for fdb.
  northd: Cleanup stale FDB entries.

 controller/automake.mk       |   5 +-
 controller/lflow.c           | 110 +++++++
 controller/lflow.h           |  13 +-
 controller/mac-learn.c       | 180 +++++++++++
 controller/mac-learn.h       |  66 ++++
 controller/ovn-controller.c  |  32 +-
 controller/pinctrl.c         | 220 +++++++++-----
 controller/pinctrl.h         |   1 +
 include/ovn/actions.h        |  33 ++
 include/ovn/logical-fields.h |   4 +
 lib/actions.c                | 176 +++++++++++
 lib/ovn-util.c               |  20 +-
 lib/ovn-util.h               |   4 +
 northd/ovn-northd.8.xml      | 162 ++++++++--
 northd/ovn-northd.c          | 136 +++++++--
 ovn-sb.ovsschema             |  19 +-
 ovn-sb.xml                   |  86 ++++++
 tests/ovn-northd.at          |  92 +++++-
 tests/ovn.at                 | 575 ++++++++++++++++++++++++++++++++---
 tests/test-ovn.c             |   2 +
 utilities/ovn-trace.c        | 145 ++++++++-
 21 files changed, 1887 insertions(+), 194 deletions(-)
 create mode 100644 controller/mac-learn.c
 create mode 100644 controller/mac-learn.h

Comments

Mark Michelson Feb. 19, 2021, 1:41 a.m. UTC | #1
Aside from the comments on patch 1,

Acked-by: Mark Michelson <mmichels@redhat.com>


On 2/5/21 1:56 AM, numans@ovn.org wrote:
> From: Numan Siddique <numans@ovn.org>
> 
> This series adds the support to learn the macs seen on logical port
> VIF's whose port security is disabled and 'unknown' address set.
> 
> A new table - FDB is added in Southboud database to store the
> port-to-mac mappings.
> 
> The first patch is a small refactor and moves the mac_binding related
> code from pinctrl.c to a separate file - mac-learn.c. pinctrl.c still
> writes the learnt mac_bindings to the MAC_Binding table.
> 
> The remaining patches actually adds the mac learning support.
> 
> The main usecase of this patch series is to stop flooding of the packet
> to all the logical ports which accept unknown destinations once the
> mac is learnt from such ports.  This patch excludes learning the macs
> from the localnet ports as this could cause lot of FDB entries since
> such ports can receive the broad cast traffic fron the physical network.
> 
> Numan Siddique (6):
>    controller: Split mac learning code to a separate file.
>    MAC learning: Add a new FDB table in southbound db.
>    MAC learning: Add new actions - put_fdb, get_fdb and lookup_fdb.
>    controller: MAC learning: Add OF rules for the FDB entries.
>    northd: MAC learning: Add logical flows for fdb.
>    northd: Cleanup stale FDB entries.
> 
>   controller/automake.mk       |   5 +-
>   controller/lflow.c           | 110 +++++++
>   controller/lflow.h           |  13 +-
>   controller/mac-learn.c       | 180 +++++++++++
>   controller/mac-learn.h       |  66 ++++
>   controller/ovn-controller.c  |  32 +-
>   controller/pinctrl.c         | 220 +++++++++-----
>   controller/pinctrl.h         |   1 +
>   include/ovn/actions.h        |  33 ++
>   include/ovn/logical-fields.h |   4 +
>   lib/actions.c                | 176 +++++++++++
>   lib/ovn-util.c               |  20 +-
>   lib/ovn-util.h               |   4 +
>   northd/ovn-northd.8.xml      | 162 ++++++++--
>   northd/ovn-northd.c          | 136 +++++++--
>   ovn-sb.ovsschema             |  19 +-
>   ovn-sb.xml                   |  86 ++++++
>   tests/ovn-northd.at          |  92 +++++-
>   tests/ovn.at                 | 575 ++++++++++++++++++++++++++++++++---
>   tests/test-ovn.c             |   2 +
>   utilities/ovn-trace.c        | 145 ++++++++-
>   21 files changed, 1887 insertions(+), 194 deletions(-)
>   create mode 100644 controller/mac-learn.c
>   create mode 100644 controller/mac-learn.h
>
Numan Siddique Feb. 20, 2021, 9:04 a.m. UTC | #2
On Fri, Feb 19, 2021 at 7:11 AM Mark Michelson <mmichels@redhat.com> wrote:
>
> Aside from the comments on patch 1,
>
> Acked-by: Mark Michelson <mmichels@redhat.com>

Thanks Mark for the review for the whole series.

I address your comment in patch 1 by removing the 'if' condition. I've kept
the coverage counter.

I applied this patch series to master.

Numan

>
>
> On 2/5/21 1:56 AM, numans@ovn.org wrote:
> > From: Numan Siddique <numans@ovn.org>
> >
> > This series adds the support to learn the macs seen on logical port
> > VIF's whose port security is disabled and 'unknown' address set.
> >
> > A new table - FDB is added in Southboud database to store the
> > port-to-mac mappings.
> >
> > The first patch is a small refactor and moves the mac_binding related
> > code from pinctrl.c to a separate file - mac-learn.c. pinctrl.c still
> > writes the learnt mac_bindings to the MAC_Binding table.
> >
> > The remaining patches actually adds the mac learning support.
> >
> > The main usecase of this patch series is to stop flooding of the packet
> > to all the logical ports which accept unknown destinations once the
> > mac is learnt from such ports.  This patch excludes learning the macs
> > from the localnet ports as this could cause lot of FDB entries since
> > such ports can receive the broad cast traffic fron the physical network.
> >
> > Numan Siddique (6):
> >    controller: Split mac learning code to a separate file.
> >    MAC learning: Add a new FDB table in southbound db.
> >    MAC learning: Add new actions - put_fdb, get_fdb and lookup_fdb.
> >    controller: MAC learning: Add OF rules for the FDB entries.
> >    northd: MAC learning: Add logical flows for fdb.
> >    northd: Cleanup stale FDB entries.
> >
> >   controller/automake.mk       |   5 +-
> >   controller/lflow.c           | 110 +++++++
> >   controller/lflow.h           |  13 +-
> >   controller/mac-learn.c       | 180 +++++++++++
> >   controller/mac-learn.h       |  66 ++++
> >   controller/ovn-controller.c  |  32 +-
> >   controller/pinctrl.c         | 220 +++++++++-----
> >   controller/pinctrl.h         |   1 +
> >   include/ovn/actions.h        |  33 ++
> >   include/ovn/logical-fields.h |   4 +
> >   lib/actions.c                | 176 +++++++++++
> >   lib/ovn-util.c               |  20 +-
> >   lib/ovn-util.h               |   4 +
> >   northd/ovn-northd.8.xml      | 162 ++++++++--
> >   northd/ovn-northd.c          | 136 +++++++--
> >   ovn-sb.ovsschema             |  19 +-
> >   ovn-sb.xml                   |  86 ++++++
> >   tests/ovn-northd.at          |  92 +++++-
> >   tests/ovn.at                 | 575 ++++++++++++++++++++++++++++++++---
> >   tests/test-ovn.c             |   2 +
> >   utilities/ovn-trace.c        | 145 ++++++++-
> >   21 files changed, 1887 insertions(+), 194 deletions(-)
> >   create mode 100644 controller/mac-learn.c
> >   create mode 100644 controller/mac-learn.h
> >
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Numan Siddique Feb. 20, 2021, 9:05 a.m. UTC | #3
On Sat, Feb 20, 2021 at 2:34 PM Numan Siddique <numans@ovn.org> wrote:
>
> On Fri, Feb 19, 2021 at 7:11 AM Mark Michelson <mmichels@redhat.com> wrote:
> >
> > Aside from the comments on patch 1,
> >
> > Acked-by: Mark Michelson <mmichels@redhat.com>
>
> Thanks Mark for the review for the whole series.
>
> I address your comment in patch 1 by removing the 'if' condition. I've kept
> the coverage counter.
>
> I applied this patch series to master.

And I'll plan to work on adding unit tests to the mac-learn.c file.

Numan

>
> Numan
>
> >
> >
> > On 2/5/21 1:56 AM, numans@ovn.org wrote:
> > > From: Numan Siddique <numans@ovn.org>
> > >
> > > This series adds the support to learn the macs seen on logical port
> > > VIF's whose port security is disabled and 'unknown' address set.
> > >
> > > A new table - FDB is added in Southboud database to store the
> > > port-to-mac mappings.
> > >
> > > The first patch is a small refactor and moves the mac_binding related
> > > code from pinctrl.c to a separate file - mac-learn.c. pinctrl.c still
> > > writes the learnt mac_bindings to the MAC_Binding table.
> > >
> > > The remaining patches actually adds the mac learning support.
> > >
> > > The main usecase of this patch series is to stop flooding of the packet
> > > to all the logical ports which accept unknown destinations once the
> > > mac is learnt from such ports.  This patch excludes learning the macs
> > > from the localnet ports as this could cause lot of FDB entries since
> > > such ports can receive the broad cast traffic fron the physical network.
> > >
> > > Numan Siddique (6):
> > >    controller: Split mac learning code to a separate file.
> > >    MAC learning: Add a new FDB table in southbound db.
> > >    MAC learning: Add new actions - put_fdb, get_fdb and lookup_fdb.
> > >    controller: MAC learning: Add OF rules for the FDB entries.
> > >    northd: MAC learning: Add logical flows for fdb.
> > >    northd: Cleanup stale FDB entries.
> > >
> > >   controller/automake.mk       |   5 +-
> > >   controller/lflow.c           | 110 +++++++
> > >   controller/lflow.h           |  13 +-
> > >   controller/mac-learn.c       | 180 +++++++++++
> > >   controller/mac-learn.h       |  66 ++++
> > >   controller/ovn-controller.c  |  32 +-
> > >   controller/pinctrl.c         | 220 +++++++++-----
> > >   controller/pinctrl.h         |   1 +
> > >   include/ovn/actions.h        |  33 ++
> > >   include/ovn/logical-fields.h |   4 +
> > >   lib/actions.c                | 176 +++++++++++
> > >   lib/ovn-util.c               |  20 +-
> > >   lib/ovn-util.h               |   4 +
> > >   northd/ovn-northd.8.xml      | 162 ++++++++--
> > >   northd/ovn-northd.c          | 136 +++++++--
> > >   ovn-sb.ovsschema             |  19 +-
> > >   ovn-sb.xml                   |  86 ++++++
> > >   tests/ovn-northd.at          |  92 +++++-
> > >   tests/ovn.at                 | 575 ++++++++++++++++++++++++++++++++---
> > >   tests/test-ovn.c             |   2 +
> > >   utilities/ovn-trace.c        | 145 ++++++++-
> > >   21 files changed, 1887 insertions(+), 194 deletions(-)
> > >   create mode 100644 controller/mac-learn.c
> > >   create mode 100644 controller/mac-learn.h
> > >
> >
> > _______________________________________________
> > dev mailing list
> > dev@openvswitch.org
> > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
> >