Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Cc: davem@davemloft.net, netdev@vger.kernel.org, eugenia@mellanox.co.il
Subject: Re: [PATCH net 3/6] mlx4_en: eth statistics modification
Date: Wed, 18 Jan 2012 20:54:17 +0100	[thread overview]
Message-ID: <1326916457.2742.0.camel@edumazet-laptop> (raw)
In-Reply-To: <4F17204D.6030109@mellanox.co.il>

Le mercredi 18 janvier 2012 à 21:41 +0200, Yevgeny Petrilin a écrit :
> From: Eugenia Emantayev <eugenia@mellanox.co.il>
> 
> In native mode display all available statistics.
> In SRIOV mode on VF display only SW counters statistics,
> in SRIOV mode on hypervisor display SW counters and errors (got from FW)
> statistics.
> 
> Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
> Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
> ---
>  drivers/net/ethernet/mellanox/mlx4/en_ethtool.c |   72 ++++++++++++++++++-----
>  drivers/net/ethernet/mellanox/mlx4/en_netdev.c  |    2 +
>  drivers/net/ethernet/mellanox/mlx4/mlx4_en.h    |    1 +
>  drivers/net/ethernet/mellanox/mlx4/port.c       |   21 +++++++
>  include/linux/mlx4/device.h                     |    1 +
>  5 files changed, 81 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> index 53c6686..0e5f275 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> @@ -183,10 +183,17 @@ static int mlx4_en_set_wol(struct net_device *netdev,
>  static int mlx4_en_get_sset_count(struct net_device *dev, int sset)
>  {
>  	struct mlx4_en_priv *priv = netdev_priv(dev);
> +	u64 bm = priv->stats_bitmap;
> +	int bit_count = 0;
>  
>  	switch (sset) {
>  	case ETH_SS_STATS:
> -		return NUM_ALL_STATS +
> +		while (bm) {
> +			if (bm & 1)
> +				bit_count++;
> +			bm >>= 1;
> +		}

hweight64(bm) ?

      reply	other threads:[~2012-01-18 19:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 19:41 [PATCH net 3/6] mlx4_en: eth statistics modification Yevgeny Petrilin
2012-01-18 19:54 ` Eric Dumazet [this message]

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=1326916457.2742.0.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eugenia@mellanox.co.il \
    --cc=netdev@vger.kernel.org \
    --cc=yevgenyp@mellanox.co.il \
    /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