Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bhutchings@solarflare.com (Ben Hutchings)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/1 net-next] net: fec: enable pause frame to improve rx prefomance for 1G network
Date: Thu, 24 Jan 2013 16:49:33 +0000	[thread overview]
Message-ID: <1359046173.2736.2.camel@bwh-desktop.uk.solarflarecom.com> (raw)
In-Reply-To: <CAHrpEqSzu97X2PUgUEh30EqkbjLUYyhCN28AEzJ6eLPXx0Qg1Q@mail.gmail.com>

On Thu, 2013-01-24 at 10:16 +0800, Frank Li wrote:
> 2013/1/24 Ben Hutchings <bhutchings@solarflare.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.

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.

  reply	other threads:[~2013-01-24 16:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17  2:55 [PATCH v3 1/1 net-next] net: fec: enable pause frame to improve rx prefomance for 1G network Frank Li
2013-01-18 19:16 ` David Miller
2013-01-23 20:39 ` Ben Hutchings
2013-01-24  2:16   ` Frank Li
2013-01-24 16:49     ` Ben Hutchings [this message]
2013-01-25  1:50       ` Frank Li
2013-01-25 17:33         ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359046173.2736.2.camel@bwh-desktop.uk.solarflarecom.com \
    --to=bhutchings@solarflare.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox