From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78DBB10E1 for ; Thu, 31 Aug 2023 01:04:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 785B2C433C8; Thu, 31 Aug 2023 01:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693443879; bh=GrHBq04S/lIWLz0lb2weVGApErFJkY2SCflqNO6ELp8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JtYEdZwWjRzAjI55nw6N5ODNtC7UOWcvANUpeGpRvBUuT+Xi88xfo/zAYiuUmcAoZ ibPnkbckIFBhLHl8FNMqmBXq5RC4UrpWTaP6A2Z4rVB4MKNv3dhxQKm2Mk/dfgeEDt EuDqJFE9YsyHA0WW4DHTEwyEoCOWuiA+Mhf9PeJMqpJaO45EHGFkMa4RnUPibitbmE 7otElFa9ZRY3w321ox5RYCzGYAgZhQ8f2csGz3Ywg6dDJCPGfFtcTLyz/SBMUxrfeZ 4MfmeshjGbM244e/vS9xZsVIQ7z9wQySzUuUHqeyYAXQhvfw8j59buaBZco65iM95Y rcP++fU8fSzOw== Date: Wed, 30 Aug 2023 18:04:37 -0700 From: Jakub Kicinski To: "Russell King (Oracle)" Cc: =?UTF-8?B?Tmljb2zDsg==?= Veronese , netdev@vger.kernel.org, simonebortolin@hack-gpon.org, nanomad@hack-gpon.org, Federico Cappon , daniel@makrotopia.org, lorenzo@kernel.org, ftp21@ftp21.eu, pierto88@hack-gpon.org, hitech95@hack-gpon.org, davem@davemloft.net, andrew@lunn.ch, edumazet@google.com, hkallweit1@gmail.com, pabeni@redhat.com, nbd@nbd.name Subject: Re: [RFC] RJ45 to SFP auto-sensing and switching in mux-ed single-mac devices (XOR RJ/SFP) Message-ID: <20230830180437.583e6383@kernel.org> In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 29 Aug 2023 16:38:42 +0100 Russell King (Oracle) wrote: > So technically it's possible. However, there is no notification to > userspace when such a change may occur. There's also the issue that > userspace may be in the process of issuing ethtool commands that are > affecting one of the PHYs. While holding the rtnl lock will block > those calls, a change between the PHY and e.g. a PHY on the SFP > would cause the ethtool command to target a different PHY from what > was the original target. > > To solve that sanely, every PHY-based ethtool probably needs a way > to specify which PHY the command is intended for, but then there's > the question of how userspace users react to that - because it's > likely more than just modifying the ethtool utility, ethtool > commands are probably used from many programs. Would it simplify anything if we only did the selection from ndo_open? We can send a notification to user space that the SFP got plugged in, but its up to user space to down / up the interface to use it?