From patchwork Tue Jul 23 15:54:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1963957 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=Ujpw4DTm; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.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 4WT1tn5pBPz1ybY for ; Wed, 24 Jul 2024 01:54:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8052F40AFC; Tue, 23 Jul 2024 15:54:55 +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 2uQBmDPL7a6V; Tue, 23 Jul 2024 15:54:54 +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 smtp2.osuosl.org 4C40F40A48 Authentication-Results: smtp2.osuosl.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=Ujpw4DTm Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4C40F40A48; Tue, 23 Jul 2024 15:54:54 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1A02BC0A97; Tue, 23 Jul 2024 15:54:54 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 68AE1C0A96 for ; Tue, 23 Jul 2024 15:54:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 57F38401A3 for ; Tue, 23 Jul 2024 15:54:51 +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 RKlWL3sq2pUh for ; Tue, 23 Jul 2024 15:54:50 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=xsimonar@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 617EA401A6 Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 617EA401A6 Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Ujpw4DTm Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 617EA401A6 for ; Tue, 23 Jul 2024 15:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721750088; 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=hkShkfUxkW60Uk2r7gedKgKf9BtEcBygTSgd9HzOzHA=; b=Ujpw4DTm+62qbQNNjaGgz0MGu5Zn3CylH0KAbB4TqVxYWS3ZrqSSIZulbHi0G18u/TCyIL 3yXIqB+j+NBJXuP8CHP3XKHPFSzxIy5eSxMRsB2fTru8nyCKC9axNOAopn+0GNw/XX+u41 ooekYJyP2hVU4yRokz1yYVJfGyEys6s= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-583-XbsHq9LxOUCsCDeKzlx-Wg-1; Tue, 23 Jul 2024 11:54:47 -0400 X-MC-Unique: XbsHq9LxOUCsCDeKzlx-Wg-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4294B1955D5F for ; Tue, 23 Jul 2024 15:54:46 +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 mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AD6EC195605A; Tue, 23 Jul 2024 15:54:45 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Tue, 23 Jul 2024 17:54:38 +0200 Message-Id: <20240723155444.2530187-2-xsimonar@redhat.com> In-Reply-To: <20240723155444.2530187-1-xsimonar@redhat.com> References: <20240719153603.2914663-2-xsimonar@redhat.com> <20240723155444.2530187-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v2 1/7] controller: Add debug/dump-related-ports unixctl. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Signed-off-by: Xavier Simonart --- controller/binding.c | 12 ++++++++++++ controller/binding.h | 3 +++ controller/ovn-controller.c | 15 +++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/controller/binding.c b/controller/binding.c index b7e7f4874..97f4545a4 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -1037,6 +1037,18 @@ local_binding_set_down(struct shash *local_bindings, const char *pb_name, } } +void +binding_dump_related_lports(struct related_lports *related_lports, + struct ds *out_data) +{ + const char *name; + if (sset_count(&related_lports->lport_names)) { + SSET_FOR_EACH (name, &related_lports->lport_names) { + ds_put_format(out_data, "%s\n", name); + } + } +} + void binding_dump_local_bindings(struct local_binding_data *lbinding_data, struct ds *out_data) diff --git a/controller/binding.h b/controller/binding.h index 75e7a2679..f44f95833 100644 --- a/controller/binding.h +++ b/controller/binding.h @@ -202,6 +202,9 @@ void binding_tracked_dp_destroy(struct hmap *tracked_datapaths); void binding_dump_local_bindings(struct local_binding_data *, struct ds *); +void binding_dump_related_lports(struct related_lports *related_lports, + struct ds *); + bool is_additional_chassis(const struct sbrec_port_binding *pb, const struct sbrec_chassis *chassis_rec); diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c index d6d001b1a..a4714739e 100644 --- a/controller/ovn-controller.c +++ b/controller/ovn-controller.c @@ -99,6 +99,7 @@ static unixctl_cb_func debug_pause_execution; static unixctl_cb_func debug_resume_execution; static unixctl_cb_func debug_status_execution; static unixctl_cb_func debug_dump_local_bindings; +static unixctl_cb_func debug_dump_related_lports; static unixctl_cb_func debug_dump_local_template_vars; static unixctl_cb_func debug_dump_lflow_conj_ids; static unixctl_cb_func lflow_cache_flush_cmd; @@ -5310,6 +5311,10 @@ main(int argc, char *argv[]) debug_dump_local_bindings, &runtime_data->lbinding_data); + unixctl_command_register("debug/dump-related-ports", "", 0, 0, + debug_dump_related_lports, + &runtime_data->related_lports); + unixctl_command_register("debug/dump-lflow-conj-ids", "", 0, 0, debug_dump_lflow_conj_ids, &lflow_output_data->conj_ids); @@ -6220,6 +6225,16 @@ debug_dump_local_bindings(struct unixctl_conn *conn, int argc OVS_UNUSED, ds_destroy(&binding_data); } +static void +debug_dump_related_lports(struct unixctl_conn *conn, int argc OVS_UNUSED, + const char *argv[] OVS_UNUSED, void *related_lports) +{ + struct ds data = DS_EMPTY_INITIALIZER; + binding_dump_related_lports(related_lports, &data); + unixctl_command_reply(conn, ds_cstr(&data)); + ds_destroy(&data); +} + static void debug_dump_lflow_conj_ids(struct unixctl_conn *conn, int argc OVS_UNUSED, const char *argv[] OVS_UNUSED, void *conj_ids)