From patchwork Fri Apr 26 17:54:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1928287 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=Z7tuZ1k2; 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 4VR0l574x2z23hv for ; Sat, 27 Apr 2024 03:56:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id AEB7741CB5; Fri, 26 Apr 2024 17:55:57 +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 gReZoHzOKsns; Fri, 26 Apr 2024 17:55:56 +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 34C8C4011C 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=Z7tuZ1k2 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 34C8C4011C; Fri, 26 Apr 2024 17:55:56 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C93D2C0DD2; 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 [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id DA6C3C0037 for ; Fri, 26 Apr 2024 17:55:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BD02640385 for ; Fri, 26 Apr 2024 17:55:54 +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 BAZAkVW7UTFI for ; Fri, 26 Apr 2024 17:55:54 +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 smtp2.osuosl.org E88F44011C 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 E88F44011C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id E88F44011C for ; Fri, 26 Apr 2024 17:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714154152; 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=pDBWHdcTCF7/a5HhXMoe5orMW6KEsRbli1oTjRG+17o=; b=Z7tuZ1k2KqeBn4U5+aq5dOY2887n3N8B1ms6Lz5h2l8g5208HJ8lE91eksTxfYg7T/cnap 0gWQCRgoHglm6a/pEXS1CH32NEnbzYacg0SUJA0KPPSeDmYGxHGGF3lBF4v9w1EyhpZWEP suizUZ3a3WhKSLqUc7RTnOq9v7foN30= 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-436-cXwtoZh7McCObdHP9-aYtA-1; Fri, 26 Apr 2024 13:55:51 -0400 X-MC-Unique: cXwtoZh7McCObdHP9-aYtA-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6a0b7ba8d0aso1313346d6.0 for ; Fri, 26 Apr 2024 10:55:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714154150; x=1714758950; 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=pDBWHdcTCF7/a5HhXMoe5orMW6KEsRbli1oTjRG+17o=; b=XNgZRVHnIB2OwvyjZyijA2FtcLcL9A2Nb57PjNZxLpQBoO7zQM2TZPKdsX8VejYsq1 Nwv20JRSEy+/PeSgF76x1EE7IBdpm13qGir3WQ4+RLO0RURYvKcbFxFdSJRCIav35lRz Gu6G2/Ks4qZeGTLQ6giA8uv7jA5OxJXLSEaDUN1S5hfxtcHXkKsJwOFHYBxOfzMUR8ai zLRpXmA6AmRy5wm3XP/3anF9Z5ieqhz3tbEukRInxr0dal+6mESswMVVtedX5tJ7HEGm 1cSRI1obJvQ8j7nYSkZZsr9s9ngdAjvECUVw6VzoybK06L0HVmSaTxO5PzkA2CYaLIFr Gg7w== X-Gm-Message-State: AOJu0YzWCj452vNT9Y3bkAEbgDNlN+n4CBd9BMhmsoy+mzeRacLMR2Ra DAjmqKcIatoLK01F+4vcrI+fTDFof3pruarGo73vfjqib/wnitbFMGvHfvBn3Kt8n/wcrRuv8+Z m3hskPzdD76e+uGrms+voq78KlIz+UKwG4z5enGXKdyHrajQ4e4Vnn/yK/ZWRq0kNxazCO3Tm7z KOFdNQQ2DadPosI3x8GEnIA0G9bBiXxkdU0A== X-Received: by 2002:a05:6214:16ce:b0:6a0:a6a0:8f96 with SMTP id d14-20020a05621416ce00b006a0a6a08f96mr952327qvz.0.1714154150032; Fri, 26 Apr 2024 10:55:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnXwX44KpNaH704tkjse8L7i5RZlcFShdFeLkJrWlUpLdC3vGLrrmGlYXZGOw760JPBuT52Q== X-Received: by 2002:a05:6214:16ce:b0:6a0:a6a0:8f96 with SMTP id d14-20020a05621416ce00b006a0a6a08f96mr952295qvz.0.1714154149721; Fri, 26 Apr 2024 10:55:49 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 10:55:49 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Fri, 26 Apr 2024 17:54:55 +0000 Message-ID: <20240426175501.858655-2-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 Subject: [ovs-dev] [PATCH ovn v7 1/6] northd: Don't cleanup op in ovn_port_allocate_key. 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" Let the callers do the cleanup as needed. Signed-off-by: Ihar Hrachyshka --- northd/northd.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index b541e8455..3bdd0648c 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -4012,7 +4012,6 @@ ovn_port_assign_requested_tnl_id( static bool ovn_port_allocate_key(const struct sbrec_chassis_table *sbrec_chassis_table, - struct hmap *ports, struct ovn_port *op) { if (!op->tunnel_key) { @@ -4021,11 +4020,6 @@ ovn_port_allocate_key(const struct sbrec_chassis_table *sbrec_chassis_table, 1, (1u << (key_bits - 1)) - 1, &op->od->port_key_hint); if (!op->tunnel_key) { - if (op->sb) { - sbrec_port_binding_delete(op->sb); - } - ovs_list_remove(&op->list); - ovn_port_destroy(ports, op); return false; } } @@ -4090,10 +4084,17 @@ build_ports(struct ovsdb_idl_txn *ovnsb_txn, /* Assign new tunnel ids where needed. */ LIST_FOR_EACH_SAFE (op, list, &both) { - ovn_port_allocate_key(sbrec_chassis_table, ports, op); + if (!ovn_port_allocate_key(sbrec_chassis_table, op)) { + sbrec_port_binding_delete(op->sb); + ovs_list_remove(&op->list); + ovn_port_destroy(ports, op); + } } LIST_FOR_EACH_SAFE (op, list, &nb_only) { - ovn_port_allocate_key(sbrec_chassis_table, ports, op); + if (!ovn_port_allocate_key(sbrec_chassis_table, op)) { + ovs_list_remove(&op->list); + ovn_port_destroy(ports, op); + } } /* For logical ports that are in both databases, update the southbound @@ -4324,7 +4325,12 @@ ls_port_init(struct ovn_port *op, struct ovsdb_idl_txn *ovnsb_txn, sbrec_port_binding_set_logical_port(op->sb, op->key); } /* Assign new tunnel ids where needed. */ - if (!ovn_port_allocate_key(sbrec_chassis_table, ls_ports, op)) { + if (!ovn_port_allocate_key(sbrec_chassis_table, op)) { + if (op->sb) { + sbrec_port_binding_delete(op->sb); + } + ovs_list_remove(&op->list); + ovn_port_destroy(ls_ports, op); return false; } ovn_port_update_sbrec(ovnsb_txn, sbrec_chassis_by_name, From patchwork Fri Apr 26 17:54:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1928286 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=W1QtsVDg; 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 4VR0l567Jbz1yP2 for ; Sat, 27 Apr 2024 03:56:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4A25D41FAD; Fri, 26 Apr 2024 17:56:00 +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 QNlHvjyXNX62; Fri, 26 Apr 2024 17:55:59 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0832241F9A 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=W1QtsVDg Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0832241F9A; Fri, 26 Apr 2024 17:55:59 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D3D2EC0077; Fri, 26 Apr 2024 17:55:58 +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 924E1C0037 for ; Fri, 26 Apr 2024 17:55:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5B4A86146C for ; Fri, 26 Apr 2024 17:55:57 +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 7OrtwJrv3fxb for ; Fri, 26 Apr 2024 17:55:56 +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 5539A61465 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 5539A61465 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=W1QtsVDg 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 5539A61465 for ; Fri, 26 Apr 2024 17:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714154155; 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=c73diVRuJl4hMDJqcOR63EalQsrLzt0ckTBs4Gyo8t8=; b=W1QtsVDgoJjVc6HTiFs2/e72Dewvpv/Uk8cptL5rRKIjbMXRfZ4BQHCCPJ7tj48tcFcccQ Y46ugDThwB5FUWbf07yVpjCbzuvbxaSjajsJz+Lv/3/Q+qegZXgi5z+/vuLePAPVCGTVTH l6bP2KZYVdaH6h/ydtmV1Xi49xSwXPQ= Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-392-3I5gjswqMfecoQklgIunmw-1; Fri, 26 Apr 2024 13:55:54 -0400 X-MC-Unique: 3I5gjswqMfecoQklgIunmw-1 Received: by mail-ot1-f70.google.com with SMTP id 46e09a7af769-6eb891cf5e0so2969942a34.3 for ; Fri, 26 Apr 2024 10:55:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714154152; x=1714758952; 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=c73diVRuJl4hMDJqcOR63EalQsrLzt0ckTBs4Gyo8t8=; b=QK0SfxTBvWHGrW+U7r8HktEPRd7Sb7CZyWfWR0yh2qDv8r3FZK/cvFA6ZGHrPEr+XE D/piJpgyV2qmNP6KZIwGygwO2KHtX6/yMMfzJqXLYQXXJxSFeup0r6BhJbdL0r7zKPhc RmfJx3HW922CGVd/gRC4KdTzE/sSw08wf26SK5EiHpnp6/lDwFjCqNEr4BRI4HklJukM iwPFi5rQdR54tlD0drY6vkiFBsFPIo3UXCWfAEeShXV8LmNtv5+kVJxb/VLC0JmhRqcI 6wBITrIqkSIrIVo0WFDs/eW/p8V3oobHu189CDomubhfD6OUBI4dD3eeSoVTB8i5uK7H vJGQ== X-Gm-Message-State: AOJu0YxNSHE2sCcLLD9waN28IfR/eCnfPSqK9Bjofarn2NS3Q7w8zkWE IyNZJgu1F2OV765+Kt9As3sBijRCDv7TYnAyKwDKJPcOuabrZhLV2jFPB8w7/jV9dEycKqT5ZO8 799PXrkTGCuvqnsq68utAfA4GOt/iRjiNNqygeSq7RzKoaiPplWSISWap7yN2vWUzyW5hWqeIzI /3DIW3kKJpQDAZD+rvGwNIUZEDzNT1h5wDwg== X-Received: by 2002:a05:6808:1302:b0:3c8:5493:d8d1 with SMTP id y2-20020a056808130200b003c85493d8d1mr4539339oiv.50.1714154152294; Fri, 26 Apr 2024 10:55:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLy2c+nSV7czicyCgHYgSFLhaNDgq4yXKUfizjhqN2knCdLJtUstW/IqwQ8MfMPQock+MZDQ== X-Received: by 2002:a05:6808:1302:b0:3c8:5493:d8d1 with SMTP id y2-20020a056808130200b003c85493d8d1mr4539308oiv.50.1714154151847; Fri, 26 Apr 2024 10:55:51 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 10:55:50 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Fri, 26 Apr 2024 17:54:56 +0000 Message-ID: <20240426175501.858655-3-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 Subject: [ovs-dev] [PATCH ovn v7 2/6] northd: Don't detach op->list when it wasn't used. 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" In some scenarios, op->list is not attached anywhere, which makes attempts to detach it trigger ubsan failure. ovn/ovs/include/openvswitch/list.h:252:17: runtime error: member access within null pointer of type 'struct ovs_list' #0 0x?? in ovs_list_remove ovn/ovs/include/openvswitch/list.h:252:17 #1 0x?? in ovn_port_allocate_key ovn/northd/northd.c:4021:13 #2 0x?? in ls_port_init ovn/northd/northd.c:4321:10 #3 0x?? in ls_port_create ovn/northd/northd.c:4342:10 #4 0x?? in ls_handle_lsp_changes ovn/northd/northd.c:4511:18 #5 0x?? in northd_handle_ls_changes ovn/northd/northd.c:4655:14 #6 0x?? in northd_nb_logical_switch_handler ovn/northd/en-northd.c:150: This patch makes northd use op->list only as a temporary means for build_ports logic to track ports that are persisted in both, nb, or sb only. Now build_ports will always detach ops once done. Now that op->list is never left attached to a list, we can remove ovs_list_remove calls for it elsewhere, including where op was never attached in the first place. Signed-off-by: Ihar Hrachyshka --- northd/northd.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 3bdd0648c..4800a44bd 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -4117,6 +4117,7 @@ build_ports(struct ovsdb_idl_txn *ovnsb_txn, sbrec_mirror_table, op, queue_id_bitmap, &active_ha_chassis_grps); + ovs_list_remove(&op->list); } /* Add southbound record for each unmatched northbound record. */ @@ -4129,6 +4130,7 @@ build_ports(struct ovsdb_idl_txn *ovnsb_txn, op, queue_id_bitmap, &active_ha_chassis_grps); sbrec_port_binding_set_logical_port(op->sb, op->key); + ovs_list_remove(&op->list); } /* Delete southbound records without northbound matches. */ @@ -4298,7 +4300,7 @@ ovn_port_find_in_datapath(struct ovn_datapath *od, static bool ls_port_init(struct ovn_port *op, struct ovsdb_idl_txn *ovnsb_txn, - struct hmap *ls_ports, struct ovn_datapath *od, + struct ovn_datapath *od, const struct sbrec_port_binding *sb, const struct sbrec_mirror_table *sbrec_mirror_table, const struct sbrec_chassis_table *sbrec_chassis_table, @@ -4326,11 +4328,6 @@ ls_port_init(struct ovn_port *op, struct ovsdb_idl_txn *ovnsb_txn, } /* Assign new tunnel ids where needed. */ if (!ovn_port_allocate_key(sbrec_chassis_table, op)) { - if (op->sb) { - sbrec_port_binding_delete(op->sb); - } - ovs_list_remove(&op->list); - ovn_port_destroy(ls_ports, op); return false; } ovn_port_update_sbrec(ovnsb_txn, sbrec_chassis_by_name, @@ -4351,9 +4348,12 @@ ls_port_create(struct ovsdb_idl_txn *ovnsb_txn, struct hmap *ls_ports, struct ovn_port *op = ovn_port_create(ls_ports, key, nbsp, NULL, NULL); hmap_insert(&od->ports, &op->dp_node, hmap_node_hash(&op->key_node)); - if (!ls_port_init(op, ovnsb_txn, ls_ports, od, sb, + if (!ls_port_init(op, ovnsb_txn, od, sb, sbrec_mirror_table, sbrec_chassis_table, sbrec_chassis_by_name, sbrec_chassis_by_hostname)) { + if (op->sb) { + sbrec_port_binding_delete(op->sb); + } ovn_port_destroy(ls_ports, op); return NULL; } @@ -4363,7 +4363,6 @@ ls_port_create(struct ovsdb_idl_txn *ovnsb_txn, struct hmap *ls_ports, static bool ls_port_reinit(struct ovn_port *op, struct ovsdb_idl_txn *ovnsb_txn, - struct hmap *ls_ports, const struct nbrec_logical_switch_port *nbsp, const struct nbrec_logical_router_port *nbrp, struct ovn_datapath *od, @@ -4377,7 +4376,7 @@ ls_port_reinit(struct ovn_port *op, struct ovsdb_idl_txn *ovnsb_txn, op->sb = sb; ovn_port_set_nb(op, nbsp, nbrp); op->l3dgw_port = op->cr_port = NULL; - return ls_port_init(op, ovnsb_txn, ls_ports, od, sb, + return ls_port_init(op, ovnsb_txn, od, sb, sbrec_mirror_table, sbrec_chassis_table, sbrec_chassis_by_name, sbrec_chassis_by_hostname); } @@ -4552,12 +4551,16 @@ ls_handle_lsp_changes(struct ovsdb_idl_txn *ovnsb_idl_txn, op->visited = true; continue; } - if (!ls_port_reinit(op, ovnsb_idl_txn, &nd->ls_ports, + if (!ls_port_reinit(op, ovnsb_idl_txn, new_nbsp, NULL, od, sb, ni->sbrec_mirror_table, ni->sbrec_chassis_table, ni->sbrec_chassis_by_name, ni->sbrec_chassis_by_hostname)) { + if (op->sb) { + sbrec_port_binding_delete(op->sb); + } + ovn_port_destroy(&nd->ls_ports, op); goto fail; } add_op_to_northd_tracked_ports(&trk_lsps->updated, op); 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]) From patchwork Fri Apr 26 17:54:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1928289 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=bFLFf5eH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (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 4VR0lF0gY3z1yP2 for ; Sat, 27 Apr 2024 03:56:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C9E6C83B56; Fri, 26 Apr 2024 17:56:06 +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 kfOG09ZBoQrn; Fri, 26 Apr 2024 17:56:05 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 3A69783B2F Authentication-Results: smtp1.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=bFLFf5eH Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 3A69783B2F; Fri, 26 Apr 2024 17:56:05 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id ECB77C0077; Fri, 26 Apr 2024 17:56:04 +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 732DAC0037 for ; Fri, 26 Apr 2024 17:56:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id A43336148A for ; Fri, 26 Apr 2024 17:56:00 +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 5ZCFgH9QKlSX for ; Fri, 26 Apr 2024 17:55:59 +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 3F0AB61474 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 3F0AB61474 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=bFLFf5eH 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 3F0AB61474 for ; Fri, 26 Apr 2024 17:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714154158; 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=IVE/xbs9d3hE7vVfQ2H/r6Dt9MleDAd/QfsN1TEvMDA=; b=bFLFf5eH5cpg/mLqJ+9Fwh+YcIY2VWnV9LqsEJoQYdK7wJH/4KUK//JCSE/5e7u92BZTsm 8wU7aNKV8pjilOr28codTsOmzDT7VzOYeRzcl5zgdntLhuqzNG3rp6vUyiu7T1FMB6QRmQ GI6oCqA1FT14O9PQz10xbY0i+eUbBbY= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-168-3P1zo78AOoqNMCbSYMzl0Q-1; Fri, 26 Apr 2024 13:55:56 -0400 X-MC-Unique: 3P1zo78AOoqNMCbSYMzl0Q-1 Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3c5ffab3db3so2810455b6e.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=IVE/xbs9d3hE7vVfQ2H/r6Dt9MleDAd/QfsN1TEvMDA=; b=brB0hgPSI2kJz3pU4N/KT3m8ini2MbR8zJIKNxsXMACwnw70XPiwbcJm5gbp9K1c1p 5h6G9zgFZ0bRmJBHjgoKug7poZDMzeA7HSPlflpyTQkedNO8amdA7phLTj6dbRsUQU6I 3bpc75cI13phxoPHo2wu+9DPJLfpK1NHYFxfQZ6OOL6w8zNoZvMxwl+it7TZGWR3oZOy wRV84SZADi5kPf9QnvoyEgvf8kHYV8Ks3p+BAkCZZZc9/s8LB1XLmUclpYWqvTkBQ1RG 7OVFGr14yIQUbVGSnyN5CcMbmrrTlZiDCptiLk0mV6UH+Bf8StqCwXMV8ecHtb74dlL2 AKFQ== X-Gm-Message-State: AOJu0YzOEr2+JW4hpkAxnifYzP5XYlJ2mkLEv5iKAoNsBBO2TSjC5VMG D8CWxUzKUYSEyzobTtXTCM5DzOa+NyOVaNcTPMrPXGQmL321OFcj1EVjdKferwby4hq7yNdQ3pc 6HQdQhCGha24tOfKVyCvdQM8pG5oaQFDW+qe9+OBo0ETTEOHBibsKPFOZV/pRzx+vi/B2Y/IfZo Zk7adnJuPrhz7EEurCegnoUQTtM+oXCktdAw== X-Received: by 2002:a05:6808:2346:b0:3c7:4891:ab62 with SMTP id ef6-20020a056808234600b003c74891ab62mr4158419oib.27.1714154155367; Fri, 26 Apr 2024 10:55:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6GaZQAi4HpxP9Vxbo1jG/kNSbE1eDh3Mv681kHSuNDTHgbMlS7gxXi0Nvu3Xx7FZgBsxZ9Q== X-Received: by 2002:a05:6808:2346:b0:3c7:4891:ab62 with SMTP id ef6-20020a056808234600b003c74891ab62mr4158404oib.27.1714154155039; Fri, 26 Apr 2024 10:55:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 10:55:54 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Fri, 26 Apr 2024 17:54:58 +0000 Message-ID: <20240426175501.858655-5-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 Subject: [ovs-dev] [PATCH ovn v7 4/6] northd: Don't create pb in ls_port_init too early. 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" This allows callers to avoid cleanup of the record in case the function fails. Signed-off-by: Ihar Hrachyshka --- northd/northd.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 4800a44bd..934c22dac 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -4313,12 +4313,19 @@ ls_port_init(struct ovn_port *op, struct ovsdb_idl_txn *ovnsb_txn, if (!ovn_port_assign_requested_tnl_id(sbrec_chassis_table, op)) { return false; } + /* Keep nonconflicting tunnel IDs that are already assigned. */ if (sb) { - op->sb = sb; - /* Keep nonconflicting tunnel IDs that are already assigned. */ if (!op->tunnel_key) { - ovn_port_add_tnlid(op, op->sb->tunnel_key); + ovn_port_add_tnlid(op, sb->tunnel_key); } + } + /* Assign new tunnel ids where needed. */ + if (!ovn_port_allocate_key(sbrec_chassis_table, op)) { + return false; + } + /* Create new binding, if needed. */ + if (sb) { + op->sb = sb; } else { /* XXX: the new SB port_binding will change in IDL, so need to handle * SB port_binding updates incrementally to achieve end-to-end @@ -4326,10 +4333,6 @@ ls_port_init(struct ovn_port *op, struct ovsdb_idl_txn *ovnsb_txn, op->sb = sbrec_port_binding_insert(ovnsb_txn); sbrec_port_binding_set_logical_port(op->sb, op->key); } - /* Assign new tunnel ids where needed. */ - if (!ovn_port_allocate_key(sbrec_chassis_table, op)) { - return false; - } ovn_port_update_sbrec(ovnsb_txn, sbrec_chassis_by_name, sbrec_chassis_by_hostname, NULL, sbrec_mirror_table, op, NULL, NULL); @@ -4351,9 +4354,6 @@ ls_port_create(struct ovsdb_idl_txn *ovnsb_txn, struct hmap *ls_ports, if (!ls_port_init(op, ovnsb_txn, od, sb, sbrec_mirror_table, sbrec_chassis_table, sbrec_chassis_by_name, sbrec_chassis_by_hostname)) { - if (op->sb) { - sbrec_port_binding_delete(op->sb); - } ovn_port_destroy(ls_ports, op); return NULL; } @@ -4557,8 +4557,8 @@ ls_handle_lsp_changes(struct ovsdb_idl_txn *ovnsb_idl_txn, ni->sbrec_chassis_table, ni->sbrec_chassis_by_name, ni->sbrec_chassis_by_hostname)) { - if (op->sb) { - sbrec_port_binding_delete(op->sb); + if (sb) { + sbrec_port_binding_delete(sb); } ovn_port_destroy(&nd->ls_ports, op); goto fail; From patchwork Fri Apr 26 17:54:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1928290 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=P+51kEhv; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.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 4VR0lL14J7z1yP2 for ; Sat, 27 Apr 2024 03:56:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 240FA6149D; Fri, 26 Apr 2024 17:56:12 +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 CchnuiPusQKx; Fri, 26 Apr 2024 17:56:08 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3923061494 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=P+51kEhv Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 3923061494; Fri, 26 Apr 2024 17:56:07 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 09216C0077; Fri, 26 Apr 2024 17:56:07 +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 098F3C0DD2 for ; Fri, 26 Apr 2024 17:56:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4D1A583B30 for ; Fri, 26 Apr 2024 17:56:04 +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 b2dowaaFNFL5 for ; Fri, 26 Apr 2024 17:56:03 +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 C14C983B36 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 C14C983B36 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=P+51kEhv 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 C14C983B36 for ; Fri, 26 Apr 2024 17:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714154161; 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=EEp96NRnjtdc8emz3Z46oiDiqZtB+fELBYNcXrqjLjo=; b=P+51kEhvf18/tyWpV/o7qs0L+lDOsnBcN92KEOkf2hUWkVkqqg0t2qEysQ/cSOE0PYVpRi 24m73ehLm7tXlcVh5FYj8aA6JG5Jl91g0Z1d1FjEUdgvNoQ8OVb0An+FtMOKfpaQ/RG0hT XhV8mANJhBawRhqMsdUuK8rpsKEsP/w= 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-282-p2rAxKBwPSqWIOV9e1B95g-1; Fri, 26 Apr 2024 13:55:58 -0400 X-MC-Unique: p2rAxKBwPSqWIOV9e1B95g-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6a085b7a6ceso32806366d6.2 for ; Fri, 26 Apr 2024 10:55:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714154157; x=1714758957; 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=EEp96NRnjtdc8emz3Z46oiDiqZtB+fELBYNcXrqjLjo=; b=d3PExqAu40R0KspNnGcow4P+aQ5lAAolBlqEZxx8v8KF8gb6tOlF+3lTyueNbhSiKP Lr8BciWiPJIuYy0saJ4k/hKSq0T83LjqPtgf5IRmS2Mc/54VqOOzI88cI96PkOOYHFJw uwKnApFtCatVjFP+MFjd2ro/gzpSHcTPxE6C28SluqIXELA0viuSE2gAnYAyYee4Dey2 ygKAyFtoSsqS+SsM8qJntpJA6sw26z9g46YRShANWAVvn2uqd4BMZribDCBxkx69XnXQ OOOsu0ujpbSRfE4zZfFfpaezIB6CxRJA+1xtfKNBCkSG+Jfh+1k/l9O5b76kcMYih+Pl RqPw== X-Gm-Message-State: AOJu0YwPIT6RQlke0P5siPusdlYdrhaE5oYl1WkmT+hLwvSQ7NQEkiSJ zoi/1xXSqexWsBvLwm1s3G3hovo1j56ez4ry32vpxf+PJEBXG/puHKnOXb4aqkMfW6pY7/S7cR6 iyOJ6GWPvfc9ndJ/MkWjZ3fL2cfcYriJFFZvu5UtWyHJik0IyEAcB5stP0HDIPfDhr4vkYakwxO FRiIQpdXxNFi3x5uD2gBRDVtBx0N3MUM3NKA== X-Received: by 2002:a05:6214:f23:b0:6a0:810b:327f with SMTP id iw3-20020a0562140f2300b006a0810b327fmr4370636qvb.41.1714154157373; Fri, 26 Apr 2024 10:55:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYdlgpQd0tY2jcvNnzd3zkh9jHCYgwFWKUuUcuWMABqPxdVXz+7e4/UGHSRLwOCJkQ4JKpnQ== X-Received: by 2002:a05:6214:f23:b0:6a0:810b:327f with SMTP id iw3-20020a0562140f2300b006a0810b327fmr4370612qvb.41.1714154157090; Fri, 26 Apr 2024 10:55:57 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 10:55:55 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Fri, 26 Apr 2024 17:54:59 +0000 Message-ID: <20240426175501.858655-6-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 Subject: [ovs-dev] [PATCH ovn v7 5/6] northd: Remove unused `sb` arg in ls_port_create. 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" It's always NULL. Signed-off-by: Ihar Hrachyshka --- northd/northd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 934c22dac..2fef95f38 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -4342,7 +4342,7 @@ ls_port_init(struct ovn_port *op, struct ovsdb_idl_txn *ovnsb_txn, static struct ovn_port * ls_port_create(struct ovsdb_idl_txn *ovnsb_txn, struct hmap *ls_ports, const char *key, const struct nbrec_logical_switch_port *nbsp, - struct ovn_datapath *od, const struct sbrec_port_binding *sb, + struct ovn_datapath *od, const struct sbrec_mirror_table *sbrec_mirror_table, const struct sbrec_chassis_table *sbrec_chassis_table, struct ovsdb_idl_index *sbrec_chassis_by_name, @@ -4351,7 +4351,7 @@ ls_port_create(struct ovsdb_idl_txn *ovnsb_txn, struct hmap *ls_ports, struct ovn_port *op = ovn_port_create(ls_ports, key, nbsp, NULL, NULL); hmap_insert(&od->ports, &op->dp_node, hmap_node_hash(&op->key_node)); - if (!ls_port_init(op, ovnsb_txn, od, sb, + if (!ls_port_init(op, ovnsb_txn, od, NULL, sbrec_mirror_table, sbrec_chassis_table, sbrec_chassis_by_name, sbrec_chassis_by_hostname)) { ovn_port_destroy(ls_ports, op); @@ -4520,7 +4520,7 @@ ls_handle_lsp_changes(struct ovsdb_idl_txn *ovnsb_idl_txn, goto fail; } op = ls_port_create(ovnsb_idl_txn, &nd->ls_ports, - new_nbsp->name, new_nbsp, od, NULL, + new_nbsp->name, new_nbsp, od, ni->sbrec_mirror_table, ni->sbrec_chassis_table, ni->sbrec_chassis_by_name, From patchwork Fri Apr 26 17:55:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1928291 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=DtPehWnA; 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 4VR0lR5cy2z1yP2 for ; Sat, 27 Apr 2024 03:56:19 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1964561489; Fri, 26 Apr 2024 17:56:18 +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 J6L5_4Ti3-pJ; Fri, 26 Apr 2024 17:56:16 +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 36B07614C5 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=DtPehWnA Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 36B07614C5; Fri, 26 Apr 2024 17:56:16 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0401AC0077; Fri, 26 Apr 2024 17:56:16 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 02168C0037 for ; Fri, 26 Apr 2024 17:56:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B8C3341D11 for ; 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 jl-2AvHhQ31i for ; Fri, 26 Apr 2024 17:56:03 +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 90EE441CEF 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 90EE441CEF Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=DtPehWnA 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 90EE441CEF for ; Fri, 26 Apr 2024 17:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714154162; 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=OIafYlqk1T0Kd9t4gYmevxtdISzPNCRawKM1p79lRGk=; b=DtPehWnATnqgg3ZMgSnRDU7GLDN4fWXP8LGfAn+XJb1AqWWgknKvTO3S3Y/5JTShtwMihn zdpcmTGHk0LNTf1SXSydb+84EczWC0v8siZ/p9c+4NlJbHMgYfLwdIa9qi6zgRspUKFxRV VH1M/2xogNXy6jB3FK7YtXjYs+c8Utk= 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-663-QSWssxRSM4qDaYILmCr4aA-1; Fri, 26 Apr 2024 13:56:01 -0400 X-MC-Unique: QSWssxRSM4qDaYILmCr4aA-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6990dbf027dso22961056d6.0 for ; Fri, 26 Apr 2024 10:56:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714154160; x=1714758960; 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=OIafYlqk1T0Kd9t4gYmevxtdISzPNCRawKM1p79lRGk=; b=pamU9c7YCOYbeBkN0j7qONxjUmTUXhBIzF+QriOPwguCgSg6GpRHCbr6ZBePH9Y8z+ n/20TP0PJqF0QSBy3qJWCGB+VEa2rJooE/CV9f3UuvGxWN3PvCD6CK5cmPbfIiMbsAOD YBiB9JX/653FgnaOiqN3OYx2VgWdmdD5sNfH9jbi0arAdPrdM2nxFtE028vL7iHEYysZ vUde2pgIMRUSjCtEuhD60M1nb0ubT31yl1O5HX5u3YaHR1jIpudmekcVVKiXVBWmVm7K x6Fh3+dtiddBtKE9k7W3L1tWPcTCCcNpiKYUXfVm721GtJRuMW4KzkfyQkfe/P8q/R4Y cJSg== X-Gm-Message-State: AOJu0YzfR1VZ10L14p0WnTp3LDJFZ4TIfprlvKGQASObuaTRn7r9qmSE e78860gmkSts2S5fZGnmYqnTvxuXtDGmIlywVo/u2iGuP3JK5rtzGZ4QuUwEo6WDqMcBN1/gdtr bhH1hQOfnGDlJShb4kNUlhxGl0MhJ+JEpy/oXGyEb3tMrLLDmD/ig6sRX6St4EckIScMxmqV9s5 J7P77oFrZup2Tg8I2EM3dFLQQrRbZMwQErVw== X-Received: by 2002:a05:6214:5188:b0:6a0:b6a9:39b0 with SMTP id kl8-20020a056214518800b006a0b6a939b0mr805638qvb.59.1714154159976; Fri, 26 Apr 2024 10:55:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJgy8Z4LbExZViJak+ZWIYZg6c+mXbJhrizYgQN9YYknlzHR6zs9w1jkNv9Fvr8CJIA6Gd7g== X-Received: by 2002:a05:6214:5188:b0:6a0:b6a9:39b0 with SMTP id kl8-20020a056214518800b006a0b6a939b0mr805612qvb.59.1714154159429; Fri, 26 Apr 2024 10:55:59 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 10:55:57 -0700 (PDT) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Fri, 26 Apr 2024 17:55:00 +0000 Message-ID: <20240426175501.858655-7-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 Subject: [ovs-dev] [PATCH ovn v7 6/6] northd: Remove unused nbrp arg in ls_port_reinit. 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" It's always NULL. Signed-off-by: Ihar Hrachyshka --- northd/northd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 2fef95f38..5e12fd1e8 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -4364,7 +4364,6 @@ ls_port_create(struct ovsdb_idl_txn *ovnsb_txn, struct hmap *ls_ports, static bool ls_port_reinit(struct ovn_port *op, struct ovsdb_idl_txn *ovnsb_txn, const struct nbrec_logical_switch_port *nbsp, - const struct nbrec_logical_router_port *nbrp, struct ovn_datapath *od, const struct sbrec_port_binding *sb, const struct sbrec_mirror_table *sbrec_mirror_table, @@ -4374,7 +4373,7 @@ ls_port_reinit(struct ovn_port *op, struct ovsdb_idl_txn *ovnsb_txn, { ovn_port_cleanup(op); op->sb = sb; - ovn_port_set_nb(op, nbsp, nbrp); + ovn_port_set_nb(op, nbsp, NULL); op->l3dgw_port = op->cr_port = NULL; return ls_port_init(op, ovnsb_txn, od, sb, sbrec_mirror_table, sbrec_chassis_table, @@ -4552,7 +4551,7 @@ ls_handle_lsp_changes(struct ovsdb_idl_txn *ovnsb_idl_txn, continue; } if (!ls_port_reinit(op, ovnsb_idl_txn, - new_nbsp, NULL, + new_nbsp, od, sb, ni->sbrec_mirror_table, ni->sbrec_chassis_table, ni->sbrec_chassis_by_name,