From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752662AbdI3BOm (ORCPT ); Fri, 29 Sep 2017 21:14:42 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:36452 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752591AbdI3BOk (ORCPT ); Fri, 29 Sep 2017 21:14:40 -0400 X-Google-Smtp-Source: AOwi7QB3OZRcPmDH51ba3DtKQhxuP8vUmdWTyW+brrO+VMcvR8KbkEBF1gMRXjLQwzE64jvBxzb4mA== Subject: Re: [PATCH net-next v2 1/7] net: dsa: add master helper to look up slaves To: Vivien Didelot , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Andrew Lunn References: <20170929211921.5571-1-vivien.didelot@savoirfairelinux.com> <20170929211921.5571-2-vivien.didelot@savoirfairelinux.com> From: Florian Fainelli Message-ID: Date: Fri, 29 Sep 2017 18:14:36 -0700 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: <20170929211921.5571-2-vivien.didelot@savoirfairelinux.com> Content-Type: text/plain; charset=windows-1252 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 On 09/29/2017 02:19 PM, Vivien Didelot wrote: > The DSA tagging code does not need to know about the DSA architecture, > it only needs to return the slave device corresponding to the source > port index (and eventually the source device index for cascade-capable > switches) parsed from the frame received on the master device. > > For this purpose, provide an inline dsa_master_get_slave helper which > validates the device and port indexes and look up the slave device. > > This makes the tagging rcv functions more concise and robust, and also > makes dsa_get_cpu_port obsolete. > > Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli -- Florian