From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH net-next 1/2] ixgbe: register a mdiobus Date: Fri, 30 Nov 2018 17:34:37 +0100 Message-ID: <20181130163437.GF25553@lunn.ch> References: <20181129185345.17235-1-stephend@silicom-usa.com> <20181129185345.17235-2-stephend@silicom-usa.com> <20181130132130.GA11747@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jeff Kirsher , "David S. Miller" , "netdev@vger.kernel.org" To: Steve Douthit Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:56081 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726644AbeLADoh (ORCPT ); Fri, 30 Nov 2018 22:44:37 -0500 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: > Yep, registering multiple interfaces is wrong. The first board I tested > against only had a single MAC enabled (they can be disabled/hidden via > straps) so it just happened to work. Hi Steve Can you hide any/all via straps, or is 00.0 always guaranteed to exist? > The Intel C3xxx family of SoCs have up to four ixgbe MACs. These are > structured as two devices of two functions each on fixed internal root > ports. > > from lspci: > > +-16.0-[05]--+-00.0 > | \-00.1 > +-17.0-[06]--+-00.0 > | \-00.1 > Is there any other hardware resource which is shared between the MAC interfaces? I'm just wondering if the driver has already solved this once. Is there an EEPROM per interface for the MAC address, or one shared EEPROM? Ah, how about using the 'cards_found' found variable. It is not perfect, in that it is not decremented in ixgb_remove(), and i wonder about race conditions since there does not appear to be any lock when it is incremented. But if cards_found == 0, register the MDIO bus. Andrew