From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756560AbdJLWnR (ORCPT ); Thu, 12 Oct 2017 18:43:17 -0400 Received: from mail-qk0-f169.google.com ([209.85.220.169]:47744 "EHLO mail-qk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753203AbdJLWnP (ORCPT ); Thu, 12 Oct 2017 18:43:15 -0400 X-Google-Smtp-Source: ABhQp+RsbIxwgeGZUer3UJq4YmsIP0De+oOy7Swtbvnx7nUdn92vMeCCycpCZe5u+9tS4ho6ueJ1nA== Subject: Re: [PATCH net-next] net: dsa: set random switch address To: Vivien Didelot , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Andrew Lunn References: <20171012221009.14615-1-vivien.didelot@savoirfairelinux.com> <87k200vvsl.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> From: Florian Fainelli Message-ID: Date: Thu, 12 Oct 2017 15:43:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <87k200vvsl.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> Content-Type: text/plain; charset=utf-8 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 10/12/2017 03:35 PM, Vivien Didelot wrote: > Hi Florian, > > Florian Fainelli writes: > >> On 10/12/2017 03:10 PM, Vivien Didelot wrote: >>> An Ethernet switch may support having a MAC address, which can be used >>> as the switch's source address in transmitted full-duplex Pause frames. >>> >>> If a DSA switch supports the related .set_addr operation, the DSA core >>> sets the master's MAC address on the switch. >>> >>> This won't make sense anymore in a multi-CPU ports system, because there >>> won't be a unique master device assigned to a switch tree. >> >> Thus far, everything you have said is true, but why we should do it, >> that is: what if we don't, needs to be explained. Does that create a >> problem with the generation of pause frames throughout the switch fabric? >> >>> >>> To fix this, assign a random MAC address to the switch chip instead. >> >> Maybe this is something that should be removed entirely from the DSA >> core and pushed into the individual switch drivers instead. dsa_loop >> implements it for code coverage, but that does not do anything. >> >> set_addr is confusing in that you may think it could be used to program >> the switch with the MAC address of the CPU/management port such that you >> can disable MAC address learning on said port, but in fact, that's not >> how it is used. > > You are correct. So what I can do is assign a random MAC address in the > Marvell driver, remove the .set_addr implementation of mv88e6xxx and > dsa_loop, and finally remove this code from DSA core completely. Works for me, thanks! -- Florian