netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>, David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 2/2] phy: marvell: Add support for phy packet generator
Date: Wed, 17 Feb 2016 15:49:45 -0800	[thread overview]
Message-ID: <56C50719.7070608@gmail.com> (raw)
In-Reply-To: <1455741127-25453-3-git-send-email-andrew@lunn.ch>

On 17/02/2016 12:32, Andrew Lunn wrote:
> +static int marvell_pkt_gen(struct phy_device *phydev,
> +			   struct ethtool_phy_pkt_gen *pkt_gen)
> +{
> +	int err, oldpage, reg, max_loop = 100;
> +	u32 phy_id = phydev->drv->phy_id;
> +	bool has_ipg = false;

[snip]


> +
> +	do {
> +		usleep_range(3000, 4000);
> +		reg = phy_read(phydev, MII_88E1540_PKT_GEN);
> +	} while (max_loop-- && (reg & MII_88E1540_PKT_GEN_ENABLE));
> +
> +	if (!max_loop)
> +		err = -ETIMEDOUT;

If I am a HW engineer trying to qualify a PHY after enabling the random
packet generator built into it, I might prefer a "start generation" and
"stop generation" (this echoes back to Ben's comments on the ethtool
API) as opposed to calling the same function multiple times, because the
duration will vary based on link speed, and potentially models of PHYs too.

  parent reply	other threads:[~2016-02-17 23:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 20:32 [PATCH net-next 0/2] Add support for PHY packet generators Andrew Lunn
2016-02-17 20:32 ` [PATCH net-next 1/2] net: ethtool: " Andrew Lunn
2016-02-17 21:06   ` Ben Hutchings
2016-02-17 21:55     ` Andrew Lunn
2016-02-17 23:28       ` Ben Hutchings
2016-02-17 20:32 ` [PATCH net-next 2/2] phy: marvell: Add support for phy packet generator Andrew Lunn
2016-02-17 22:33   ` Lino Sanfilippo
2016-02-17 23:49   ` Florian Fainelli [this message]
2016-02-18 20:45 ` [PATCH net-next 0/2] Add support for PHY packet generators David Miller

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=56C50719.7070608@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).