Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp111820lqj; Wed, 10 Apr 2024 05:50:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVy0k5c8z48OK5ofmqcaIlOt09SxXhT5RUPDuE3jOj98BrM5VN0bgA/Gq+yr1pkTxlcg7BDcyznPonB+hZDqlvr/ilGgoAiXuotGYO2aA== X-Google-Smtp-Source: AGHT+IHK696sksQdHp47ih1zIUImyFzliEGFFXMTio1dChNxgMpnPf5V24g/g9Son+0ZATZqqU89 X-Received: by 2002:a05:6358:228f:b0:183:7f41:8c10 with SMTP id t15-20020a056358228f00b001837f418c10mr2153956rwb.31.1712753448962; Wed, 10 Apr 2024 05:50:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712753448; cv=pass; d=google.com; s=arc-20160816; b=Nngf23rHmOrpVKaXTIPB2S7Nvd9AmMiaAEuoxxj1p1aC/gvNmO8mYbm5IWC8fDhYln Rsh1AjJUh8m6TowsINGi8FOqP4ybPXLIPw6+TXRleiDvIE0gRCcOHiALkTdnj1U6YuZr ySCk5mSAyySgG4seta1KRH4l0JEaC53RCiDFDJujHiS1jw8wtithnjqMA4CenehUls7i g3dPNssWAgB6xj1/y+yAB2sCgVhj+LjbNV0GAiVQJIXpt6lTus8HjBdC16yhkMPTZ+kW Ua4MEk7Ly80c+Izleo1JzJIpmGUu+cE0237lynhp48jiihw6JVZSDv7p++JEibkaoEgB cAFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SoSZEGve+s5t8k0cVonVLJJcTb59TwfC12mY12O7vPI=; fh=mwymctgmpXTJ6jbTT3IKW+2R92NJaC2x2dkyIeCQ+/c=; b=HE5S5wjlVqCSsNjmV5w0KYAwdQWSAMrQxMkqe/THVwHOR3o3P7GJFl6ha+IfunUuR4 01llJzbmw80xnFogvOlb3QPDF0HcPUKanObF2TsRky2pMg6Hm7dIWoQRgcNI4tUmeylR YFQfiO37nmhM0UhxGxwsksmhRt1AdJVVKPfXBVAeWhDuSMuIjVknD7TAUlHyQAd2J4ES i5yTt5qKyufB7PQzWnu9fuj43NPZKOHqvqW6ZCiBSh1HdDqCyswryz9ljuegb5mlmirT 3THOokXiPxFIB0mfgRvQSypFjwXflwyyyN8x+z5UMAUsKUm35Q4CAJ/0Y/4YTFMtNCpF kiAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=HQpO3gwE; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-138516-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138516-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u11-20020a63df0b000000b005e468bd4cadsi10857737pgg.787.2024.04.10.05.50.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 05:50:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138516-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=HQpO3gwE; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-138516-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138516-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 57E7CB22D7E for ; Wed, 10 Apr 2024 12:42:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D29A15B0EA; Wed, 10 Apr 2024 12:42:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="HQpO3gwE" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5B1B158A0E; Wed, 10 Apr 2024 12:42:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712752939; cv=none; b=ogsg5IG1CGikyFYOrqVCF57eXm1/dk5PeDgBF7CyOtTVcUffEhlwI3ibcwnLhKFr1+Dvy4FGeKyRcY6JXEAItRsh5vwVE4ndWrV2RKFLXzxCnFb/jpf7ITCpgNEZxyHcKcmGvuVPa8bzoEJosmNM6hjzcQvSmWAGqcYjXFjSMek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712752939; c=relaxed/simple; bh=GMjLD7SrG5OMOHBq4gNh8kcYTqr3qX6bK7WATxsuZmw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aM+8g2Ez5OLepaYKmYMX2LFXPtqrmjaWz75yU8wQqyOUaAYlwUO/r2Vp5l+d9J78KMir4SgzlnEzcHW6E8ILnDFCL88E5d7ndtT+MTMasc/yCFZutlluRu/96NGryXPa/soDQRpA3lsNje/1HUrzIKHyWGJ36eN/EbtIWbagCXs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=HQpO3gwE; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=SoSZEGve+s5t8k0cVonVLJJcTb59TwfC12mY12O7vPI=; b=HQpO3gwEqMugshjrtccT1UNovt ATwKjSsZUwc3haLkrpAML1vw7N0mAtGRLw/E8TD146xGcratbz+LEiWHD1gYEVOn0jLPOT/JAnYiF WwQ5FACtKesKEIKsvKR7STFdjYHNV8S26wlTHqVeuzVN2p+noIOtzoLRJuUIGlQTCXd8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1ruXH6-00CfUH-35; Wed, 10 Apr 2024 14:42:00 +0200 Date: Wed, 10 Apr 2024 14:42:00 +0200 From: Andrew Lunn To: MD Danish Anwar Cc: Diogo Ivo , Rob Herring , Dan Carpenter , Jan Kiszka , Simon Horman , Wolfram Sang , Arnd Bergmann , Vignesh Raghavendra , Vladimir Oltean , Roger Quadros , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, srk@ti.com, r-gunasekaran@ti.com Subject: Re: [PATCH net-next v3 3/3] net: ti: icssg-prueth: Add support for ICSSG switch firmware Message-ID: <0039b9d9-9dc5-4b88-99f0-92f275b0b4d3@lunn.ch> References: <20240327114054.1907278-1-danishanwar@ti.com> <20240327114054.1907278-4-danishanwar@ti.com> <27d960ed-8e67-431b-a910-e6b2fc12e292@lunn.ch> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: > I have been working on this and have found a way to change firmwares > without bringing the interfaces up / down. > > By default the interfaces are in MAC mode and the ICSSG EMAC firmwares > are running on pru cores. To enable switch mode we will need to stop the > cores and reload them with the ICSSG Switch firmwares. We can do this > without bringing the interfaces up / down. > > When first interface is added to bridge it will still run emac > firmwares. The moment second interface gets added to bridge, we will > disable the ports and stop the pru cores. Load the switch firmwares on > to the cores, start the cores and enable the ports. All of this is done > from the driver. > > The user need not to bring the interfaces up / down. Loading / Reloading > of firmwares will be handled inside the driver only. But we do need to > stop the cores for changing firmwares. For stopping the cores we will > change the port state to disable by sending r30 command to firmware. > > As we are not restarting the interfaces, the DRAM, SMEM and MSMC RAM > doesn't get cleared. As a result with this approach all configurations > will be saved. > > Please let me know if this approach looks ok to you. > > Below will be the commands to enable switch mode now, > > ip link add name br0 type bridge > ip link set dev eth1 master br0 > ip link set dev eth2 master br0 (At this point we will stop the > cores, reload switch firmware, start the cores) > ip link set dev br0 up > bridge vlan add dev br0 vid 1 pvid untagged This sounds a lot better. Note that the bridge interface br0 might already be up when the interfaces are added. So that is a different order to what you showed here. There will be some packet losses when you swap firmware, but it probably is not that bad. When interfaces are added to a bridge packets are dropped anywhere while spanning tree determines the network topology. It will just appear your device is slow at doing that. Andrew