From patchwork Fri Apr 19 14:57:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1925579 X-Patchwork-Delegate: dceara@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=dTLzEVRL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VLd6l2Q5bz1yPJ for ; Sat, 20 Apr 2024 00:57:51 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 27ED26087D; Fri, 19 Apr 2024 14:57:49 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id eGcIPhWqZIHD; Fri, 19 Apr 2024 14:57:47 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 93EF860805 Authentication-Results: smtp3.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=dTLzEVRL Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 93EF860805; Fri, 19 Apr 2024 14:57:47 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6DCE4C0077; Fri, 19 Apr 2024 14:57:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4AAF1C0037 for ; Fri, 19 Apr 2024 14:57:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 35A2C6087D for ; Fri, 19 Apr 2024 14:57:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 74gituza9pPC for ; Fri, 19 Apr 2024 14:57:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=amusil@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 30D9860805 Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 30D9860805 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 30D9860805 for ; Fri, 19 Apr 2024 14:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713538663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u3q9hHX6cp7Afpdg2xUD15Z/ruEHI3hA3BxVCdkk3DU=; b=dTLzEVRLY+8fs23nuJPOqNmT5cEcRDnUwOLEQGlPcnc/VleCtYBu0rlWs0lcsN81Zrr85E P04HNFTc1AzlLSm2UeZ3BoKR+0BBS83TaSRzgIInJCCoQFFaHg2RqydV5zsT64ghcfdcyP /thKb7YETE07c8npJCO9EkdrK6l6kv0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-523-xVdmW55xO8uB0_kaIGscwg-1; Fri, 19 Apr 2024 10:57:42 -0400 X-MC-Unique: xVdmW55xO8uB0_kaIGscwg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E1C3A286A9DD for ; Fri, 19 Apr 2024 14:57:41 +0000 (UTC) Received: from amusil.redhat.com (unknown [10.45.224.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BC09581D0; Fri, 19 Apr 2024 14:57:40 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Fri, 19 Apr 2024 16:57:40 +0200 Message-ID: <20240419145740.1338793-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] northd: Do not incrementally proccess changes for disabled LR. 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 the logical router is disabled it is not populated in the datapaths and is not internally available to I-P engine in the hmap. This could lead to a crash during I-P processing: To fix that make sure we process incrementally only LR that are enabled. Reported-at: https://issues.redhat.com/browse/FDP-571 Signed-off-by: Ales Musil --- northd/northd.c | 5 +++++ tests/ovn-northd.at | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/northd/northd.c b/northd/northd.c index 37f443e70..b834f1274 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -4689,6 +4689,11 @@ fail: static bool lr_changes_can_be_handled(const struct nbrec_logical_router *lr) { + /* We can't do I-P processing when the router is disabled. */ + if (!lrouter_is_enabled(lr)) { + return false; + } + /* Check if the columns are changed in this row. */ enum nbrec_logical_router_column_id col; for (col = 0; col < NBREC_LOGICAL_ROUTER_N_COLUMNS; col++) { diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index be006fb32..4f59a64db 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -11452,6 +11452,13 @@ check_engine_stats lflow recompute nocompute check_engine_stats sync_to_sb_lb recompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE +check ovn-nbctl --wait=sb lr-add lr2 -- set logical_router lr2 enabled=false +check as northd ovn-appctl -t ovn-northd inc-engine/clear-stats +check ovn-nbctl --wait=sb lb-add lb4 10.0.0.40:4040 10.0.40.40:4050 \ + -- lr-lb-add lr2 lb4 +check_engine_stats northd recompute nocompute +CHECK_NO_CHANGE_AFTER_RECOMPUTE + AT_CLEANUP ])