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]
Date:   Sat, 3 Dec 2022 18:47:01 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Heiner Kallweit <hkallweit1@...il.com>
Cc:     Chunhao Lin <hau@...ltek.com>, netdev@...r.kernel.org,
        nic_swsd@...ltek.com
Subject: Re: [PATCH net-next v5] r8169: add support for rtl8168h(revid 0x2a)
 + rtl8211fs fiber application

> >  enum rtl_flag {
> >  	RTL_FLAG_TASK_ENABLED = 0,
> >  	RTL_FLAG_TASK_RESET_PENDING,
> > @@ -624,6 +642,12 @@ struct rtl8169_private {
> >  	struct rtl_fw *rtl_fw;
> >  
> >  	u32 ocp_base;
> > +
> > +	struct {
> > +		struct mii_bus *mii_bus;
> > +		struct phy_device *phydev;
> 
> We have a phydev member in in struct rtl8169_private already,
> why can't you use it and need a separate one instead?

There is also one in the net_device structure. That is the best one to
use, since a lot of the ethtool core code will use that.

> >  	if (device_may_wakeup(tp_to_dev(tp))) {
> > -		phy_speed_down(tp->phydev, false);
> > +		/* Fiber not support speed down */
> 
> phy_speed_down() will switch to the slowest mode supported by both
> link partners. If the local PHY doesn't support a speed below 1Gbps
> then the call to phy_speed_down() is a no-op, it won't hurt.
> Therefore I see no reason to add complexity for skipping this call.
> 
> Another question may be whether switching to a slower speed is
> benefitial to power consumption in general on fiber.
> That's something I can't answer. But if true, we should add
> to phy_speed_down() to do nothing if port is PORT_FIBRE.

If the SFP is actually a copper module, going down to 10/Half should
save power, just as it does with a normal copper PHY.

The problem with a fibre SFP is that there is no negotiation. So in
theory you might be able to save some power by changing from 2500BaseX
to 1000BaseX, but there is no way to tell the link partner you want to
drop the speed.

For this MAC driver, i think it is a moot point. Since it appears to
be using phylib, not phylink. To correctly support SFPs this MAC
driver probably needs to change to phylink.

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ