From patchwork Wed Sep 16 17:32:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1365747 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NgzIV/VF; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BsJxy2wBlz9sVh for ; Thu, 17 Sep 2020 11:18:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 05C378086E; Wed, 16 Sep 2020 17:33:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0kwcCwFLkEyo; Wed, 16 Sep 2020 17:33:31 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0014386B98; Wed, 16 Sep 2020 17:33:26 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B1843C0891; Wed, 16 Sep 2020 17:33:26 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id C52C2C0051 for ; Wed, 16 Sep 2020 17:33:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A97272E0D6 for ; Wed, 16 Sep 2020 17:33:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9tY+f-QnO4+M for ; Wed, 16 Sep 2020 17:33:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by silver.osuosl.org (Postfix) with ESMTPS id ED2812DEA1 for ; Wed, 16 Sep 2020 17:33:19 +0000 (UTC) Received: by mail-pg1-f181.google.com with SMTP id l71so1806982pge.4 for ; Wed, 16 Sep 2020 10:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Dj8SsE9H2iURXj86A8sFz/qWEf1tERJE1N/MZAc7WnU=; b=NgzIV/VF9D0mc8U6lG4u8JNpWk3WnDpHlEgrKipA8he8CzLZdDG0iEzVOh02mc2IS4 bvqfZUNY6VL5ESG1u/5HPDGsB9QFU6nzyo72HfUjDUnTSBjU3RN6HLOmiAJlfpYAHjBw Eaveg5qcd8Qi4LLvrLLWPkL25nXfJ+I68+dpOpSWV2YSU2hrwOCoDAxjlQpjYZUhxftg KhgoTHSWPbnNF9jkBZK7VuFZsA6vdnnTEDsQR+eFqosBPIK+yL/Yy8+UiVxT4xCXWdUm 5EzA5PiYFKllRe8p2LWMOihLBlnsS88C50LeC1jr5tjOyD4kbESHQ9QCIX75wL2qi7u6 Z5+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Dj8SsE9H2iURXj86A8sFz/qWEf1tERJE1N/MZAc7WnU=; b=a+TumylxsYgWwSSOc4jp233mq+2Ta/m2J4cK5Gs+xUOhBiik3Ux01okw6cmmbYCzgC NQpBJCf7WiSkFe0oFvhRqNYUk/NuyStvFNlgwenmdqMS6zTpngYERgHfejy0x2/P6pPm 3di4+tpCWteiBM3lvGakdEqDoMcVt4YXZXt8CK7H4cHpl5GSTvR2/nSyqC8JMt3rmR86 2kHFzA63gR7Og8U+MWInCGV9iLyM6lkIBv7qdsvW6ps8LeHIeECgLqeFMEJ/PlGAn05k zTH3PfT6wi5xxTiDK7+6V0DWFxQrrHy3eza5VqdaexVQFUul2QzpbDlQJcqrWFDcGHEC DqAg== X-Gm-Message-State: AOAM532OJfGMWUey8BDTZqO39sKFp3GBdQVZFBGXxlvEcqzx3M+Ehm+n 251xUb9+2FH9O8iJM2rtCAuDGq5aC4Wh6w== X-Google-Smtp-Source: ABdhPJw1x+38/1mtDigyAQSS81xu/Dqr/opG0mM4sWTGsyZkXoAXNCS8pUkZFUHpvejeDG0CzDKXUg== X-Received: by 2002:aa7:9522:0:b029:142:2501:3986 with SMTP id c2-20020aa795220000b029014225013986mr7511333pfp.75.1600277599106; Wed, 16 Sep 2020 10:33:19 -0700 (PDT) Received: from VMware-box.domain ([97.115.183.169]) by smtp.googlemail.com with ESMTPSA id o20sm16248519pgh.63.2020.09.16.10.33.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 10:33:18 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Wed, 16 Sep 2020 10:32:51 -0700 Message-Id: <20200916173311.30956-5-gvrose8192@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200916173311.30956-1-gvrose8192@gmail.com> References: <20200916173311.30956-1-gvrose8192@gmail.com> Subject: [ovs-dev] [PATCH V3 04/24] datapath: Print error when ovs_execute_actions() fails 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Yifeng Sun Upstream commit: commit aa733660dbd8d9192b8c528ae0f4b84f3fef74e4 Author: Yifeng Sun Date: Sun Aug 4 19:56:11 2019 -0700 openvswitch: Print error when ovs_execute_actions() fails Currently in function ovs_dp_process_packet(), return values of ovs_execute_actions() are silently discarded. This patch prints out an debug message when error happens so as to provide helpful hints for debugging. Acked-by: Pravin B Shelar Signed-off-by: David S. Miller Cc: Yifeng Sun Reviewed-by: Yifeng Sun Signed-off-by: Greg Rose Acked-by: Yi-Hung Wei --- datapath/datapath.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 2879f24ef..c8c21d774 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -240,6 +240,7 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key) struct dp_stats_percpu *stats; u64 *stats_counter; u32 n_mask_hit; + int error; stats = this_cpu_ptr(dp->stats_percpu); @@ -248,7 +249,6 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key) &n_mask_hit); if (unlikely(!flow)) { struct dp_upcall_info upcall; - int error; memset(&upcall, 0, sizeof(upcall)); upcall.cmd = OVS_PACKET_CMD_MISS; @@ -265,7 +265,10 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key) ovs_flow_stats_update(flow, key->tp.flags, skb); sf_acts = rcu_dereference(flow->sf_acts); - ovs_execute_actions(dp, skb, sf_acts, key); + error = ovs_execute_actions(dp, skb, sf_acts, key); + if (unlikely(error)) + net_dbg_ratelimited("ovs: action execution error on datapath %s: %d\n", + ovs_dp_name(dp), error); stats_counter = &stats->n_hit;