lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191110185048.GV25889@lunn.ch>
Date:   Sun, 10 Nov 2019 19:50:48 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Nicholas Johnson <nicholas.johnson-opensource@...look.com.au>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Andy Gospodarek <andy@...yhouse.net>,
        "David S. Miller" <davem@...emloft.net>
Subject: Re: Possibility of me mainlining Tehuti Networks 10GbE driver

> Could I please have more information / reading resources on the PHY 
> business? My understanding is that the NIC firmware would be dealing 
> with the PHY (this is the MII, right?) and the OS would have nothing to 
> do with it (it just sees a NIC which processes packets).

There are two different strategies boards can use:

1) The MAC firmware handles the PHY, and the firmware has all the PHY
   drivers needed.

2) Linux handles the PHY, and uses drivers from drivers/net/phy. The
   MAC driver then needs to export an MDIO bus, and use either phylink
   or phylib.

> Above you mentioned mii_bus for PHYs, but a driver like Aquantia 
> Atlantic does not have references to PHYs or MII. Why do some not need 
> the feature when others do?

The Aquantia MAC driver uses the firmware strategy. The PHY is
completely hidden from Linux with the firmware running on the MAC
handling the PHY.

But say look at the Marvell MAC drivers. They expose an MDIO bus, and
linux then drives the PHY. The MAC driver then uses the phylink_ API
to interact with the PHY via the phylink core code.

I also had a quick look at the code. It has the basic code you need to
export an MDIO bus, and let Linux control the PHYs.  bdx_mdio_read()
and bdx_mdio_write() would become the two functions you need for
struct mii_bus, and then pass it to mdiobus_register(). You would then
need to add phylink calls in the write place in the MAC driver.

If you think writing a new driver is too much work for you, then going
via staging is probably the better idea. You can slowly working on
improving the driver. One of the big chunks of work is going to be
swapping to the kernel PHY drivers, using PHYLINK, etc. And to do
that, you really do need to have hardware. You don't need all the
different variants the driver supports, but you should at least have
one. And i would suggest you get hardware which uses either the
Marvell or Aquantia PHY.

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ