From patchwork Thu Aug 20 22:49:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1348656 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.138; helo=whitealder.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=jIUYQZVc; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BXfxm5ZgCz9sPf for ; Fri, 21 Aug 2020 08:50:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8C50988554; Thu, 20 Aug 2020 22:50:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lDmRZ4snBx0C; Thu, 20 Aug 2020 22:50:29 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 231B18846E; Thu, 20 Aug 2020 22:50:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 05FCBC0894; Thu, 20 Aug 2020 22:50:13 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4F7DEC0051 for ; Thu, 20 Aug 2020 22:50:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2BC6D8852F for ; Thu, 20 Aug 2020 22:50:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xfLvkYPnS33k for ; Thu, 20 Aug 2020 22:50:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by hemlock.osuosl.org (Postfix) with ESMTPS id 0DB978854C for ; Thu, 20 Aug 2020 22:50:11 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id k13so1591434plk.13 for ; Thu, 20 Aug 2020 15:50:11 -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=TTFnTuoJGZe/16btTXbXcmPFwjRNb/PSLx6UBh4ze7U=; b=jIUYQZVcwPLTt5fviQsvWDoZmvTYpTAEAjAVFAb7uYtpLjnMPTbPb7hqq9N+bb0BL2 fZf0EdjQCv52tUZV3uVmpETdKhmueZp5QOL0L7a9tvx5Cg24lZwgXL2nSxSm4jI56fHo yGWQ8Xo/jD95c2hiwacdA810BwNpw3hfIk2mRHF6pX2tv96D1nYO8bOysounycUHWNrb 5g7qB0SxGdvd5gN7IYhgGfigZmOgbmd7HwNcKiBW5YlqpJceFRjKyjTo33Y/J5SpGu7h oXwfaC/F0mg6km4rk5Xw36KEpLMmMNindsncghAgklCzLYSU+ShX1MnSTcTU028AdhLw Sw9A== 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=TTFnTuoJGZe/16btTXbXcmPFwjRNb/PSLx6UBh4ze7U=; b=F7OSa/88Y/lhHUuLWYM/BSi2QzOW9WNUNuMYtOxfBt8wOVUYF1qJSGXkxye8tm8DNJ 4FUs3mD++x+Ozmuu4dp8ST03Bmd0xxD6EeIAdJiDwBJvqQXaRgMI/+glh3KkAH1BD3nM IhZE7u/HDiv+ZtjVf04jYnV61DlPl20yK0oaWpjQDYQDNzDIGiieE8wuzleAyppTynA1 6hIzegJYcLmLofFxkIAshWA0fALaUwVVxpcJNg+RkDQG8Qy0masSnst89FiLGagQjOOs bOOKtviosAC0Tsa4L0Jyd41qa2iSyKoCLTRj+O6xNnkuCbBMvWMNW9mlvAqH2ECsyG0d 7tew== X-Gm-Message-State: AOAM530ziwDmJSARbtUHe51iV6dILF27UoJaSixkf9jkBZvK48NqnBPy 2gctRDUiCtii7ogz94SK9r+mVO2svD8fLw== X-Google-Smtp-Source: ABdhPJxLMTWJpaJPt2+SWfsFGhKAzdjkbyLNDxoh7OGd/UVonkVOFCIbMIk01w9dDFF2Z228HdbBjw== X-Received: by 2002:a17:902:6f01:: with SMTP id w1mr10818plk.49.1597963810093; Thu, 20 Aug 2020 15:50:10 -0700 (PDT) Received: from gizo.domain (97-115-99-106.ptld.qwest.net. [97.115.99.106]) by smtp.gmail.com with ESMTPSA id y6sm116866pfr.61.2020.08.20.15.50.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2020 15:50:08 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Thu, 20 Aug 2020 15:49:32 -0700 Message-Id: <1597963790-12362-6-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1597963790-12362-1-git-send-email-gvrose8192@gmail.com> References: <1597963790-12362-1-git-send-email-gvrose8192@gmail.com> Subject: [ovs-dev] [PATCH 05/23] 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 Signed-off-by: Greg Rose Reviewed-by: Yifeng Sun --- datapath/datapath.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 2879f24..c8c21d7 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;