Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751408AbdIWJ62 (ORCPT ); Sat, 23 Sep 2017 05:58:28 -0400 Received: from aibo.runbox.com ([91.220.196.211]:37738 "EHLO aibo.runbox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbdIWJ60 (ORCPT ); Sat, 23 Sep 2017 05:58:26 -0400 Subject: Re: [PATCH net-next 2/2] net: dsa: lan9303: Add basic offloading of unicast traffic To: Andrew Lunn Cc: vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170921094139.4250-1-privat@egil-hjelmeland.no> <20170921094139.4250-3-privat@egil-hjelmeland.no> <20170921142127.GB27589@lunn.ch> <20170922200810.GJ3470@lunn.ch> From: Egil Hjelmeland Message-ID: <2c5fec6d-18b3-97e9-dd64-85560382d2f7@egil-hjelmeland.no> Date: Sat, 23 Sep 2017 11:58:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170922200810.GJ3470@lunn.ch> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1877 Lines: 49 Den 22. sep. 2017 22:08, skrev Andrew Lunn: >>> I'm wondering how this is supposed to work. Please add a good comment >>> here, since the hardware is forcing you to do something odd. >>> >>> Maybe it would be a good idea to save the STP state in chip. And then >>> when chip->is_bridged is set true, change the state in the hardware to >>> the saved value? >>> >>> What happens when port 0 is added to the bridge, there is then a >>> minute pause and then port 1 is added? I would expect that as soon as >>> port 0 is added, the STP state machine for port 0 will start and move >>> into listening and then forwarding. Due to hardware limitations it >>> looks like you cannot do this. So what state is the hardware >>> effectively in? Blocking? Forwarding? >>> >>> Then port 1 is added. You can then can respect the states. port 1 will >>> do blocking->listening->forwarding, but what about port 0? The calls >>> won't get repeated? How does it transition to forwarding? >>> >>> Andrew >>> >> >> I see your point with the "minute pause" argument. Although a bit >> contrived use case, it is easy to fix by caching the STP state, as >> you suggest. So I can do that. > > I don't think it is contrived. I've done bridge configuration by hand > for testing purposes. I've also set the forwarding delay to very small > values, so there is a clear race condition here. > >> How does other DSA HW chips handle port separation? Knowing that >> could perhaps help me know what to look for. > > They have better hardware :-) > > Generally each port is totally independent. You can change the STP > state per port without restrictions. > We can indeed change the STP state per lan9303 port "without restrictions". The point is: Once both external ports are in "forwarding", I see no way to prevent traffic flowing directly between the external ports. > Andrew > Egil