Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp362532rdb; Thu, 18 Jan 2024 06:02:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZWbML/4+WBNBzp80u0rz4ZZnkZUioTVgkuLV/XGKB7+kO5a8lbfecf+i90sES1DO/5vJd X-Received: by 2002:a17:906:c14a:b0:a2d:55bc:5ca2 with SMTP id dp10-20020a170906c14a00b00a2d55bc5ca2mr698876ejc.39.1705586570084; Thu, 18 Jan 2024 06:02:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705586570; cv=pass; d=google.com; s=arc-20160816; b=OeCzfZQ1SaEYtIzBtuj6IE1fCrSz+SptJ3SHJxCvDkrow8XKJP/UlqtrptmR9XRmVo befk0SA9GwdFFuu/PefTku2KUP7mzx9zJK8aQSRnQ9arAV8QkNl+FGA7HCm0Gnz8r5m5 IgsBH9p1gPJytfIw/G3aMAt3WxWrAHB8f6Oi7u1TSBy9QBEB3xD707a5u+CTcTK8x1S7 fIwX0mxVFHewO8yatz5LVW/i0u/e40O3PsK/xA8nEcuElrVcWTfx1rePqhziDPabXRxu NPJzpvh6usVhFO0Z4Nq87Y72WNfDrV1TSjo/Z+MQmZ3NxDOyRCJoNYpEa2hkMTzhM7OX HYpA== 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=5xUMVOdWXR28LTjgi8INzdf5V0YNKbloTOUqIvRdyT4=; fh=L3f2u8mIbO5EC1D8enc8zg0LCKNVgXEx4FLfDxuKRO8=; b=Ok0zC3VoawuBm/2Yw6fyhdvK9NUFleB46wVYDFEXV8AcQw86iS8pW7rSWkAeGNn21a ZwHe++KCd3+RwwdvBBi1RFGPBbpHNmFU9ca+Wy17FHoaOGcYhdwZRBKMZLfNfujSp6O1 UVCfRsYVO9k3l3YPGvF+mLaAnMRJ9S+b8HzQAX0qf9y/GQoVWJVkj+FZp9mtYewkYjAj V60X/GzNNNw4t3MlGVAn2hTpNb6wFCEJ7XCebzqdUIYht564ysC502IUzad2oNaPzWaQ RaGiIAfDKqKNjxd47XhInzZGaM4yI4wwnG8CF+1wPc68nYw/Sj+b35zZKKzcmf/J2Gmc zfzg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Brv+xSJA; 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-30176-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30176-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c9-20020a170906528900b00a2cea055e88si2846863ejm.431.2024.01.18.06.02.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 06:02:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30176-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Brv+xSJA; 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-30176-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30176-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9427A1F26C36 for ; Thu, 18 Jan 2024 14:02:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E69B2576D; Thu, 18 Jan 2024 14:02:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Brv+xSJA" 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 359FE25579; Thu, 18 Jan 2024 14:02:11 +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=1705586532; cv=none; b=kzhtHgo2iagSxgGQUqmbF67wPYEDtvBt9Iec3JU9+i9YPyqWjB0jmQvyGrNPHwAi2/LViZDZghlY9tdlKTz3Hr9SXHbie3iQGH47E2C4vm7JHs06zqOjTbDLB/FCYrXPajOa892SVSytU+L9pOPBl1VMfIzJ/H7vPhsjWGBUcUM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705586532; c=relaxed/simple; bh=0ZpTOxtF+JNwHEzDyAK3SuignG468h3k05SLchlkRsI=; h=DKIM-Signature:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; b=ffgV1UJHBGPedQ0etsiv37lX3F1hVIopE0r23ncQ0E19d2AHxuot86lOHcKNwMUv9cD6M7DH5LdLjv/ti9jiGBxWpE0v1TJQGUs13kOmHvlpDXgIyws4PdeZmfUt8jK3TSeyelIUVRJ4aPTqdk0G0kGp6ehPnEHCXyp/dIKMSus= 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=Brv+xSJA; 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=5xUMVOdWXR28LTjgi8INzdf5V0YNKbloTOUqIvRdyT4=; b=Brv+xSJAJkRLFEaaPkeJ5MarNg irsTXhPRhnZr/cBDlI30GAeY2ZC9pTgFOeh9gEpT1kTPzY4PwUvm9H62TLCvt98PKxD9spEU3Ni97 HmgQCKiwclfVd2cKoq646LVS2y/He6n9bntFgEuW3RWaod8cVCQrV6mQ9mIqUYI3+dEw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rQSxv-005Txr-Jh; Thu, 18 Jan 2024 15:01:55 +0100 Date: Thu, 18 Jan 2024 15:01:55 +0100 From: Andrew Lunn To: MD Danish Anwar Cc: Rob Herring , Dan Carpenter , Jan Kiszka , Vladimir Oltean , Wolfram Sang , Arnd Bergmann , Grygorii Strashko , Vignesh Raghavendra , 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: [RFC PATCH v2 0/3] Introduce switch mode support for ICSSG driver Message-ID: References: <20240118071005.1514498-1-danishanwar@ti.com> 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: <20240118071005.1514498-1-danishanwar@ti.com> On Thu, Jan 18, 2024 at 12:40:02PM +0530, MD Danish Anwar wrote: > This series adds support for switch-mode for ICSSG driver. This series > also introduces helper APIs to configure firmware maintained FDB > (Forwarding Database) and VLAN tables. These APIs are later used by ICSSG > driver in switch mode. > > Now the driver will boot by default in dual EMAC mode. When first ICSSG > interface is added to bridge driver will still be in EMAC mode. As soon as > second ICSSG interface is added to same bridge, switch-mode will be > enabled and switch firmwares will be loaded to PRU cores. The driver will > remain in dual EMAC mode if ICSSG interfaces are added to two different > bridges or if two differnet interfaces (One ICSSG, one other) is added to > the same bridge. We'll only enable is_switch_mode flag when two ICSSG > interfaces are added to same bridge. > > We start in dual MAC mode. Let's say lan0 and lan1 are ICSSG interfaces > > ip link add name br0 type bridge > ip link set lan0 master br0 > > At this point, we get a CHANGEUPPER event. Only one port is a member of > the bridge, so we will still be in dual MAC mode. > > ip link set lan1 master br0 > > We get a second CHANGEUPPER event, the secind interface lan1 is also ICSSG > interface so we will set the is_switch_mode flag and when interfaces are > brought up again, ICSSG switch firmwares will be loaded to PRU Cores. > > There are some other cases to consider as well. > > ip link add name br0 type bridge > ip link add name br1 type bridge > > ip link set lan0 master br0 > ip link set ppp0 master br0 > > Here we are adding lan0 (ICSSG) and ppp0 (non ICSSG) to same bridge, as > they both are not ICSSG, we will still be running in dual EMAC mode. > > ip link set lan1 master br1 > ip link set vpn0 master br1 > > Here we are adding lan1 (ICSSG) and vpn0 (non ICSSG) to same bridge, as > they both are not ICSSG, we will still be running in dual EMAC mode. This is going in the right direction, thanks for the changes. What features does the dual EMAC firmware support which the switch firmware does not? If such features are in use, you should not reload firmware to the switch firmware, since it will break whatever has been configured. Keep with bridging in software. Similarly, what features are supported by both firmwares? Does feature configuration survive a firmware reload? Or is it necessary to pass all the configuration to the firmware again? Andrew