From patchwork Tue Apr 9 12:36:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1921374 X-Patchwork-Delegate: dceara@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=BnwwiE46; 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 4VDQSY4PdSz1yZg for ; Tue, 9 Apr 2024 22:36:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id A346960BDC; Tue, 9 Apr 2024 12:36:43 +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 oHQKXvXALMLN; Tue, 9 Apr 2024 12:36:42 +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 B815160850 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=BnwwiE46 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id B815160850; Tue, 9 Apr 2024 12:36:42 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A594AC0077; Tue, 9 Apr 2024 12:36:42 +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 E63A9C0037 for ; Tue, 9 Apr 2024 12:36:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C23EC81F64 for ; Tue, 9 Apr 2024 12:36:41 +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 sV6uZoLm-IIt for ; Tue, 9 Apr 2024 12:36:41 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=amusil@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 11E5E8148F 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 11E5E8148F 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=BnwwiE46 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 11E5E8148F for ; Tue, 9 Apr 2024 12:36:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712666199; 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=L3dYW3aLmdp8Jq/2exP5e/qS355+TAKP4eskShoaN0s=; b=BnwwiE46etWITlpxy40vm9JCu4Vh3FUtB02Ht/s5P90gCfAaLBvi+1+WMyT/onXZypkzeh Q/QGlATNJNf0F0unMKNTT85VJ7W8tECPiARR4ZOetUv3Cgw0y7mWmQSUhelAMtfr+hd295 4OcaHF3OLQZUbHhvSQMSjmSLX+iAeNo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-572-VssIO_2JOQCfx-KqzmCMPQ-1; Tue, 09 Apr 2024 08:36:38 -0400 X-MC-Unique: VssIO_2JOQCfx-KqzmCMPQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 6B184811007 for ; Tue, 9 Apr 2024 12:36:37 +0000 (UTC) Received: from amusil.brq.redhat.com (unknown [10.43.17.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC7D5400D5D3; Tue, 9 Apr 2024 12:36:36 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Tue, 9 Apr 2024 14:36:36 +0200 Message-ID: <20240409123636.897461-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] ovn-trace: Make sure we don't exit when the port is not specified. 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 might happen that the microflow doesn't have port specified or the port is part of different datapath. In that case ovn-trace would print warning and move to later crash on assert. Exit early instead of crashing on assert. Signed-off-by: Ales Musil --- utilities/ovn-trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/ovn-trace.c b/utilities/ovn-trace.c index e0f1c3ec9..bfc94a73f 100644 --- a/utilities/ovn-trace.c +++ b/utilities/ovn-trace.c @@ -3540,7 +3540,7 @@ trace(const char *dp_s, const char *flow_s) } uint32_t in_key = uflow.regs[MFF_LOG_INPORT - MFF_REG0]; if (!in_key) { - VLOG_WARN("microflow does not specify ingress port"); + return xstrdup("microflow does not specify ingress port"); } const struct ovntrace_port *inport = ovntrace_port_find_by_key(dp, in_key); const char *inport_name = inport ? inport->friendly_name : "(unnamed)";