Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp289246lqn; Fri, 12 Apr 2024 01:08:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYtbO2SO8O4w/a1NNPZk/exzU4N4R2BVhdriTkosBLo0SPVdePFVVaurI05tnAcomf0eIRbGFY3Hf6/CQ2feAhU3tG8wGRV9aDePBZAg== X-Google-Smtp-Source: AGHT+IHGxZPj4+CRqEDAzsvMxG1sHs9sT25qLffWPQ03/ec3XZjil4jlgUPs2rlt+8xo8WbgOFBr X-Received: by 2002:a05:6a21:191:b0:1a9:6d96:c700 with SMTP id le17-20020a056a21019100b001a96d96c700mr2495142pzb.48.1712909323465; Fri, 12 Apr 2024 01:08:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712909323; cv=pass; d=google.com; s=arc-20160816; b=f6UAvCTU4B111XFhTA3lotTXtEppF4DZVo2TG/uZ+Dhd0+w5dpNk/ntMw/V4VFbOjM gChrQD4gYglPp8EL+slTKrc8+QvhhgCGcYvJbB6GrbYOfuevVR6ChvVkWYYSTapXvHeD lGQCJT/npj/fh626ABaqXSoZNLTt3zc142zPvH+7TYATjPSCjWkBIUyMyGOeWnGlkbvJ mLPN8DyrvrTI0CUyFd66Qj/DUcxAH4gnWAJWncEzLrWU9XWQzjZtV7xmO5J3lfCgHL3f w1Zc3YtOb+dONRSA1zIwb0tkpxWaRzaYIy51/g1Eie9C62BO9wwCP3PWw4rSxhgtDY/t jY+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=VX0Xcvc7mqlW39h0bWx5qdbe1UgbFfhzdFxCTgi5tYs=; fh=flvKsia2llQtddLi9HBNqMOAeGb+z3gVD0e5X1pvHB8=; b=bt36PIdo9TlXH7LNzjLQE/H7MXoNakvX+xd94IW+2w+NUC7ykmtgiqWl6rgbR4WhtL qxYbgFZBu7eXGU6fhw7XAA302Tc47mKWFg4dfmKy4Y2cKa3IyF5m2lr1JpQSArwMHNMV 858kWiisMsDDuTj++zYKg9KN4Pc40CkhcHRw9mjId14X0EGT4U3Enmxn4cto1sbc1m/1 LfkKoipTwTq3+qW041QZWsHtHKgCiYL+lYUVN0RKfTvD1S9I96B4b1mFxCgJLnq9tH/F fSCWmuCnloGMI1HPz0WNUVZhTyE2TCccehFHlXga0Q2ajPfJfT4ANXYJPjU77854llY0 UAyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lut6OKEf; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-142192-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142192-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id it25-20020a056a00459900b006ecee11bb18si2861386pfb.39.2024.04.12.01.08.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 01:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142192-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=@ti.com header.s=ti-com-17Q1 header.b=lut6OKEf; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-142192-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142192-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com 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 192FEB2313B for ; Fri, 12 Apr 2024 08:02:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C41114EB3F; Fri, 12 Apr 2024 08:02:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="lut6OKEf" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 44017487A9; Fri, 12 Apr 2024 08:02:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712908963; cv=none; b=aePQ1c9336eXRoPCy5FH98JcNYeFu2RiIEII5DHCK382Q8Y7732HbmSHSJoDMSEs6fGK4Df9ju5GzxIofLQ5+4tekNnnT8Ix4fNE3NzzuSNMpR1LDp5kSMRkt7agxtmGg460URJljXZNgy2Am4IHgZo/v8e03zVIJt4BpJkl8SU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712908963; c=relaxed/simple; bh=HypH+HFfZe7sG9jT4MifVrW0ikey/sQI93jaxO2O35g=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=NCgFUik+d4/ecNtWw5KaXPZKFs5Ghx5GcrMarARM6SKXpnRMQMkRMYXzufUnOcOIcOKoTdL55ynCqIgyWYliXEem02SCT0Cm7qkzaU4nFdsKwX7h5lPX3A3fs6NJ28vBa//dX/zX1pcBwtLlM5nAQODX4iCvrWjYexMviC4w580= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=lut6OKEf; arc=none smtp.client-ip=198.47.23.249 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 43C81s5s124910; Fri, 12 Apr 2024 03:01:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1712908914; bh=VX0Xcvc7mqlW39h0bWx5qdbe1UgbFfhzdFxCTgi5tYs=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=lut6OKEfEAifrJR0p1WxIxVaFKsg/KVIlAAEdNX55Nx2WeGQbqPMSQHQ+3CGzqc/a dj/0kzRP71mPFk8fT+WWjxsvyRxkRO/ZU8/3bfUy+PWCFPDESChQPeDCwQ7DXuIyz/ Uge4C9c/GOJBFuO1A6nXkgblmxcIlwG5zCRRFAqE= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 43C81sa4079143 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 12 Apr 2024 03:01:54 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 12 Apr 2024 03:01:54 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 12 Apr 2024 03:01:54 -0500 Received: from [10.249.135.225] ([10.249.135.225]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 43C81j69086571; Fri, 12 Apr 2024 03:01:47 -0500 Message-ID: Date: Fri, 12 Apr 2024 13:31:44 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v3 3/3] net: ti: icssg-prueth: Add support for ICSSG switch firmware To: Andrew Lunn , 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" , , , , , References: <20240327114054.1907278-1-danishanwar@ti.com> <20240327114054.1907278-4-danishanwar@ti.com> <27d960ed-8e67-431b-a910-e6b2fc12e292@lunn.ch> <0039b9d9-9dc5-4b88-99f0-92f275b0b4d3@lunn.ch> Content-Language: en-US From: "Anwar, Md Danish" In-Reply-To: <0039b9d9-9dc5-4b88-99f0-92f275b0b4d3@lunn.ch> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On 4/10/2024 6:12 PM, Andrew Lunn wrote: >> 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. > Hi Andrew, I have tested with that sequence as well and forwarding works. Even if the second interface is added to bridge after bridge is up, the forwarding works fine. > 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. > Yes there will be packet losses for a slight amount of time but that's something we can't avoid. I will post the next revision with these changes soon. Thanks for the review. > Andrew -- Thanks and Regards, Md Danish Anwar