From patchwork Fri Jul 19 15:35:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1962539 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=Nk+wST23; 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 4WQYgC3SRtz1ySl for ; Sat, 20 Jul 2024 01:36:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B054082103; Fri, 19 Jul 2024 15:36:15 +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 hAKYDeRDE6TG; Fri, 19 Jul 2024 15:36:14 +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 A316482105 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=Nk+wST23 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id A316482105; Fri, 19 Jul 2024 15:36:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5B3ADC0A9B; Fri, 19 Jul 2024 15:36:12 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id CFD93C0A96 for ; Fri, 19 Jul 2024 15:36:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B366680DE8 for ; Fri, 19 Jul 2024 15:36:09 +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 ZxnEx4aRLUvg for ; Fri, 19 Jul 2024 15:36:09 +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 smtp1.osuosl.org D56DF80DB8 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 D56DF80DB8 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 D56DF80DB8 for ; Fri, 19 Jul 2024 15:36:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721403367; 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=Nk+wST232KjAeZZ/s0zsMrzVuiYUDjZGJUWwJVy7nDPYikGQfI6n1PIDhmE6JaTjGzcKrJ vI/iC0lXVb8kUyZdO8CapIpV76sDqqYndtr74ConLNccBa6FR+OYdUvUk4w9seOxXDzh72 9r4T3PuTB4PsbZ0xygI3gKp2FgpXytg= 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-46-7vZ9wfACPPGNbmmODxFB-Q-1; Fri, 19 Jul 2024 11:36:06 -0400 X-MC-Unique: 7vZ9wfACPPGNbmmODxFB-Q-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 3ED171955F43 for ; Fri, 19 Jul 2024 15:36:05 +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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A42251955D4D; Fri, 19 Jul 2024 15:36:04 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Fri, 19 Jul 2024 17:35:57 +0200 Message-Id: <20240719153603.2914663-2-xsimonar@redhat.com> In-Reply-To: <20240719153603.2914663-1-xsimonar@redhat.com> References: <20240719153603.2914663-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 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)