From patchwork Mon Jan 24 09:25:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhiram RN X-Patchwork-Id: 1583535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=20210112 header.b=euKwQcfz; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JjFWB3Gq7z9tD5 for ; Tue, 25 Jan 2022 03:17:26 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 6EE5D60D55; Mon, 24 Jan 2022 16:17:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id geeFO92VwmkD; Mon, 24 Jan 2022 16:17:23 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id A703960A4F; Mon, 24 Jan 2022 16:17:22 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5E2D4C0039; Mon, 24 Jan 2022 16:17:22 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 647A8C0073 for ; Mon, 24 Jan 2022 09:25:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 624E260B9F for ; Mon, 24 Jan 2022 09:25:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JAbFilW0T3G8 for ; Mon, 24 Jan 2022 09:25:37 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by smtp3.osuosl.org (Postfix) with ESMTPS id BD5C160B78 for ; Mon, 24 Jan 2022 09:25:37 +0000 (UTC) Received: by mail-pj1-x1031.google.com with SMTP id z10-20020a17090acb0a00b001b520826011so11542903pjt.5 for ; Mon, 24 Jan 2022 01:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XEa1CP/kyveBFll1GzIZeygI1yF9psPCtpvyzDAQLd0=; b=euKwQcfzuEXXr2vC7uE1AZQx2PNEHMeUHsqP9VmZJITLImcgMvLHi5kxE7ewEk2uAp 519SoqOKh9IaC/4bp+YbsINNXugyUyNNk/v5YFfiLEmaUGrdSXln28b8EVvugcdSkLJf luiCpiEwZH+jTPC3ckSUq3tfnLDjoDmgMXH4tl3W4A0+igV3uZ/epC68cU/rbrjHVUUJ jRKeK2zwFJGfcw9oJKLlmhV7qKmsJrr6pKTFh0DVjMrTXyZKV7sGmOAG2RCNyqubsjd3 Zo74o22aT9HmdMG5WVvCoYYfvzAZZ6wvSGKrA0Iu8Ms/ZfkTeMKlI1JOjsMSB1q82GFe W42g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XEa1CP/kyveBFll1GzIZeygI1yF9psPCtpvyzDAQLd0=; b=QDU9YaGXcQXedaehJCkccAujCs0UuR2/Ynr5U9hpByA6SzNpIyMfkT/C4VTFJRAcsh u/i+ANiEHnujQcnMGOM+btNqFG2YZiu+Gp6CEd0zIHALBVOvpTLO+mcgK3Y+EuC9iZOQ qvYuH2xp1fS+sJUGSLsd8/kgE3ON2Yr5nhXAsQasrkkA2zk0GTwTxlKydaJld93QVwSI cihV9iYuYUir1wmGvZBv7kD9RoiV0+OK83iq8Qjk3n7btNO1jpPrgXi97oswjq2sACS5 eK+6VWZoPui/u42cmbyIYnqI2PQ2wBA+W35uV6ahytJRjDynfaOe4OQQssda0hpd3L2A 3oXw== X-Gm-Message-State: AOAM531kUznhdmNGObh15ahysC//MT3ZLSI+kKYwsFMEwGHJ+ruudfj0 CjE4sCBNgnavR605jxjbikxKYYK2XxQ= X-Google-Smtp-Source: ABdhPJx0Hxfw1RmImKAuDx8ra6JgRSkjhOZAq+cVseaoKHTK6DKW1348P02BSXaBi4xd7WzTFCZrjQ== X-Received: by 2002:a17:902:9a4c:b0:149:7da0:b7ac with SMTP id x12-20020a1709029a4c00b001497da0b7acmr13818223plv.28.1643016336935; Mon, 24 Jan 2022 01:25:36 -0800 (PST) Received: from arn.com ([49.205.133.255]) by smtp.googlemail.com with ESMTPSA id a17sm11433991pgh.9.2022.01.24.01.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 01:25:36 -0800 (PST) From: Abhiram R N To: dev@openvswitch.org Date: Mon, 24 Jan 2022 14:55:23 +0530 Message-Id: <20220124092523.58669-1-abhiramrn@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 24 Jan 2022 16:17:21 +0000 Cc: arn@redhat.com, mleitner@redhat.com, Abhiram R N Subject: [ovs-dev] [PATCH] netlink-socket: Make log extack messages as ERR rather than DBG 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" Making the log extack messages as ERR rather than DBG will help debugging when we dont know for sure where is the issue. If it is DBG these useful log extack messages might get lost due to excessive logs. Also these error messages will be printed only when we enable it. netlink_socket(revalidator31)|DBG|Dropped 25 log messages in last 1 seconds (most recently, 1 seconds ago) due to excessive rate By checking for the log extack err_msg we are printing error message only when there is a valid log extack message present and other cases it will be still kept as DBG so that there is no spamming. Signed-off-by: Abhiram R N --- lib/netlink-socket.c | 10 ++++++++-- tests/ofproto-dpif.at | 2 +- tests/ovs-vswitchd.at | 5 +++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index 93c1fa561..435a5945f 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -920,9 +920,15 @@ nl_sock_transact_multiple__(struct nl_sock *sock, /* Fill in the results for 'txn'. */ if (nl_msg_nlmsgerr(buf_txn->reply, &txn->error, &err_msg)) { if (txn->error) { - VLOG_DBG_RL(&rl, "received NAK error=%d - %s", + if (err_msg != NULL) { + VLOG_ERR_RL(&rl, "received NAK error=%d - %s", txn->error, - err_msg ? err_msg : ovs_strerror(txn->error)); + err_msg); + } else { + VLOG_DBG_RL(&rl, "received NAK error=%d - %s", + txn->error, + ovs_strerror(txn->error)); + } } if (txn->reply) { ofpbuf_clear(txn->reply); diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index 1660b0856..5e7a4f125 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -6542,7 +6542,7 @@ m4_define([CHECK_SFLOW_SAMPLING_PACKET], dnl sleep long enough to get more than one counter sample dnl from each datasource so we can check sequence numbers ovs-appctl time/warp 2000 100 - OVS_VSWITCHD_STOP + OVS_VSWITCHD_STOP("/Unknown device type/d") OVS_APP_EXIT_AND_WAIT([test-sflow]) AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\ diff --git a/tests/ovs-vswitchd.at b/tests/ovs-vswitchd.at index bba4fea2b..95a12f609 100644 --- a/tests/ovs-vswitchd.at +++ b/tests/ovs-vswitchd.at @@ -117,10 +117,11 @@ bridge br0: using datapath ID OVS_APP_EXIT_AND_WAIT_BY_TARGET(["`pwd`"/unixctl2], [ovs-vswitchd-2.pid]) # check the fakelog, should not see WARN/ERR/EMER log other than the one -# for reporting the existing ovs-vswitchd process and the one for killing -# the process. +# for reporting the existing ovs-vswitchd process , the one for killing +# the process and a log extack message saying NAK error. AT_CHECK([sed -n " /|ERR|another ovs-vswitchd process is running/d +/|ERR|received NAK error/d /|WARN|/p /|ERR|/p /|EMER|/p" fakelog