mbox series

[ovs-dev,v7,0/6] Correct tunnel ids exhaustion scenario.

Message ID 20240426175501.858655-1-ihrachys@redhat.com
Headers show
Series Correct tunnel ids exhaustion scenario. | expand

Message

Ihar Hrachyshka April 26, 2024, 5:54 p.m. UTC
v2+ of the original test patch exposed a ubsan failure in port tunnel id
allocation code when tunnel id space is exhausted.

This series fixes the ubsan failure (patches 1-2); then adjusts the
invalid scenario to trigger the originally intended failure mode - id
space exhausted (patch 3). Finally, it includes a number of smaller
cleanup patches in the area that simplify the allocation code somewhat.
(patches 4-6)

I attempted to make each patch as simple as possible, to simplify
review. If you think it's too granular, let me know and I can squash
some.

v1: initial version.
v2: cover both cases of hint = 0 and hint > max.
v3: reduce the number of ports to create in the hint > max scenario needed to trigger the problem.
v4: remove spurious lib/ovn-util.c change.
v5: ubsan fixes included.
v6: modify patch 5 to honor previously allocated tunnel ids.
    always detach op->list in build_ports (and never elsewhere.)
v7: simplify pb cleanup logic in ls_port_init.

Ihar Hrachyshka (6):
  northd: Don't cleanup op in ovn_port_allocate_key.
  northd: Don't detach op->list when it wasn't used.
  tests: Correct tunnel ids exhaustion scenario.
  northd: Don't create pb in ls_port_init too early.
  northd: Remove unused `sb` arg in ls_port_create.
  northd: Remove unused nbrp arg in ls_port_reinit.

 northd/northd.c     | 58 ++++++++++++++++++++++++++-------------------
 tests/ovn-northd.at | 43 ++++++++++++++++++++++++++++++---
 2 files changed, 73 insertions(+), 28 deletions(-)

Comments

Mark Michelson April 26, 2024, 7:04 p.m. UTC | #1
Thanks for the update, Ihar.

For the series,
Acked-by: Mark Michelson <mmichels@redhat.com>

On 4/26/24 13:54, Ihar Hrachyshka wrote:
> v2+ of the original test patch exposed a ubsan failure in port tunnel id
> allocation code when tunnel id space is exhausted.
> 
> This series fixes the ubsan failure (patches 1-2); then adjusts the
> invalid scenario to trigger the originally intended failure mode - id
> space exhausted (patch 3). Finally, it includes a number of smaller
> cleanup patches in the area that simplify the allocation code somewhat.
> (patches 4-6)
> 
> I attempted to make each patch as simple as possible, to simplify
> review. If you think it's too granular, let me know and I can squash
> some.
> 
> v1: initial version.
> v2: cover both cases of hint = 0 and hint > max.
> v3: reduce the number of ports to create in the hint > max scenario needed to trigger the problem.
> v4: remove spurious lib/ovn-util.c change.
> v5: ubsan fixes included.
> v6: modify patch 5 to honor previously allocated tunnel ids.
>      always detach op->list in build_ports (and never elsewhere.)
> v7: simplify pb cleanup logic in ls_port_init.
> 
> Ihar Hrachyshka (6):
>    northd: Don't cleanup op in ovn_port_allocate_key.
>    northd: Don't detach op->list when it wasn't used.
>    tests: Correct tunnel ids exhaustion scenario.
>    northd: Don't create pb in ls_port_init too early.
>    northd: Remove unused `sb` arg in ls_port_create.
>    northd: Remove unused nbrp arg in ls_port_reinit.
> 
>   northd/northd.c     | 58 ++++++++++++++++++++++++++-------------------
>   tests/ovn-northd.at | 43 ++++++++++++++++++++++++++++++---
>   2 files changed, 73 insertions(+), 28 deletions(-)
>
Numan Siddique April 30, 2024, 8:56 p.m. UTC | #2
On Fri, Apr 26, 2024 at 3:04 PM Mark Michelson <mmichels@redhat.com> wrote:
>
> Thanks for the update, Ihar.
>
> For the series,
> Acked-by: Mark Michelson <mmichels@redhat.com>

Thanks Ihar, Vladislav and Mark.  I applied the series to the main branch.

Numan

>
> On 4/26/24 13:54, Ihar Hrachyshka wrote:
> > v2+ of the original test patch exposed a ubsan failure in port tunnel id
> > allocation code when tunnel id space is exhausted.
> >
> > This series fixes the ubsan failure (patches 1-2); then adjusts the
> > invalid scenario to trigger the originally intended failure mode - id
> > space exhausted (patch 3). Finally, it includes a number of smaller
> > cleanup patches in the area that simplify the allocation code somewhat.
> > (patches 4-6)
> >
> > I attempted to make each patch as simple as possible, to simplify
> > review. If you think it's too granular, let me know and I can squash
> > some.
> >
> > v1: initial version.
> > v2: cover both cases of hint = 0 and hint > max.
> > v3: reduce the number of ports to create in the hint > max scenario needed to trigger the problem.
> > v4: remove spurious lib/ovn-util.c change.
> > v5: ubsan fixes included.
> > v6: modify patch 5 to honor previously allocated tunnel ids.
> >      always detach op->list in build_ports (and never elsewhere.)
> > v7: simplify pb cleanup logic in ls_port_init.
> >
> > Ihar Hrachyshka (6):
> >    northd: Don't cleanup op in ovn_port_allocate_key.
> >    northd: Don't detach op->list when it wasn't used.
> >    tests: Correct tunnel ids exhaustion scenario.
> >    northd: Don't create pb in ls_port_init too early.
> >    northd: Remove unused `sb` arg in ls_port_create.
> >    northd: Remove unused nbrp arg in ls_port_reinit.
> >
> >   northd/northd.c     | 58 ++++++++++++++++++++++++++-------------------
> >   tests/ovn-northd.at | 43 ++++++++++++++++++++++++++++++---
> >   2 files changed, 73 insertions(+), 28 deletions(-)
> >
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>