From: MD Danish Anwar <danishanwar@ti.com>
To: Roger Quadros <rogerq@kernel.org>, Andrew Lunn <andrew@lunn.ch>
Cc: Simon Horman <horms@kernel.org>,
Vignesh Raghavendra <vigneshr@ti.com>,
Jacob Keller <jacob.e.keller@intel.com>,
Richard Cochran <richardcochran@gmail.com>,
Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<srk@ti.com>, <r-gunasekaran@ti.com>,
Pekka Varis <p-varis@ti.com>
Subject: Re: [RFC PATCH net-next 3/4] net: ti: icssg-prueth: Add support for ICSSG switch firmware on AM654 PG2.0 EVM
Date: Fri, 8 Sep 2023 13:47:34 +0530 [thread overview]
Message-ID: <3fbf9514-8f9f-d362-9006-1fd435540e67@ti.com> (raw)
In-Reply-To: <12c11462-5449-b100-5f92-f66c775237fa@kernel.org>
On 08/09/23 13:16, Roger Quadros wrote:
>
>
> On 05/09/2023 11:43, MD Danish Anwar wrote:
>> On 04/09/23 19:38, Andrew Lunn wrote:
>>>> Switch mode requires loading of new firmware into ICSSG cores. This
>>>> means interfaces have to taken down and then reconfigured to switch mode
>>>> using devlink.
>>>
>>> Can you always run it in switch mode, just not have the ports in a
>>> bridge?
>>>
>>> Andrew
>>
>> No, we can't always run it in switch mode. Switch mode requires loading
>> of different firmware. The switch firmware only supports switch
>> operations. If the ports are not in a bridge in switch mode, the normal
>> functionalities will not work. We will not be able to send / receive /
>> forward packets in switch mode without bridge.
>>
>> When device is booted up, the dual EMAC firmware is loaded and ICSSG
>> works in dual EMAC mode with both ports doing independent TX / RX.
>>
>> When switch mode is enabled, dual EMAC firmware is unloaded and switch
>> firmware is loaded. The ports become part of the bridge and the two port
>> together acts as a switch.
>>
>
> Since we are loading the switch firmware and the switch logic is in firmware,
> it means we don't really need Linux help to do basic switching on the external
> ports.
>
> I suppose Andrews question was, can it work as a switch after switching
> from dual-emac to switch mode and not setting up the Linux bridge.
>
I did some further testing on switch mode. The basic functionality would
work without a bridge as well. This will need one modification in driver
but even without bridge switching will work.
When enabling switch mode the driver sets the HOST_MAC_ADDR to the
bridge's addr. If bridge is not there, this will result in KERNEL NULL
POINTER crash.
icssg_class_set_host_mac_addr(prueth->miig_rt,
prueth->hw_bridge_dev->dev_addr);
However if we change this to only set when bridge is there, it works
if (prueth->hw_bridge_dev)
icssg_class_set_host_mac_addr(prueth->miig_rt,
prueth->hw_bridge_dev->dev_addr);
With this change forwarding works in switch mode without setting up the
bridge. Just loading the switch firmware is enough.
> e.g. Looking at your command list
>
>> Switch to ICSSG Switch mode:
>> ip link set dev eth1 down
>> ip link set dev eth2 down
>> devlink dev param set platform/icssg2-eth name \
>> switch_mode value 1 cmode runtime
>
> At this point, can it work as a switch. If not, why?>
To summarize, yes it can work at this point.
>> ip link add name br0 type bridge
>> ip link set dev eth1 master br0
>> ip link set dev eth2 master br0
>> ip link set dev br0 up
>> ip link set dev eth1 up
>> ip link set dev eth2 up
>> bridge vlan add dev br0 vid 1 pvid untagged self
>
--
Thanks and Regards,
Danish
next prev parent reply other threads:[~2023-09-08 8:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 11:08 [RFC PATCH net-next 0/4] Introduce switch mode and TAPRIO offload support for ICSSG driver MD Danish Anwar
2023-08-30 11:08 ` [RFC PATCH net-next 1/4] net: ti: icssg-prueth: Add helper functions to configure FDB MD Danish Anwar
2023-09-04 14:02 ` Andrew Lunn
2023-09-05 8:36 ` MD Danish Anwar
2023-09-07 11:57 ` Roger Quadros
2023-09-08 5:30 ` [EXTERNAL] " MD Danish Anwar
2023-08-30 11:08 ` [RFC PATCH net-next 2/4] net: ti: icssg-switch: Add switchdev based driver for ethernet switch support MD Danish Anwar
2023-08-30 11:08 ` [RFC PATCH net-next 3/4] net: ti: icssg-prueth: Add support for ICSSG switch firmware on AM654 PG2.0 EVM MD Danish Anwar
2023-09-04 14:08 ` Andrew Lunn
2023-09-05 8:43 ` MD Danish Anwar
2023-09-08 7:46 ` Roger Quadros
2023-09-08 8:17 ` MD Danish Anwar [this message]
2023-09-13 6:44 ` MD Danish Anwar
2023-09-13 12:19 ` Andrew Lunn
2023-09-21 11:19 ` MD Danish Anwar
2023-09-21 13:37 ` Andrew Lunn
2023-09-22 7:04 ` MD Danish Anwar
2023-08-30 11:08 ` [RFC PATCH net-next 4/4] net: ti: icssg_prueth: add TAPRIO offload support MD Danish Anwar
2023-09-04 14:12 ` Andrew Lunn
2023-09-05 8:37 ` MD Danish Anwar
2023-09-07 12:23 ` Roger Quadros
2023-09-08 5:31 ` [EXTERNAL] " MD Danish Anwar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3fbf9514-8f9f-d362-9006-1fd435540e67@ti.com \
--to=danishanwar@ti.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=p-varis@ti.com \
--cc=pabeni@redhat.com \
--cc=r-gunasekaran@ti.com \
--cc=richardcochran@gmail.com \
--cc=rogerq@kernel.org \
--cc=srk@ti.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®