netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 4/9] stmmac: add MMC support exported via ethtool (v2)
Date: Tue, 30 Aug 2011 16:26:44 +0100	[thread overview]
Message-ID: <1314718004.2752.15.camel@bwh-desktop> (raw)
In-Reply-To: <1314714064-29101-5-git-send-email-peppe.cavallaro@st.com>

On Tue, 2011-08-30 at 16:20 +0200, Giuseppe CAVALLARO wrote:
> This patch adds the MMC management counters support.
> MMC module is an extension of the register address
> space and all the hardware counters can be accessed
> via ethtoo -S ethX.
> 
> Note that, the MMC interrupts remain masked and the logic
> to handle this kind of interrupt will be added later (if
> actually useful).
[...]
>  static void stmmac_ethtool_getdrvinfo(struct net_device *dev,
>  				      struct ethtool_drvinfo *info)
>  {
>  	struct stmmac_priv *priv = netdev_priv(dev);
>  
> -	if (!priv->plat->has_gmac)
> -		strcpy(info->driver, MAC100_ETHTOOL_NAME);
> -	else
> +	info->n_stats = STMMAC_STATS_LEN;
> +
> +	if (likely(priv->plat->has_gmac)) {

Using likely() and unlikely() in ethtool operations seems like a
pointless optimisation.

>  		strcpy(info->driver, GMAC_ETHTOOL_NAME);
> +		info->n_stats += STMMAC_MMC_STATS_LEN;
> +	} else
> +		strcpy(info->driver, MAC100_ETHTOOL_NAME);
>  
>  	strcpy(info->version, DRV_MODULE_VERSION);
>  	info->fw_version[0] = '\0';
> -	info->n_stats = STMMAC_STATS_LEN;
>  }
[...]

Don't bother initialising ethtool_drvinfo::n_stats.  The ethtool core
will do it by calling your get_sset_count implementation.

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:[~2011-08-30 15:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-30 14:20 [PATCH 0/9] update the stmmac to the version Aug_2011 (v2) Giuseppe CAVALLARO
2011-08-30 14:20 ` [PATCH 1/9] stmmac: remove the STBus bridge setting from the GMAC code (v2) Giuseppe CAVALLARO
2011-08-30 14:20 ` [PATCH 2/9] stmmac: remove the mmc " Giuseppe CAVALLARO
2011-08-30 14:20 ` [PATCH 3/9] stmmac: support wake up irq from external sources (v2) Giuseppe CAVALLARO
2011-08-30 14:20 ` [PATCH 4/9] stmmac: add MMC support exported via ethtool (v2) Giuseppe CAVALLARO
2011-08-30 15:26   ` Ben Hutchings [this message]
2011-08-31  5:52     ` Giuseppe CAVALLARO
2011-09-02  6:48       ` Giuseppe CAVALLARO
2011-08-30 14:21 ` [PATCH 5/9] stmmac: export DMA TX/RX rings via debugfs (v2) Giuseppe CAVALLARO
2011-08-30 14:21 ` [PATCH 6/9] stmmac: rework the code to get the Synopsys ID (v2) Giuseppe CAVALLARO
2011-08-30 14:21 ` [PATCH 7/9] stmmac: add HW DMA feature register (v2) Giuseppe CAVALLARO
2011-08-30 14:21 ` [PATCH 8/9] stmmac: update the doc with new info about the driver's debug (v2) Giuseppe CAVALLARO
2011-08-30 14:21 ` [PATCH 9/9] stmmac: update the driver version (Aug_2011) (v2) Giuseppe CAVALLARO

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=1314718004.2752.15.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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).