From patchwork Thu Mar 9 10:56:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1754580 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=pbP/8Yug; dkim=fail reason="key not found in DNS" header.d=true.cz header.i=@true.cz header.a=rsa-sha256 header.s=xnet header.b=AdeyDakg; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PXRHB5jsVz2469 for ; Thu, 9 Mar 2023 22:07:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=w5Lnt/gaGYLKoFHtNPg0jDf0WVDxu9xvoH0JXkLpfyA=; b=pbP/8Yug67DdBa x49MYUVpFXMlhuMxPWX87i211WKbiJfAVyNaT3BBslO30dXHjFJv/3YyCx7ynORud8rMff2y2NIaP CHEMKiUCSLQk1n9kZnD7t6WaScruqQscLb/4MX46C6RbSlqrSh/SJh9/1KfVZsrIEX3H0NsV2/oqJ V6/ddJNWEY5D3c3ViPPH3nRWHW/UwEYdPdj1Anjn9BS5xTyK7yYZ9jghD4TiynneSv/OnDW9MtajN Akqxv9Htka6s8MJicxhHIgqbM+oX1BoI6GTipTP/M3bKUT/3FBE7iUCkIW2BWsvyLB/dHtyd8y2rc lqKgS9LiVse3sKNwREjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paE44-009JCJ-TW; Thu, 09 Mar 2023 11:04:06 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paDx7-009GBh-VY for openwrt-devel@lists.openwrt.org; Thu, 09 Mar 2023 10:56:56 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id C33A73927; Thu, 9 Mar 2023 11:56:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=true.cz; s=xnet; t=1678359406; bh=4aOQu5KLacornvAGxDjATq7xj2C9+891B1MnGvaPfZk=; h=From:To:Cc:Subject:Date; b=AdeyDakgI5BmpTCXyoW0VmMIk+lqXKohokoHHAoJ+NvW/BPpICy46WrCDU/8rYdCr VMQNCHQ9rAUNh1noAINYrqW5gNJvyR3n3jCZmw6LTLNdSzeMYmW2WU8Pj8PW7byZH3 bh+yCjHCIy29KGnpdTQqWUxlrkEACHpT8EhhO98Q= Received: by meh.true.cz (OpenSMTPD) with ESMTP id 5e41c22c; Thu, 9 Mar 2023 11:56:20 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Subject: [PATCH netifd] bridge: make it more clear why the config was applied Date: Thu, 9 Mar 2023 11:56:42 +0100 Message-Id: <20230309105642.20365-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_025654_679470_5FD72965 X-CRM114-Status: UNSURE ( 8.37 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.2 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__In_some_cases_we_see=2C_that_the_bridg?= =?unknown-8bit?q?e_configuration_was_applied=2C?= =?unknown-8bit?q?_but_its_not_exactly_clear_why_it_was_done=2C_so_lets_add_a?= =?unknown-8bit?q?_simple_debugging?= =?unknown-8bit?q?_output_which_should_provide_currently_missing_clue=2E_Sign?= =?unknown-8bit?q?ed-off-by=3A_Petr_=C5=A0tetiar?= =?unknown-8bit?q?_=3Cynezz=40true=2Ecz=3E_---_bridge=2Ec_=7C_14_++++++++++--?= =?unknown-8bit?q?--_1_file_changed=2C_10_insertions=28+=29=2C?= =?unknown-8bit?q?_4_deletions=28-=29_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E2_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily?= =?unknown-8bit?q?_valid?= =?unknown-8bit?q?_0=2E1_DKIM=5FINVALID___________DKIM_or_DK_signature_exists?= =?unknown-8bit?q?=2C_but_is_not_valid?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org In some cases we see, that the bridge configuration was applied, but its not exactly clear why it was done, so lets add a simple debugging output which should provide currently missing clue. Signed-off-by: Petr Štetiar --- bridge.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bridge.c b/bridge.c index 7e61b9df8326..9ed7c985afef 100644 --- a/bridge.c +++ b/bridge.c @@ -1152,16 +1152,22 @@ bridge_reload(struct device *dev, struct blob_attr *attr) diff = 0; uci_blob_diff(tb_dev, otb_dev, &device_attr_list, &diff); - if (diff) - ret = DEV_CONFIG_RESTART; + if (diff) { + ret = DEV_CONFIG_RESTART; + D(DEVICE, "Bridge %s device attributes has changed, diff=0x%lx\n", + dev->ifname, diff); + } blobmsg_parse(bridge_attrs, __BRIDGE_ATTR_MAX, otb_br, blob_data(bst->config_data), blob_len(bst->config_data)); diff = 0; uci_blob_diff(tb_br, otb_br, &bridge_attr_list, &diff); - if (diff & ~(1 << BRIDGE_ATTR_PORTS)) - ret = DEV_CONFIG_RESTART; + if (diff & ~(1 << BRIDGE_ATTR_PORTS)) { + ret = DEV_CONFIG_RESTART; + D(DEVICE, "Bridge %s attributes has changed, diff=0x%lx\n", + dev->ifname, diff); + } bridge_config_init(dev); }