From patchwork Tue Jul 18 09:53:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1809135 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QvzQFgC/; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R4vRL5Zjnz20Cs for ; Tue, 18 Jul 2023 19:53:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 2DAA2416A2; Tue, 18 Jul 2023 09:53:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2DAA2416A2 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QvzQFgC/ X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e5_4PM2Gg6zz; Tue, 18 Jul 2023 09:53:45 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 85D9E41699; Tue, 18 Jul 2023 09:53:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 85D9E41699 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DBBC1C0DE4; Tue, 18 Jul 2023 09:53:39 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 64A4FC0DD8 for ; Tue, 18 Jul 2023 09:53:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 3B26440C09 for ; Tue, 18 Jul 2023 09:53:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3B26440C09 Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QvzQFgC/ X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rQSc5Pka0eWY for ; Tue, 18 Jul 2023 09:53:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 71FEA400B9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 71FEA400B9 for ; Tue, 18 Jul 2023 09:53:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689674016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l7oTrMFqeGI4HiRt8l1iFPcPWPHCGhTKzTN1h0DsITo=; b=QvzQFgC/FBAV8nQhDW5Sam9ttZjDSS4Hh8hVBTSFBMY53WquTilYuuZ6/Ub6tLJqCfGE21 Iwc78aEItYIVFlXkxcDOI/tFY3HD54wKk5nSf+RrGBMEdYmxe5lRvEjv6G5xQvj2njqvHI Jwa8drWAZVLzRy8+wta0zCeiECnpOWk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-6dpxuI4UMj2Sd23PhMPGrA-1; Tue, 18 Jul 2023 05:53:32 -0400 X-MC-Unique: 6dpxuI4UMj2Sd23PhMPGrA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 09C7B8D1689 for ; Tue, 18 Jul 2023 09:53:32 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.ntdv.lab.eng.bos.redhat.com [10.19.188.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id E612F1454142; Tue, 18 Jul 2023 09:53:31 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Tue, 18 Jul 2023 11:53:29 +0200 Message-Id: <20230718095331.2443200-2-xsimonar@redhat.com> In-Reply-To: <20230718095331.2443200-1-xsimonar@redhat.com> References: <20230718095331.2443200-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 1/3] tests: run system tests also with monitor-all=true X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Before this patch, each system test was supposed to run four times: - with and without northd-parallelization - with and without monitor-all However, while the titles of the test were updated, system tests were never run with monitor-all=true (i.e. they were run twice w/o monitor-all). This is now fixed, and the four flavors of the tssts are run. Signed-off-by: Xavier Simonart Acked-by: Ales Musil --- tests/system-dpdk-macros.at | 4 ++++ tests/system-kmod-macros.at | 3 +++ tests/system-userspace-macros.at | 3 +++ 3 files changed, 10 insertions(+) diff --git a/tests/system-dpdk-macros.at b/tests/system-dpdk-macros.at index 8843baa25..440908af7 100644 --- a/tests/system-dpdk-macros.at +++ b/tests/system-dpdk-macros.at @@ -47,6 +47,10 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START], dnl Add bridges, ports, etc. OVS_WAIT_WHILE([ip link show br0]) AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2]) + + if test OVN_MONITOR_ALL = yes; then + ovs-vsctl set open . external_ids:ovn-monitor-all=true + fi ]) # OVS_TRAFFIC_VSWITCHD_STOP([WHITELIST], [extra_cmds]) diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at index 787a59c97..6f6670199 100644 --- a/tests/system-kmod-macros.at +++ b/tests/system-kmod-macros.at @@ -27,6 +27,9 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START], _OVS_VSWITCHD_START([]) dnl Add bridges, ports, etc. AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2]) + if test OVN_MONITOR_ALL = yes; then + ovs-vsctl set open . external_ids:ovn-monitor-all=true + fi ]) # OVS_TRAFFIC_VSWITCHD_STOP([WHITELIST], [extra_cmds]) diff --git a/tests/system-userspace-macros.at b/tests/system-userspace-macros.at index 86ed22622..73ca2cce3 100644 --- a/tests/system-userspace-macros.at +++ b/tests/system-userspace-macros.at @@ -19,6 +19,9 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START], dnl Add bridges, ports, etc. OVS_WAIT_WHILE([ip link show br0]) AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| uuidfilt])], [0], [$2]) + if test OVN_MONITOR_ALL = yes; then + ovs-vsctl set open . external_ids:ovn-monitor-all=true + fi ]) # OVS_TRAFFIC_VSWITCHD_STOP([WHITELIST], [extra_cmds]) From patchwork Tue Jul 18 09:53:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1809134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gc5vrDMm; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R4vRH5qTQz20Cs for ; Tue, 18 Jul 2023 19:53:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9BA0C416BE; Tue, 18 Jul 2023 09:53:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9BA0C416BE Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gc5vrDMm X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uz9lIECMKaJn; Tue, 18 Jul 2023 09:53:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id ACE154169E; Tue, 18 Jul 2023 09:53:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org ACE154169E Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D5796C0071; Tue, 18 Jul 2023 09:53:38 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 542D4C0032 for ; Tue, 18 Jul 2023 09:53:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 2A71A402D7 for ; Tue, 18 Jul 2023 09:53:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2A71A402D7 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XwgLGUChM6pO for ; Tue, 18 Jul 2023 09:53:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3F3C1402E1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 3F3C1402E1 for ; Tue, 18 Jul 2023 09:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689674013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C/dGm4TtE577ecGkdf4gDJ/fDCyHc9gEfW6Co5AkoMo=; b=gc5vrDMmzyOk09r+hQnUZYpk7vEA3srGpOAZq7tcyGCkIsNQs1skdoCgHeyX8TgUZu6ngH d2NIw6CKeqbxiYxke6HCGIhEZ9wTkqCHbSxsspba/hDz67OdIeytaJKP6GEEQE1vnkdFOd fZM9SDnSIOvAKIC0tPX6LIf4Ep3jM+Q= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-mWtJ6i7hPueO8BxARyrOHg-1; Tue, 18 Jul 2023 05:53:32 -0400 X-MC-Unique: mWtJ6i7hPueO8BxARyrOHg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 29B7989F700 for ; Tue, 18 Jul 2023 09:53:32 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.ntdv.lab.eng.bos.redhat.com [10.19.188.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 118FE1454142; Tue, 18 Jul 2023 09:53:32 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Tue, 18 Jul 2023 11:53:30 +0200 Message-Id: <20230718095331.2443200-3-xsimonar@redhat.com> In-Reply-To: <20230718095331.2443200-1-xsimonar@redhat.com> References: <20230718095331.2443200-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 2/3] ovn-controller: avoid monitoring wrong chassis X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" To register a chassis to ovn-sb, ovn-controller create a "name-uuid" for the chassis, which it will send to ovn-sb. In return, ovn-sb creates the uuid based on that "name". Using this "name-uuid" as a uuid in a monitor request to ovn-sb results in monitoring a non-existing chassis. The system returns on track as soon as ovn-controller receives the chassis update from ovn-sb, as it will then send a new monitor request to ovn-sb, with the proper chassis uuid. However, if some ports were already in ovn-sb when it receives the monitor request with the wrong uuid, ovn-sb will notify ovn-controller to delete all those ports. This cause the following sequence in ovn-controller - notification of a new port - deletion of that port - notification of a new port We now prevent sending wrong uuid to ovn-sb. This issue was causing test "testing load-balancer template IPv6" to fail in a flaky way, due to the following warning: if_status|WARN|Trying to release unknown interface vm2 Signed-off-by: Xavier Simonart Acked-by: Ales Musil --- controller/chassis.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controller/chassis.c b/controller/chassis.c index ce88541ba..d3c944973 100644 --- a/controller/chassis.c +++ b/controller/chassis.c @@ -831,7 +831,11 @@ chassis_run(struct ovsdb_idl_txn *ovnsb_idl_txn, } ovs_chassis_cfg_destroy(&ovs_cfg); - return chassis_rec; + if (existed) { + return chassis_rec; + } else { + return NULL; + } } bool From patchwork Tue Jul 18 09:53:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1809133 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gWZKzntL; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R4vRG2Qqlz20Cs for ; Tue, 18 Jul 2023 19:53:46 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 7350D40C2D; Tue, 18 Jul 2023 09:53:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 7350D40C2D Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gWZKzntL X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1-0MTCMYK4_A; Tue, 18 Jul 2023 09:53:41 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 5DD4B40C16; Tue, 18 Jul 2023 09:53:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5DD4B40C16 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 319D0C0DD6; Tue, 18 Jul 2023 09:53:38 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 57953C0032 for ; Tue, 18 Jul 2023 09:53:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 25E7580F26 for ; Tue, 18 Jul 2023 09:53:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 25E7580F26 Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gWZKzntL X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GggxvdNvR5ij for ; Tue, 18 Jul 2023 09:53:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org ED3FC80E6E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id ED3FC80E6E for ; Tue, 18 Jul 2023 09:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689674013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t1n0KQZxEDSx8o1hoTzk4v6iqeSk0pG1zWZKp+gshAE=; b=gWZKzntLBW9C1kcnfQigJVpmHXhV2BUUQHNbXXOaRdLhRHNqzGqnBEUynu7x2948KZj2AV Us/rL9pJf5vzNpYyIgsa04zPqz7I6WEx2/63ARBgGCUH0nCufhv0XwRlz06bQ9R5ZIX54g pyaVU9GiobCmNL9GFOnbWRDO/e6tN5Y= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-TjYRbTD1PbuJ0MMIRUP06g-1; Tue, 18 Jul 2023 05:53:32 -0400 X-MC-Unique: TjYRbTD1PbuJ0MMIRUP06g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 490DF29AA388 for ; Tue, 18 Jul 2023 09:53:32 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.ntdv.lab.eng.bos.redhat.com [10.19.188.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 315331454142; Tue, 18 Jul 2023 09:53:32 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Tue, 18 Jul 2023 11:53:31 +0200 Message-Id: <20230718095331.2443200-4-xsimonar@redhat.com> In-Reply-To: <20230718095331.2443200-1-xsimonar@redhat.com> References: <20230718095331.2443200-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 3/3] ovn-controller: remove un-necessary "trying to release" warnings X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" When a port is added and deleted in the same loop by ovn-controller this was causing the following warning if_status|WARN|Trying to release unknown interface We now avoid the warning in that ascenario. Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2222252 Signed-off-by: Xavier Simonart Acked-by: Ales Musil --- controller/binding.c | 12 ++++++++++-- controller/if-status.c | 12 ++++++++++++ controller/if-status.h | 2 ++ tests/ofproto-macros.at | 4 ++-- tests/ovn.at | 27 +++++++++++++++++++++++++++ 5 files changed, 53 insertions(+), 4 deletions(-) diff --git a/controller/binding.c b/controller/binding.c index f619aba2e..bc7adb048 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -2682,7 +2682,13 @@ handle_deleted_lport(const struct sbrec_port_binding *pb, if (ld) { remove_pb_from_local_datapath(pb, b_ctx_out, ld); - if_status_mgr_release_iface(b_ctx_out->if_mgr, pb->logical_port); + /* Only try to release the port if it was ever claimed. + * If a port was added and deleted within the same ovn-controller loop, + * it is seen as never claimed. + */ + if (if_status_is_port_claimed(b_ctx_out->if_mgr, pb->logical_port)) { + if_status_mgr_release_iface(b_ctx_out->if_mgr, pb->logical_port); + } return; } @@ -2706,7 +2712,9 @@ handle_deleted_lport(const struct sbrec_port_binding *pb, remove_pb_from_local_datapath(pb, b_ctx_out, ld); } - if_status_mgr_release_iface(b_ctx_out->if_mgr, pb->logical_port); + if (if_status_is_port_claimed(b_ctx_out->if_mgr, pb->logical_port)) { + if_status_mgr_release_iface(b_ctx_out->if_mgr, pb->logical_port); + } } } diff --git a/controller/if-status.c b/controller/if-status.c index b45208746..faf4e1f67 100644 --- a/controller/if-status.c +++ b/controller/if-status.c @@ -820,3 +820,15 @@ if_status_mgr_get_memory_usage(struct if_status_mgr *mgr, simap_increase(usage, "if_status_mgr_ifaces_state_usage-KB", ROUND_UP(ifaces_state_usage, 1024) / 1024); } + +bool +if_status_is_port_claimed(const struct if_status_mgr *mgr, + const char *iface_id) +{ + struct ovs_iface *iface = shash_find_data(&mgr->ifaces, iface_id); + if (!iface || (iface->state > OIF_INSTALLED)) { + return false; + } else { + return true; + } +} diff --git a/controller/if-status.h b/controller/if-status.h index 15624bcfa..9714f6d8d 100644 --- a/controller/if-status.h +++ b/controller/if-status.h @@ -62,5 +62,7 @@ uint16_t if_status_mgr_iface_get_mtu(const struct if_status_mgr *mgr, const char *iface_id); bool if_status_mgr_iface_update(const struct if_status_mgr *mgr, const struct ovsrec_interface *iface_rec); +bool if_status_is_port_claimed(const struct if_status_mgr *mgr, + const char *iface_id); # endif /* controller/if-status.h */ diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at index b0101330f..07ef1d092 100644 --- a/tests/ofproto-macros.at +++ b/tests/ofproto-macros.at @@ -250,11 +250,11 @@ m4_define([OVS_VSWITCHD_START], # check_logs scans through all *.log files (except '*.log' and '*testsuite.log') # and reports all WARN, ERR, EMER log entries. User can add custom sed filters -# in $1. +# in $1 and select folder with $2. m4_divert_push([PREPARE_TESTS]) check_logs () { local logs - for log in *.log; do + for log in ./$2/*.log; do case ${log} in # ( '*.log'|*testsuite.log) ;; # ( *) logs="${logs} ${log}" ;; diff --git a/tests/ovn.at b/tests/ovn.at index f2148faac..f57e0f263 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -36568,3 +36568,30 @@ OVS_WAIT_UNTIL([test $(as hv-1 ovs-vsctl list qos | grep -c linux-htb) -eq 1]) AT_CLEANUP ]) + +OVN_FOR_EACH_NORTHD([ +AT_SETUP([Add and delete port]) +ovn_start + +net_add n1 + +sim_add hv1 +as hv1 +check ovs-vsctl add-br br-phys +ovn_attach n1 br-phys 192.168.0.11 + +check ovn-nbctl ls-add ls0 +check ovn-nbctl --wait=hv lsp-add ls0 lsp1 +as hv1 check ovs-vsctl -- add-port br-int lsp1 -- \ + set Interface lsp1 external-ids:iface-id=lsp1 + +wait_for_ports_up +sleep_controller hv1 +check ovn-nbctl --wait=sb lsp-add ls0 lsp0 +check ovn-nbctl --wait=sb lsp-del lsp0 +wake_up_controller hv1 +AT_CHECK([check_logs [""] hv1]) +OVN_CLEANUP([hv1]) + +AT_CLEANUP +])