From patchwork Wed Sep 9 19:20:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1360970 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=bCyGh85l; 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 4BmsLN5Qd8z9sTN for ; Thu, 10 Sep 2020 05:20:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A44E6872D5; Wed, 9 Sep 2020 19:20:40 +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 kXcJ4D6Endyh; Wed, 9 Sep 2020 19:20:37 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 879388732E; Wed, 9 Sep 2020 19:20:32 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 79902C0893; Wed, 9 Sep 2020 19:20:32 +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 C9243C0051 for ; Wed, 9 Sep 2020 19:20:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B55A28748B for ; Wed, 9 Sep 2020 19:20:30 +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 2yBbH0hYGoKF for ; Wed, 9 Sep 2020 19:20:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by hemlock.osuosl.org (Postfix) with ESMTPS id 5156887460 for ; Wed, 9 Sep 2020 19:20:30 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id o16so1828517pjr.2 for ; Wed, 09 Sep 2020 12:20:30 -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=bCyGh85lMqE3tOOAUHYpv1hm+MpEu2tj96zamobR1wD5buiD1Q0iWvpSb+etNLjrGz VQti15rWksG7qCMo6ymj0kSx5H7/f+OjjOFCEJcnmDjgjF6/GOmkeTvzgYZxB/tBzuz8 nJQ9RN3szbGkDEKXo9JMHGqmWrT8JpfT0PejNnh27yOcbQ2Fh4JK4Yh8+dw4tM/N1XRx gvOm2sLALQ/iuSiNi89XiFjg78ruMRTsemCynJR1P91VtZlD8N6YkV1nqxvjM3vaputu Xuq1gJFNjqBtqfL4cI4OTjEhTmJHWRGnEeDMdIERO8a24I0QJ6Cn/WxpZzznYRwG6b2L lKRg== 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=HHj2vaJyy80a9ltB/2/rxhHUpXcH8wt+LUK4pmUocxJ0KdBOnqp149Ol46OqddmToS fIQDg+jotzh7E2W6ocTGheDbtUdJNVevPKbnvtvoRQVBYuCpYKcdPzDlDDGwG9/4BmgP 3Fb1GAtqx5qticEc32tPEx2RFmfaeERQxatSJdSu+WP+qM4Mpl3tnTYLl1s1mN5gRbNC eWsDncbRF8Os6AeGU9oBhEdYpT39vtXODKDChP2uGfuWBqbHP7CIg1khpCx9SeRXIK9H moKz1p36eQ9r15xNnF3TukIpqwgooaw6kr1ZLGS9+IEg24XOGFdPPYy+juFd1fN1MZil S+uA== X-Gm-Message-State: AOAM533JCZn1DZfuTQBrkvGsYhuDG5lZn/BQg0L0G8LMrEUE8mVbWZHl 676dFKEdstdf6cEMQgaLIzg+mBOF0YqdMw== X-Google-Smtp-Source: ABdhPJw0SpT/B0Qh6HgBp2158VMHjF9+3ves1zTGweuFjqyergFkabS/KsNALmolWCQn0HQ2KxX3hQ== X-Received: by 2002:a17:90a:5884:: with SMTP id j4mr2049628pji.217.1599679229558; Wed, 09 Sep 2020 12:20:29 -0700 (PDT) Received: from VMware-box.domain ([97.115.183.169]) by smtp.googlemail.com with ESMTPSA id x29sm2866338pga.23.2020.09.09.12.20.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 12:20:28 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Wed, 9 Sep 2020 12:20:01 -0700 Message-Id: <20200909192021.9545-5-gvrose8192@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200909192021.9545-1-gvrose8192@gmail.com> References: <20200909192021.9545-1-gvrose8192@gmail.com> Subject: [ovs-dev] [PATCH v2 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 --- 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;