Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2555390lqo; Tue, 14 May 2024 02:13:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUlPIr79yUCZfiwmDBca96a5Cfa3YDQ9wd/qClILnbN/ZZCXmoAQOK7POXWFxjqAW6mQ63qwDvY21C0M27P0gONZyYdWbwMjvaJvSDkhw== X-Google-Smtp-Source: AGHT+IF40Z3gknca408KcS5nq6BRHcdIETyktk+jEOI4aH7rNo3NV9jtJQQWUXJsSnCAus0Idt3H X-Received: by 2002:a05:6a00:98b:b0:6f4:7297:7bd with SMTP id d2e1a72fcca58-6f4e037d1c7mr12255876b3a.28.1715678017756; Tue, 14 May 2024 02:13:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715678017; cv=pass; d=google.com; s=arc-20160816; b=SdQ8ANd8O8p3H1x95G0FQ0nQOFGHYmfg/xHshCWuLrt+D4PfbAFr3jHtoSe97ftAPW 8LyrIMdhwKxak99K/lEZRfR6hE6tjaEKFQKnPX2OBBjVu1lFAIqc96Xl7jMJjXXFroWA AjorwtplCRqFxOAKexTrahqC8F5EicRq7FgFTSx4776wzTgfxirPPxFLzF5JGP2RIlKW nDYqugNhrUkoJWfKGMvfsaW2dQL4BPDJAS8aywGDNIAmtxo0bZI4/tfWem/gGErg0h1C cPtFa28YIvZm3qL6PgWnuQpy3B/iD3xkAEWw6zwrJwY97p5naUDMuSwem/GUKUIsssNd 0lTQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=uo2Z30cLQBXU/idKopCpSV4pE9+tgaq/9xcBaJbOqgU=; fh=1mt8231HWZ/Y51KImdA2KNpFb/KKi6WQnTcuki7Yj+o=; b=jZioF5HNDJqQA5Gkizl6Zgqp1Dkc7h8Z2lsJLE+wM1WSilHGE2ZTdlPq0dRyIwkSrv kZd8jJeZvAC+JF6KMehVHHVAytd7HpF7sSUOL06uyg+SvZNVZa547Y7984j8W0UT6/E3 sCi5MmhWA68kAyx1Y89Pk5Wl9Kv7nyhcD0xITOYnP0/UrXHzqUMJ5M5fxna/5Fkj63KW um0xR6m3YtOzqxmRBVNM/qIe4J1AEO7eFCLxuye6MFV7G2mzvJse1UA5caH5rogltA1l NjaALmplLp7xKTOw3RRX2vh8OIiqCRrYcOdMQvbXYIeWYgIE+DEyVu+SJHgBlLloUDXA zmfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=vnM7OYNI; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-178491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178491-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4fa906420si5289611b3a.361.2024.05.14.02.13.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 02:13:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=vnM7OYNI; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-178491-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178491-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A6185B209CF for ; Tue, 14 May 2024 09:13:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6493628E11; Tue, 14 May 2024 09:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="vnM7OYNI" Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7FCF208CE; Tue, 14 May 2024 09:13:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715678005; cv=none; b=VWp1bXUkRFUgW8lY7N/HJVbJ+CYICho3L8wbV4oYireD/Ht29wjGD4MGZza/1BWDUCCKebUhnf57xZ0SMeZ+5csdyOcZRnXardX2WdH2QrjA30x+OuKKhahbx9BkkkloNMOk25fcRx3opSYS8HGmMjcV3OlcsQDLoO6SlXn8nSI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715678005; c=relaxed/simple; bh=thgfflq3vyytkFirvfAMIlSAofGiCK0BkXWApSixBZ4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WgROkwx6G4QCp4Df0EteGFP1u18Bzbu4FGAnbLQWd0sJmfmDKTwZPBp9e2A0h68D9hiMoh7CrziUaiskgDW8oRQAMzs6OHzjwviN2FlKH1EKC2/nf4If6kl2OyIpcdiyNxIrM8Um/6WnRXWfbKZuq+CSwcUGWBeomn7vg3ZEJHU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=vnM7OYNI; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 4F05288291; Tue, 14 May 2024 11:13:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1715678000; bh=uo2Z30cLQBXU/idKopCpSV4pE9+tgaq/9xcBaJbOqgU=; h=From:To:Cc:Subject:Date:From; b=vnM7OYNI4t24ZKK3i1Wi4E//MRMGxO+cJ96r1Tn8YiCRRIGYrAMMMVdDIg4xsuFry zMhPzOJ4c8JEYmt1e7ITm4aaOc8OiGBhDCUlJ4D8itYVJ9iVTybZDBReO3akVAnlth vo2cEUqb82PTN2rg+NG7nWIxeOYYhakM9jvQNAdc/we/iXkWg+ejaH5HWIEnPeJJqJ 4VeG8FcACxDfDWAOBKXw8iFqH5p97Y48Ooi6UeOYHoh8/HC5CqXn0PSW+HparRbI7+ OchEa6iDmZILT+htaaHBJdan9qjvLa6vIDtFmqiD3k1GTddzSuhJB1ZYAGuxHyFlyi TWL2ltvdj3sQQ== From: Lukasz Majewski To: Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni Cc: Eric Dumazet , Vladimir Oltean , "David S. Miller" , Oleksij Rempel , Tristram.Ha@microchip.com, Sebastian Andrzej Siewior , Ravi Gunasekaran , Simon Horman , Nikita Zhandarovich , Murali Karicheri , Arvid Brodin , Dan Carpenter , "Ricardo B. Marliere" , Casper Andersson , linux-kernel@vger.kernel.org, Lukasz Majewski Subject: [PATCH] net: hsr: Setup and delete proxy prune timer only when RedBox is enabled Date: Tue, 14 May 2024 11:13:06 +0200 Message-Id: <20240514091306.229444-1-lukma@denx.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The timer for removing entries in the ProxyNodeTable shall be only active when the HSR driver works as RedBox (HSR-SAN). Moreover, the obsolete del_timer_sync() is replaced with timer_delete_sync(). This patch improves fix from commit 3c668cef61ad ("net: hsr: init prune_proxy_timer sooner") as the prune node timer shall be setup only when HSR RedBox is supported in the node. Signed-off-by: Lukasz Majewski --- net/hsr/hsr_device.c | 2 +- net/hsr/hsr_netlink.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index e6904288d40d..d234e4134a9d 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -589,7 +589,6 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], timer_setup(&hsr->announce_timer, hsr_announce, 0); timer_setup(&hsr->prune_timer, hsr_prune_nodes, 0); - timer_setup(&hsr->prune_proxy_timer, hsr_prune_proxy_nodes, 0); ether_addr_copy(hsr->sup_multicast_addr, def_multicast_addr); hsr->sup_multicast_addr[ETH_ALEN - 1] = multicast_spec; @@ -629,6 +628,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], hsr->redbox = true; ether_addr_copy(hsr->macaddress_redbox, interlink->dev_addr); + timer_setup(&hsr->prune_proxy_timer, hsr_prune_proxy_nodes, 0); mod_timer(&hsr->prune_proxy_timer, jiffies + msecs_to_jiffies(PRUNE_PROXY_PERIOD)); } diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index 898f18c6da53..c1bd1e6eb955 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c @@ -129,8 +129,9 @@ static void hsr_dellink(struct net_device *dev, struct list_head *head) struct hsr_priv *hsr = netdev_priv(dev); del_timer_sync(&hsr->prune_timer); - del_timer_sync(&hsr->prune_proxy_timer); del_timer_sync(&hsr->announce_timer); + if (hsr->redbox) + timer_delete_sync(&hsr->prune_proxy_timer); hsr_debugfs_term(hsr); hsr_del_ports(hsr); -- 2.20.1