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] [day] [month] [year] [list]
Message-ID: <1359135222.2644.2.camel@bwh-desktop.uk.solarflarecom.com>
Date:	Fri, 25 Jan 2013 17:33:42 +0000
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Frank Li <lznuaa@...il.com>
CC:	Frank Li <Frank.Li@...escale.com>, <shawn.guo@...aro.org>,
	<B38611@...escale.com>, <davem@...emloft.net>,
	<linux-arm-kernel@...ts.infradead.org>, <netdev@...r.kernel.org>,
	<s.hauer@...gutronix.de>
Subject: Re: [PATCH v3 1/1 net-next] net: fec: enable pause frame to improve
 rx prefomance for 1G network

On Fri, 2013-01-25 at 09:50 +0800, Frank Li wrote:
> 2013/1/25 Ben Hutchings <bhutchings@...arflare.com>:
> > On Thu, 2013-01-24 at 10:16 +0800, Frank Li wrote:
> >> 2013/1/24 Ben Hutchings <bhutchings@...arflare.com>:
> >> > On Thu, 2013-01-17 at 10:55 +0800, Frank Li wrote:
> >> >> The limition of imx6 internal bus cause fec can't achieve 1G perfomance.
> >> >> There will be many packages lost because FIFO over run.
> >> >>
> >> >> This patch enable pause frame flow control.
> >> > [...]
> >> >> --- a/drivers/net/ethernet/freescale/fec.c
> >> >> +++ b/drivers/net/ethernet/freescale/fec.c
> >> > [...]
> >> >> +static int fec_enet_set_pauseparam(struct net_device *ndev,
> >> >> +                                struct ethtool_pauseparam *pause)
> >> >> +{
> >> >> +     struct fec_enet_private *fep = netdev_priv(ndev);
> >> >> +
> >> >> +     if (pause->tx_pause != pause->rx_pause) {
> >> >> +             netdev_info(ndev,
> >> >> +                     "hardware only support enable/disable both tx and rx");
> >> >> +             return -EINVAL;
> >> >> +     }
> >> >> +
> >> >> +     fep->pause_flag = 0;
> >> >> +
> >> >> +     /* tx pause must be same as rx pause */
> >> >> +     fep->pause_flag |= pause->rx_pause ? FEC_PAUSE_FLAG_ENABLE : 0;
> >> >> +     fep->pause_flag |= pause->autoneg ? FEC_PAUSE_FLAG_AUTONEG : 0;
> >> >> +
> >> >> +     if (pause->rx_pause || pause->autoneg) {
> >> >> +             fep->phy_dev->supported |= ADVERTISED_Pause;
> >> >> +             fep->phy_dev->advertising |= ADVERTISED_Pause;
> >> >> +     } else {
> >> >> +             fep->phy_dev->supported &= ~ADVERTISED_Pause;
> >> >> +             fep->phy_dev->advertising &= ~ADVERTISED_Pause;
> >> >> +     }
> >> > [...]
> >> >
> >> > Why is this changing the supported flags, i.e. device capabilities?  You
> >> > need to leave those flags alone and reject an attempt to enable pause
> >> > frames on a device that doesn't support them.
> >>
> >> I go through phylib, I have not found good place set ADVERTISED_Pause
> >> capabilities.
> >> genphy_config_init never check Pause capabilities.
> >
> > I agree that phylib can't initialise pause capabilities because those
> > depend on the MAC.  But look at which function I'm quoting: this is the
> > ethtool operation, which shouldn't change capabilities.
> 
> Where is good place do you think? in probe function?

You're already setting the supported flag in fec_enet_mii_probe().  I
assume (without great familiarity with phylib) that that's the right
place to do it.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ