From patchwork Fri Apr 26 17:54:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1928288 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=V5KRCHyb; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VR0lC1G6Pz1yP2 for ; Sat, 27 Apr 2024 03:56:07 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8960741CEC; Fri, 26 Apr 2024 17:56:05 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id rUZGM3HUyNqG; Fri, 26 Apr 2024 17:56:02 +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 smtp2.osuosl.org 416DF41CF1 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=V5KRCHyb Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 416DF41CF1; Fri, 26 Apr 2024 17:56:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D20DAC008E; Fri, 26 Apr 2024 17:56:01 +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 30639C0077 for ; Fri, 26 Apr 2024 17:56:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9385483B18 for ; Fri, 26 Apr 2024 17:55:59 +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 sbQ9NXrOyipb for ; Fri, 26 Apr 2024 17:55:59 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=ihrachys@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org B0FAB83AE0 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 B0FAB83AE0 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=V5KRCHyb Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id B0FAB83AE0 for ; Fri, 26 Apr 2024 17:55:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714154157; 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=k7Z2MrVAO14OyQVayHPd/hOsG6RdwLmB69NGuC82SVg=; b=V5KRCHyb5rxkl3nCGBxBbfVydNlBhmMQgzQgpWxoHWawfgswRdlXOu7fcHa2OHeu5fNkbD BfhdieSPRi53Lce09fjjeKjl0Qw26HnG0S92RJoKE8p8vI4XevShsKCe0dVintlSLIhe3n G2ZYwyuoK7Sx4DOV1J8ZcXyboXuWu0A= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-505-PD7bEz8BOk6AbRpXTvmULA-1; Fri, 26 Apr 2024 13:55:56 -0400 X-MC-Unique: PD7bEz8BOk6AbRpXTvmULA-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6a085244b70so31529916d6.3 for ; Fri, 26 Apr 2024 10:55:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714154155; x=1714758955; 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=k7Z2MrVAO14OyQVayHPd/hOsG6RdwLmB69NGuC82SVg=; b=wGqDuPzgnmJYDcPw2F8T+bLaAXgcnb7RUR2abhyvn0WvilSsLGfIFeXayzMkpxymYu G/TnECUn7f/dIxIl1PS6314sr37rVxQ3M278vl/uEaKN2+svZzPl3benQ+KZOR/00mMy 3m4QP9j3kXpZPVEBaWhbTIYoQJ4j/v0AobKNzdVShSwehRAr6qsI+dXPWwAyZhb49k/W MI7AF/mnwGNFrs9PlkYg2zG4bTNx7wqHhWk3k71c6um9AhSi0nNZKH4JBGbdHtN1HIL/ zZulynUDVlmx5IAYDO9SRsKlHnsD+KYY8JEuevfmR8TYKQxbTDFuUe9R9k8yDh1s3cl0 ArcA== X-Gm-Message-State: AOJu0YxIWyZSot2xvIthRJ/9EvIWPB9M2Id83c3osnMuGjVQ188GX4t6 flA4WzUn4zSQbhZHHJ3MxC8EkQ/i6ZLKWDFHzoBtqi+LPwQZadpZ3dHtQM/32un6bH5BggfAW96 eqFhcEkhe7RM+ckjs3Jq6ntNhk68I8zQBf7PIinqYSDTwGJvB2GWZdgOlgRWwm9clRQMOHWdExG AXVguFrQ3TZxMmN8zLAA8S1JqHkUzco6kkDA== X-Received: by 2002:a05:6214:d83:b0:6a0:b4f3:d344 with SMTP id e3-20020a0562140d8300b006a0b4f3d344mr1599519qve.35.1714154154669; Fri, 26 Apr 2024 10:55:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5iZTiDl+LLGPGJe9+Ypry+vaogX1jjOQk6BGRSiTn+JmO911uUYGNWIARcYV9+4DZUEQe1Q== X-Received: by 2002:a05:6214:d83:b0:6a0:b4f3:d344 with SMTP id e3-20020a0562140d8300b006a0b4f3d344mr1599495qve.35.1714154154215; Fri, 26 Apr 2024 10:55:54 -0700 (PDT) Received: from fedora38.localdomain.com ([172.73.180.250]) by smtp.gmail.com with ESMTPSA id w17-20020a056214013100b0069b57111a98sm7179855qvs.79.2024.04.26.10.55.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 10:55:52 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Fri, 26 Apr 2024 17:54:57 +0000 Message-ID: <20240426175501.858655-4-ihrachys@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240426175501.858655-1-ihrachys@redhat.com> References: <20240426175501.858655-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 v7 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 27183c551..680d96675 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -2851,7 +2851,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 @@ -2861,13 +2861,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]) @@ -2875,6 +2880,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])