From patchwork Tue Apr 23 11:53:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1926502 X-Patchwork-Delegate: nusiddiq@redhat.com 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=cU91yweq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.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 4VP0rV5ytKz1yP2 for ; Tue, 23 Apr 2024 21:53:46 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4540A80002; Tue, 23 Apr 2024 11:53:40 +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 Sp9d2bH6aNMV; Tue, 23 Apr 2024 11:53:39 +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 232C5814A9 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=cU91yweq Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 232C5814A9; Tue, 23 Apr 2024 11:53:39 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DE85FC0DCE; Tue, 23 Apr 2024 11:53:38 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 713F3C0037 for ; Tue, 23 Apr 2024 11:53:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 604686060A for ; Tue, 23 Apr 2024 11:53:37 +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 1gvKYnHRlfpb for ; Tue, 23 Apr 2024 11:53:36 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=xsimonar@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 9F5B8605AA 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 9F5B8605AA 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=cU91yweq 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 9F5B8605AA for ; Tue, 23 Apr 2024 11:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713873215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hLN7z4Z4J3fYn+94BW9oe+jBvVH9KhQxiDkR6JTUm/s=; b=cU91yweqxM5flJ8LlcXjUnj75OXlmPpz2ryH03/Myn1xH9j6dQ6ljpTDKBHuQ4KFrtMiIL Yai4cYhKrh+82VJcAZhN2bQyST+Qp7xeDqSjww+4BN78dcDnOLWa11PsCsdvw4kPnOysy+ gdR00WDCjy51WGA1yut7w3UClQb2ShY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-56-_Q-OEp-UMeW5dRuZvJDGuQ-1; Tue, 23 Apr 2024 07:53:34 -0400 X-MC-Unique: _Q-OEp-UMeW5dRuZvJDGuQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ECE5F29ABA18 for ; Tue, 23 Apr 2024 11:53:33 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.anl.eng.rdu2.dc.redhat.com [10.6.38.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6D66400EB2; Tue, 23 Apr 2024 11:53:33 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Tue, 23 Apr 2024 13:53:29 +0200 Message-Id: <20240423115333.2796843-2-xsimonar@redhat.com> In-Reply-To: <20240423115333.2796843-1-xsimonar@redhat.com> References: <20240423115333.2796843-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 1/5] controller: Fix iface-id-ver handling. 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" If iface-id-ver was wrong and modified to a correct value, the port was correctly claimed, but the flows were not installed by I+P. Signed-off-by: Xavier Simonart Acked-by: Numan Siddique --- controller/binding.c | 14 ++++++++++++++ tests/ovn.at | 2 ++ 2 files changed, 16 insertions(+) diff --git a/controller/binding.c b/controller/binding.c index 8ac2ce3e2..c9658cb2a 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -757,6 +757,8 @@ update_active_pb_ras_pd(const struct sbrec_port_binding *pb, } } +static bool is_ext_id_changed(const struct smap *a, const struct smap *b, + const char *key); static struct local_binding *local_binding_create( const char *name, const struct ovsrec_interface *); static void local_binding_add(struct shash *local_bindings, @@ -2311,6 +2313,18 @@ consider_iface_claim(const struct ovsrec_interface *iface_rec, return true; } + /* Check if iface-id-ver just becomes correct */ + struct smap *external_ids_old = + shash_find_data(b_ctx_in->iface_table_external_ids_old, + iface_rec->name); + + if (external_ids_old && + is_ext_id_changed(&iface_rec->external_ids, + external_ids_old, + "iface-id-ver")) { + b_ctx_out->local_lports_changed = true; + } + /* If multiple bindings to the same port, remove the "old" binding. * This ensures that change tracking is correct. */ diff --git a/tests/ovn.at b/tests/ovn.at index e81cd4f45..f974cbb15 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -33239,6 +33239,8 @@ check as hv1 ovs-vsctl set interface vif11 external_ids:iface-id-ver=foo wait_for_ports_up sw0-port1 +CHECK_FLOWS_AFTER_RECOMPUTE([hv1], [hv1]) + AT_CHECK([as hv1 ovn-appctl -t ovn-controller debug/dump-local-bindings], [0], [dnl Local bindings: name: [[sw0-port1]], OVS interface name : [[vif11]], num binding lports : [[1]]