From patchwork Fri Apr 12 01:57:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1922810 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=R4Jlukrz; 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 4VG085467Wz1yYX for ; Fri, 12 Apr 2024 11:57:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B001D6134C; Fri, 12 Apr 2024 01:57:47 +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 6qMo2zfP1m8t; Fri, 12 Apr 2024 01:57:45 +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 37EB5608EB 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=R4Jlukrz Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 37EB5608EB; Fri, 12 Apr 2024 01:57:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 213A6C007C; Fri, 12 Apr 2024 01:57:43 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4E05CC0DD5 for ; Fri, 12 Apr 2024 01:57:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 2D87A82393 for ; Fri, 12 Apr 2024 01:57:41 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id VkXrk-6tSOow for ; Fri, 12 Apr 2024 01:57:40 +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 smtp1.osuosl.org 5228C822F8 Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5228C822F8 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=R4Jlukrz 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 5228C822F8 for ; Fri, 12 Apr 2024 01:57:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712887059; 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: in-reply-to:in-reply-to:references:references; bh=1cm6BuWcjLJdmhtg4buM/UdHxRZvd6iBDYe+9Xz8eEw=; b=R4Jlukrzoppm44TZ4DA+ENwz7XHU7pi7ZUlEuxu1sXfatu/JqyTBUYccFrIgTpd/q/uRbz LVplCsPGg/PK5Lze4zIVhEBC9eKIXQN8ZbEVTbQCnFcPF/kpLGTzeD107kVzQpS6T1xwvg ByVQ6a2NdDYfseq/P1LpaFp1CzKZTao= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-652-NAthCJH7NR-_TfjIeDbi8g-1; Thu, 11 Apr 2024 21:57:38 -0400 X-MC-Unique: NAthCJH7NR-_TfjIeDbi8g-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-618596c23b4so7078937b3.0 for ; Thu, 11 Apr 2024 18:57:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712887057; x=1713491857; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1cm6BuWcjLJdmhtg4buM/UdHxRZvd6iBDYe+9Xz8eEw=; b=WzO5ghsPt1QlR1nGGnG0zMU1b0B708RztgnRqztTC7ASiv+8LALAQ7g9IbNtC4bJj3 aV1gQVowmTYTVtSKtD/pzl1JVe+jfKEvDs68p3vYxk3P9mpFewO17qCoEXxj9Cg1UaX7 X6F/5NvyRW+EpW8VGkcMLgIZ0z3VQTqZwZHY4ujf0boVk1gfVWZXvh7RfXZ8cDd0mgj+ OejmIt7dV/8LbFa1dwDOEvVSpxM8aH5/prrGltp+AUSltDvG2jgctB38hhkyu91RwC3k +TZZ07Jjqd6GHodIP1G087QQ+vcuhfHGm+w0TfT4ou9mdwwORa04uwJeLxav8ItuPVsw /UVg== X-Gm-Message-State: AOJu0YxYsSexK7H8GQZXN7ATRkeHQCUaUfNkn23lBnfmMOAb495GL60Q hgjv16F3XXtJybF8qbjPY3CK3DdvW7zW/op88BHh4oWo73a3FIdvE1yKW5FwPlN4LtCiw1Wt0zH yFzOZj9PFueWzI7JcxdNbZrTZD9WqvMY7swqWZsYhp4y8ykcVVusK18aSQIFUEVSIj+Ay0OtOeg yuTrd+vCtJbKZRy1lVp4o2gx/tkBQEMa2LSQ== X-Received: by 2002:a81:52c3:0:b0:618:1151:b4 with SMTP id g186-20020a8152c3000000b00618115100b4mr1392030ywb.21.1712887057098; Thu, 11 Apr 2024 18:57:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6o70QgT3+03EgKPu8s5iCFj2KNrEM0k2xtg8XRKtho8n9u8qCOXOB99+htBFnHKIfuSzyMg== X-Received: by 2002:a81:52c3:0:b0:618:1151:b4 with SMTP id g186-20020a8152c3000000b00618115100b4mr1392008ywb.21.1712887056667; Thu, 11 Apr 2024 18:57:36 -0700 (PDT) Received: from fedora38.localdomain (172-073-180-250.res.spectrum.com. [172.73.180.250]) by smtp.gmail.com with ESMTPSA id y71-20020a0dd64a000000b00617c80f06cesm602877ywd.90.2024.04.11.18.57.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 18:57:34 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Fri, 12 Apr 2024 01:57:24 +0000 Message-ID: <20240412015727.4152034-4-ihrachys@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240412015727.4152034-1-ihrachys@redhat.com> References: <20240412015727.4152034-1-ihrachys@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Vladislav Odintsov Subject: [ovs-dev] [PATCH ovn v6 3/6] tests: Correct tunnel ids exhaustion scenario. 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 --- 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])