[ovs-dev] [PATCH] Fix ovn-controller crash when a lport of type 'virtual' is deleted.

Mark Michelson mmichels at redhat.com
Wed Aug 26 12:57:54 UTC 2020


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

Is this bug severe enough that a 20.06.3 release is necessary?

On 8/26/20 7:41 AM, numans at ovn.org wrote:
> From: Numan Siddique <numans at ovn.org>
> 
> The below bt is seen when a lport of type 'virtual' is deleted.
> 
> (gdb) bt
> 0x00001470c0708655 in __strlen_avx2 () from /lib64/libc.so.6
> 0x0000563340037449 in hash_string (basis=0, s=s at entry=0x0) at lib/hash.h:342
> hash_name (name=name at entry=0x0) at lib/shash.c:28
> 0x0000563340037a76 in shash_find (sh=0x5633407bb260, name=0x0) at lib/shash.c:231
> 0x0000563340037b7d in shash_find_data (sh=<optimized out>, name=<optimized out>) at lib/shash.c:245
> 0x000056333ff71151 in local_binding_find (name=<optimized out>, local_bindings=<optimized out>) at controller/binding.h:108
> get_lbinding_for_lport (b_ctx_out=0x7fff616745b0, lport_type=<optimized out>, pb=0x56334314d630) at controller/binding.c:1960
> handle_deleted_vif_lport (b_ctx_in=0x7fff61674600, b_ctx_in=0x7fff61674600, b_ctx_out=0x7fff616745b0, lport_type=<optimized out>, pb=0x56334314d630) at controller/binding.c:1979
> binding_handle_port_binding_changes (b_ctx_in=b_ctx_in at entry=0x7fff61674600, b_ctx_out=b_ctx_out at entry=0x7fff616745b0) at controller/binding.c:2087
> 0x000056333ff8e208 in runtime_data_sb_port_binding_handler (node=0x7fff616759f0, data=0x5633407bb240) at controller/ovn-controller.c:1325
> 0x000056333ffa6de3 in engine_compute (recompute_allowed=<optimized out>, node=<optimized out>) at lib/inc-proc-eng.c:306
> ...
> ...
> 
> Fixes: 354bdba51ab("ovn-controller: I-P for SB port binding and OVS interface in runtime_data.")
> Signed-off-by: Numan Siddique <numans at ovn.org>
> ---
>   controller/binding.c | 12 ++++++++----
>   tests/ovn.at         | 11 +++++++++++
>   2 files changed, 19 insertions(+), 4 deletions(-)
> 
> diff --git a/controller/binding.c b/controller/binding.c
> index 880fbb13b..3c102dc7f 100644
> --- a/controller/binding.c
> +++ b/controller/binding.c
> @@ -1957,11 +1957,15 @@ get_lbinding_for_lport(const struct sbrec_port_binding *pb,
>       struct local_binding *parent_lbinding = NULL;
>   
>       if (lport_type == LP_VIRTUAL) {
> -        parent_lbinding = local_binding_find(b_ctx_out->local_bindings,
> -                                             pb->virtual_parent);
> +        if (pb->virtual_parent) {
> +            parent_lbinding = local_binding_find(b_ctx_out->local_bindings,
> +                                                 pb->virtual_parent);
> +        }
>       } else {
> -        parent_lbinding = local_binding_find(b_ctx_out->local_bindings,
> -                                             pb->parent_port);
> +        if (pb->parent_port) {
> +            parent_lbinding = local_binding_find(b_ctx_out->local_bindings,
> +                                                 pb->parent_port);
> +        }
>       }
>   
>       return parent_lbinding
> diff --git a/tests/ovn.at b/tests/ovn.at
> index 8aabdf307..c4edbd9e1 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -16125,6 +16125,17 @@ ovn-nbctl lsp-set-addresses sw1-lr0 00:00:00:00:ff:02
>   ovn-nbctl lsp-set-options sw1-lr0 router-port=lr0-sw1
>   
>   OVN_POPULATE_ARP
> +
> +# Delete sw0-vir and add again.
> +ovn-nbctl lsp-del sw0-vir
> +
> +ovn-nbctl lsp-add sw0 sw0-vir
> +ovn-nbctl lsp-set-addresses sw0-vir "50:54:00:00:00:10 10.0.0.10"
> +ovn-nbctl lsp-set-port-security sw0-vir "50:54:00:00:00:10 10.0.0.10"
> +ovn-nbctl lsp-set-type sw0-vir virtual
> +ovn-nbctl set logical_switch_port sw0-vir options:virtual-ip=10.0.0.10
> +ovn-nbctl set logical_switch_port sw0-vir options:virtual-parents=sw0-p1,sw0-p2,sw0-p3
> +
>   ovn-nbctl --wait=hv sync
>   
>   # Check that logical flows are added for sw0-vir in lsp_in_arp_rsp pipeline
> 



More information about the dev mailing list