Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933944AbdC3OH6 (ORCPT ); Thu, 30 Mar 2017 10:07:58 -0400 Received: from mail.savoirfairelinux.com ([208.88.110.44]:51212 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933714AbdC3OH4 (ORCPT ); Thu, 30 Mar 2017 10:07:56 -0400 From: Vivien Didelot To: Andrew Lunn Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli Subject: Re: [PATCH net-next 4/9] net: dsa: mv88e6xxx: allocate the number of ports In-Reply-To: <20170330135050.GD17879@lunn.ch> References: <20170329203020.27042-1-vivien.didelot@savoirfairelinux.com> <20170329203020.27042-5-vivien.didelot@savoirfairelinux.com> <20170330135050.GD17879@lunn.ch> Date: Thu, 30 Mar 2017 10:06:29 -0400 Message-ID: <87tw6aq2oq.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 780 Lines: 23 Hi Andrew, Andrew Lunn writes: > On Wed, Mar 29, 2017 at 04:30:15PM -0400, Vivien Didelot wrote: >> The current code allocates DSA_MAX_PORTS ports for a Marvell dsa_switch >> structure. Provide the exact number of ports so the corresponding >> ds->num_ports is accurate. > > Is net/dsa/dsa.c: dsa_switch_setup() still used? If it is, won't that > invalidate your assumption about ds->num_ports. I think dsa_switch_setup is part of the legacy code and is likely to be removed soon. But this is not an issue per-se. What happens if the switch is allocated with DSA_MAX_PORTS ports instead of the correct number, is that the PVT will be programmed to allow the non-existent port IDs to egress frames on the CPU port and DSA links only. Thanks, Vivien