From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752797AbbDDVtt (ORCPT ); Sat, 4 Apr 2015 17:49:49 -0400 Received: from mail-ob0-f175.google.com ([209.85.214.175]:34019 "EHLO mail-ob0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752710AbbDDVts (ORCPT ); Sat, 4 Apr 2015 17:49:48 -0400 Message-ID: <55205C79.8050308@gmail.com> Date: Sat, 04 Apr 2015 14:49:45 -0700 From: Florian Fainelli User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Pavel Nakonechny , netdev@vger.kernel.org, Joe Perches CC: "David S. Miller" , Grant Likely , Rob Herring , Fabian Frederick , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net: dsa: fix filling routing table from OF description References: <1516684.D2TdrA1BPT@kuro.zhome> In-Reply-To: <1516684.D2TdrA1BPT@kuro.zhome> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 04/04/2015 14:46, Pavel Nakonechny a écrit : > According to description in 'include/net/dsa.h', in cascade switches > configurations where there are more than one interconnected devices, > 'rtable' array in 'dsa_chip_data' structure is used to indicate which > port on this switch should be used to send packets to that are destined > for corresponding switch. > > However, dsa_of_setup_routing_table() fills 'rtable' with port numbers > of the _target_ switch, but not current one. > > This commit removes redundant devicetree parsing and adds needed port > number as a function argument. So dsa_of_setup_routing_table() now just > looks for target switch number by parsing parent of 'link' device node. > > To remove possible misunderstandings with the way of determining target > switch number, a corresponding comment was added to the source code and > to the DSA device tree bindings documentation file. > > This was tested on a custom board with two Marvell 88E6095 switches with > following corresponding routing tables: { -1, 10 } and { 8, -1 }. > > Signed-off-by: Pavel Nakonechny > Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli -- Florian