From 1236d71a50e8797032c918c901223a9e54091b0a Mon Sep 17 00:00:00 2001 From: Numan Siddique Date: Sep 01 2020 15:40:53 +0000 Subject: Backport "Fix ovn-controller crash when a lport of type 'virtual' is deleted." Resolves: #1872681 Signed-off-by: Numan Siddique --- diff --git a/0001-Fix-ovn-controller-crash-when-a-lport-of-type-virtua.patch b/0001-Fix-ovn-controller-crash-when-a-lport-of-type-virtua.patch new file mode 100644 index 0000000..d73b70f --- /dev/null +++ b/0001-Fix-ovn-controller-crash-when-a-lport-of-type-virtua.patch @@ -0,0 +1,86 @@ +From e1cd90a8ac7ede76dabc3714358c32076f9557e7 Mon Sep 17 00:00:00 2001 +From: Numan Siddique +Date: Wed, 26 Aug 2020 16:48:26 +0530 +Subject: [PATCH] Fix ovn-controller crash when a lport of type 'virtual' is + deleted. + +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@entry=0x0) at lib/hash.h:342 +hash_name (name=name@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=, name=) at lib/shash.c:245 +0x000056333ff71151 in local_binding_find (name=, local_bindings=) at controller/binding.h:108 +get_lbinding_for_lport (b_ctx_out=0x7fff616745b0, lport_type=, 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=, pb=0x56334314d630) at controller/binding.c:1979 +binding_handle_port_binding_changes (b_ctx_in=b_ctx_in@entry=0x7fff61674600, b_ctx_out=b_ctx_out@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=, node=) at lib/inc-proc-eng.c:306 +... +... + +Fixes: 354bdba51ab("ovn-controller: I-P for SB port binding and OVS interface in runtime_data.") +Acked-by: Mark Michelson +Signed-off-by: Numan Siddique + +(cherry-picked from master commit 51fea73f0e09a1e670b8b7ca52819963bfa29c7e) + +(cherry-picked from upstream branch-20.06 commit edc8b8ffdfd4d0250ea8650b1501e49fb4a82b6f) + +Change-Id: I926ee596800a5cc105e481845bd328acda578dd2 +--- + 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 0d99adf3f..1216bc50f 100644 +--- a/tests/ovn.at ++++ b/tests/ovn.at +@@ -16115,6 +16115,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 +-- +2.26.2 + diff --git a/ovn.spec b/ovn.spec index 0cf0453..7ad1298 100644 --- a/ovn.spec +++ b/ovn.spec @@ -43,7 +43,7 @@ Name: ovn Summary: Open Virtual Network support URL: http://www.openvswitch.org/ Version: 20.06.2 -Release: 1%{?commit0:.%{date}git%{shortcommit0}}%{?dist} +Release: 2%{?commit0:.%{date}git%{shortcommit0}}%{?dist} Obsoletes: openvswitch-ovn-common < %{?epoch_ovs:%{epoch_ovs}:}2.11.0-8 Provides: openvswitch-ovn-common = %{?epoch:%{epoch}:}%{version}-%{release} @@ -115,6 +115,10 @@ Patch18: 0018-ovn-northd-Don-t-send-the-pkt-to-conntrack-for-NAT-i.patch # Bug 1829109 Patch19: 0020-Add-northd-and-ovn-controller-cluster-status-reset-c.patch Patch20: 0021-Fix-compilation-error-when-configured-with-enable-sp.patch +Patch21: 0022-Avoid-nb_cfg-update-notification-flooding.patch + +# Bug 1872681 +Patch30: 0001-Fix-ovn-controller-crash-when-a-lport-of-type-virtua.patch # OpenvSwitch backports (400-) if required. # Address crpto policy for fedora @@ -481,6 +485,13 @@ fi %{_unitdir}/ovn-controller-vtep.service %changelog +* Tue Sep 01 2020 Numan Siddique - 20.06.2-2 +- Backport "Fix ovn-controller crash when a lport of type 'virtual' is deleted." (#1872681) + +* Mon Aug 24 2020 Numan Siddique - 20.06.2-1 +- Sync the OVN sources with the upstream v20.06.2 release and reorder + the other patches. + * Wed Jul 29 2020 Numan Siddique - 20.06.1-6 - Backport "ovn-controller: Release lport if the ofport of the VIF is -1.". (#1861298) - Backport "ovn-controller: Fix the missing flows when logical router port is added after its peer." (#1860053)