From patchwork Fri Apr 5 16:14:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1920317 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=NpVKRJuq; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VB3VD6pNDz1yZH for ; Sat, 6 Apr 2024 03:15:00 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 3F7F441B34; Fri, 5 Apr 2024 16:14:59 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id AVfoOku9K65o; Fri, 5 Apr 2024 16:14:58 +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 smtp4.osuosl.org E78F2418BD 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=NpVKRJuq Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id E78F2418BD; Fri, 5 Apr 2024 16:14:57 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B83B9C0072; Fri, 5 Apr 2024 16:14:57 +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 7A9BFC0037 for ; Fri, 5 Apr 2024 16:14:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 754EF6060F for ; Fri, 5 Apr 2024 16:14:55 +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 LORfkJHkM1s2 for ; Fri, 5 Apr 2024 16:14:53 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=ihrachys@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 2DC2D605E7 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 2DC2D605E7 Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NpVKRJuq Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2DC2D605E7 for ; Fri, 5 Apr 2024 16:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712333692; 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=WZOk+8PcVDq2b6E5ZDZvTU7TMYPhA217MTw3wIzLFzk=; b=NpVKRJuqRb72loEnOX7dcVn88j9Jrh+LhPwjsz8aZTCaL9dXUsxwZMNU36Xdu6QezWaX1y CftmUl0iX3XinWYs6OM1WOhCbwiWMVnig2zPAAToixbqVF2vzfWq34knGJwcwb7plLT2pU oyRXQtmQJMc9HQrqZ3i2jGQB1JvVlQo= Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-SY09PhvtN42FsLy0REkbRg-1; Fri, 05 Apr 2024 12:14:51 -0400 X-MC-Unique: SY09PhvtN42FsLy0REkbRg-1 Received: by mail-ot1-f72.google.com with SMTP id 46e09a7af769-6e6cbb27964so2477453a34.2 for ; Fri, 05 Apr 2024 09:14:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712333689; x=1712938489; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WZOk+8PcVDq2b6E5ZDZvTU7TMYPhA217MTw3wIzLFzk=; b=Ol6m4ZuVzLOybkkN70tC+wwgiWcJU5cLOaAZPjbtJ908dhQj7/RBhOYySxp4hZJyGj C441ixAckzX+UUIU5qajgkL/LhbJgqbmQgxTWtutR8JsnYh6xsf73ZP8XKyWVLF3v6jX n5T7h1F2X26iuVTQ9REt7Dk802k5ANB+v9uz2uv5X1kKalfjMHL3sP0MuZq23F16TxDK 1l7MGkTZkBaUM/+heUuEt1jfGEPAsouG0HEQj9KcG6719orRKZmwGIlPdQ7XzJ/eAqe6 62y/CGcpDPkhN65C4WFkL8vopf3m4meUWxjAOugZCtylYf65FgrrH9OC4aEfgiSYqepE /mnQ== X-Gm-Message-State: AOJu0YyhJlGDCmNbyCtgxlVT5i465cZGPENI/2hpyYABcJQMVq9NJRtV tFo4ZHJJgA6XocXz+Sc6kUjPxZHK/VIJ9DUCbVXfnIZ1cuacdQzGNYVrSMpP3jQg56zeFDB90aj L9YwZfj7M1HM3jbwWGwzD4OxNMsKJw1yvaH3y6tcyMceT3rzCEIHW8YsOkJElfC6dzIghTp0J2J wmYuARWk9EqWaCBrism0l+Mjfo+qkAxO5jyA== X-Received: by 2002:a05:6870:b254:b0:22a:107c:4ddf with SMTP id b20-20020a056870b25400b0022a107c4ddfmr2255732oam.23.1712333689602; Fri, 05 Apr 2024 09:14:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1raneZEbLzRiUoQ5Pa3O8OMWgXmBFSp1DCffKm2GkB3e+LiH0nLv/pEpt4WpjpVQabK5DNg== X-Received: by 2002:a05:6870:b254:b0:22a:107c:4ddf with SMTP id b20-20020a056870b25400b0022a107c4ddfmr2255702oam.23.1712333689140; Fri, 05 Apr 2024 09:14:49 -0700 (PDT) Received: from fedora38.localdomain.com (172-073-180-250.res.spectrum.com. [172.73.180.250]) by smtp.gmail.com with ESMTPSA id ga27-20020a05622a591b00b00432d39e08absm874438qtb.11.2024.04.05.09.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 09:14:48 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Fri, 5 Apr 2024 16:14:37 +0000 Message-ID: <20240405161437.631395-1-ihrachys@redhat.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Vladislav Odintsov Subject: [ovs-dev] [PATCH ovn v4] Make tunnel ids exhaustion test trigger the problem. 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" The original version of the scenario passed with or without the fix. This is because all LSs were processed in one go, so the allocate function was never entered with *hint==0. Also, added another scenario that will check behavior when *hint is out of [min;max] bounds but > max (this happens in an obscure scenario where a vxlan chassis is added to the cluster mid-light, forcing northd to reduce its effective max value for tunnel ids; which may become lower than the current *hint for ports.) Fixes: a1f165a7b807 ("northd: fix infinite loop in ovn_allocate_tnlid()") Co-Authored-By: Vladislav Odintsov Signed-off-by: Vladislav Odintsov Signed-off-by: Ihar Hrachyshka --- 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. --- tests/ovn-northd.at | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index be006fb32..1a4e7274d 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -2823,7 +2823,7 @@ AT_CLEANUP ]) OVN_FOR_EACH_NORTHD_NO_HV([ -AT_SETUP([check tunnel ids exhaustion]) +AT_SETUP([check datapath tunnel ids exhaustion]) ovn_start # Create a fake chassis with vxlan encap to lower MAX DP tunnel key to 2^12 @@ -2833,13 +2833,18 @@ ovn-sbctl \ cmd="ovn-nbctl --wait=sb" -for i in {1..4097}; do +for i in {1..4095}; do cmd="${cmd} -- ls-add lsw-${i}" done eval $cmd -check_row_count nb:Logical_Switch 4097 +check_row_count nb:Logical_Switch 4095 +wait_row_count sb:Datapath_Binding 4095 + +ovn-nbctl ls-add lsw-exhausted + +check_row_count nb:Logical_Switch 4096 wait_row_count sb:Datapath_Binding 4095 OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted" northd/ovn-northd.log]) @@ -2847,6 +2852,38 @@ OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted" northd/ovn-northd.log]) AT_CLEANUP ]) +OVN_FOR_EACH_NORTHD_NO_HV([ +AT_SETUP([check port tunnel ids exhaustion; vxlan chassis pops up midflight]) +ovn_start + +cmd="ovn-nbctl --wait=sb" + +cmd="${cmd} -- ls-add lsw" +for i in {1..2048}; do + cmd="${cmd} -- lsp-add lsw lsp-${i}" +done + +eval $cmd + +check_row_count nb:Logical_Switch_Port 2048 +wait_row_count sb:Port_Binding 2048 + +# Now create a fake chassis with vxlan encap to lower MAX port tunnel key to 2^11 +ovn-sbctl \ + --id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \ + -- --id=@c create chassis name=hv1 encaps=@e + +ovn-nbctl lsp-add lsw lsp-exhausted + +check_row_count nb:Logical_Switch_Port 2049 +wait_row_count sb:Port_Binding 2048 + +OVS_WAIT_UNTIL([grep "all port tunnel ids exhausted" northd/ovn-northd.log]) + +AT_CLEANUP +]) + + OVN_FOR_EACH_NORTHD_NO_HV([ AT_SETUP([Logical Flow Datapath Groups])