From patchwork Fri Apr 26 17:54:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1928285 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=Y4Mc66+f; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.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 4VR0l21bDfz1yP2 for ; Sat, 27 Apr 2024 03:55:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8337341F92; Fri, 26 Apr 2024 17:55:56 +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 RRtiqCfb2PiJ; Fri, 26 Apr 2024 17:55:55 +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 27C9241F89 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=Y4Mc66+f Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 27C9241F89; Fri, 26 Apr 2024 17:55:55 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 09D7FC0077; Fri, 26 Apr 2024 17:55:55 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8E175C0037 for ; Fri, 26 Apr 2024 17:55:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 82AF340385 for ; Fri, 26 Apr 2024 17:55:53 +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 5vjYKElxOrlL for ; Fri, 26 Apr 2024 17:55:53 +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 smtp2.osuosl.org BD1194011C Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BD1194011C Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Y4Mc66+f Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id BD1194011C for ; Fri, 26 Apr 2024 17:55:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714154151; 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=h/8Yerk9AOieuI57U/lJK8YevKoAhE3yTDFyQhM3nXo=; b=Y4Mc66+fz65LwH1Grd1yTPhrT4Y73zdfsyTxSgcsG9/JmqTw6p0kBjTZ03uCi95ZuVh4KU LHOZBfG5b7f3jAutKADhoHOJIKcxP9+5qJm86pr6z/EZOcsEuc/3LGKO8QBOOtic3ULEw9 X1C3UirfDBL0BvCtlxZCPYlW3AQbjro= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-0sD9mWSxPo2e1DKBYAScgg-1; Fri, 26 Apr 2024 13:55:50 -0400 X-MC-Unique: 0sD9mWSxPo2e1DKBYAScgg-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6a0b3599f2cso6708796d6.3 for ; Fri, 26 Apr 2024 10:55:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714154149; x=1714758949; 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=h/8Yerk9AOieuI57U/lJK8YevKoAhE3yTDFyQhM3nXo=; b=lB9lmqAsz6DunDdhpbWjKVQTzBjVGIMcaKVbccxJ/cXNQahdyd4M0GivokEZR+RFfQ 2bd6tkJrp75jUL6B4z4CeKC4wuBldjg5m/LurQNSA+LrnkfhRgOyYvAiLd4TnmByJAtb PmmAw1Rl5fbIjQAZ6P52NQ0JGZJi4IDKgteHqgkzPtCA/tS3vf1KNxI2Tp7QT+zjOj9E MVif96ty4PBIBYS8E4eDcD6dXyBJvFQFWVtBt4zSnOoAOyXLsQD3KK00+Cr6QX4WW1RL bJtAhi9+kfnii34TwOfuoFHvQRDjR9JTHtAt6jS9UlqWYY4bQrbunwNBZwPhK0lJKrES cPyA== X-Gm-Message-State: AOJu0YwKjVZ5tR/sEX7eTo3mn8oro7BoiRKBoAHWlf4TlXjnmOhBzR84 6TzbSe5E4A1Py1ztbvtbgRHsvjtUx9EY35YywAjQr0ZGJ8Yw46Hdk1+O+EEqOFAMTwsyKl8SDvk Qg6SNZvbqFNDA3oxL5uFkRz61QDoykdI5ZaIxn1GY+IKWD1aU24k4jDYpwwwOMnfGu9V4MEE8r0 7pwEzIoOVKLvd8GqxPDe7W9xTvkECnxcZEng== X-Received: by 2002:a05:6214:2b06:b0:699:2dca:fd4f with SMTP id jx6-20020a0562142b0600b006992dcafd4fmr3975481qvb.47.1714154149271; Fri, 26 Apr 2024 10:55:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIvMPcfl1qzagnNAyHivIuo7WLGtj5tF4gBMfZvJemXjNvrBDxOHai5OO87pc+Xjlus5xhZQ== X-Received: by 2002:a05:6214:2b06:b0:699:2dca:fd4f with SMTP id jx6-20020a0562142b0600b006992dcafd4fmr3975457qvb.47.1714154148857; Fri, 26 Apr 2024 10:55:48 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 10:55:48 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Fri, 26 Apr 2024 17:54:54 +0000 Message-ID: <20240426175501.858655-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 Subject: [ovs-dev] [PATCH ovn v7 0/6] 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" v2+ of the original test patch exposed a ubsan failure in port tunnel id allocation code when tunnel id space is exhausted. This series fixes the ubsan failure (patches 1-2); then adjusts the invalid scenario to trigger the originally intended failure mode - id space exhausted (patch 3). Finally, it includes a number of smaller cleanup patches in the area that simplify the allocation code somewhat. (patches 4-6) I attempted to make each patch as simple as possible, to simplify review. If you think it's too granular, let me know and I can squash some. 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. v5: ubsan fixes included. v6: modify patch 5 to honor previously allocated tunnel ids. always detach op->list in build_ports (and never elsewhere.) v7: simplify pb cleanup logic in ls_port_init. Ihar Hrachyshka (6): northd: Don't cleanup op in ovn_port_allocate_key. northd: Don't detach op->list when it wasn't used. tests: Correct tunnel ids exhaustion scenario. northd: Don't create pb in ls_port_init too early. northd: Remove unused `sb` arg in ls_port_create. northd: Remove unused nbrp arg in ls_port_reinit. northd/northd.c | 58 ++++++++++++++++++++++++++------------------- tests/ovn-northd.at | 43 ++++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 28 deletions(-) Acked-by: Mark Michelson