All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Hans Westgaard Ry <hans.westgaard.ry@oracle.com>
Cc: Doug Ledford <dledford@redhat.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	Santosh Shilimkar <santosh.shilimkar@oracle.com>,
	Yuval Shaia <yuval.shaia@oracle.com>,
	"open list:INFINIBAND SUBSYSTEM" <linux-rdma@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] IB/ipoib: Add readout of statistics using ethtool
Date: Wed, 20 Apr 2016 00:58:42 -0700	[thread overview]
Message-ID: <1461139122.1917.52.camel@perches.com> (raw)
In-Reply-To: <1461138630-15158-1-git-send-email-hans.westgaard.ry@oracle.com>

On Wed, 2016-04-20 at 09:50 +0200, Hans Westgaard Ry wrote:
> IPoIB collects statistics of traffic including number of packets
> sent/received, number of bytes transferred, and certain errors. This
> patch makes these statistics available to be queried by ethtool.

trivial notes:

> diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c
[]
> @@ -36,6 +36,31 @@
>  
>  #include "ipoib.h"
>  
> +struct ipoib_stats {
> +	char stat_string[ETH_GSTRING_LEN];
> +	int stat_offset;
> +};
> +
> +
> +#define IPOIB_NETDEV_STAT(str, m) { \
> +		.stat_string = str, \
> +		.stat_offset = offsetof(struct rtnl_link_stats64, m) }
> +
> +
> +

A few unnecessary extra blank lines

> +static const struct ipoib_stats ipoib_gstrings_stats[] = {
> +	IPOIB_NETDEV_STAT("rx_packets", rx_packets),
> +	IPOIB_NETDEV_STAT("tx_packets", tx_packets),
> +	IPOIB_NETDEV_STAT("rx_bytes",   rx_bytes),
> +	IPOIB_NETDEV_STAT("tx_bytes",   tx_bytes),
> +	IPOIB_NETDEV_STAT("tx_errors",  tx_errors),
> +	IPOIB_NETDEV_STAT("rx_dropped", rx_dropped),
> +	IPOIB_NETDEV_STAT("tx_dropped", tx_dropped)
> +};

Couldn't the macro could be simplified by using # and
a single argument?


> +static int ipoib_get_sset_count(struct net_device __always_unused *dev,
> +				 int sset)
> +{
> +	switch (sset) {
> +	case ETH_SS_STATS:
> +		return IPOIB_GLOBAL_STATS_LEN;
> +	case ETH_SS_TEST:
> +	default:
> +		return -EOPNOTSUPP;
> +	}
> +}

Didn't some old versions of gcc complain about reaching
the end of a non-void function?

  reply	other threads:[~2016-04-20  7:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 10:17 [PATCH] IB/ipoib: Add readout of statistics using ethtool Hans Westgaard Ry
2016-04-15 10:17 ` Hans Westgaard Ry
     [not found] ` <1460715468-16235-1-git-send-email-hans.westgaard.ry-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-04-19 14:50   ` Erez Shitrit
2016-04-19 14:50     ` Erez Shitrit
     [not found]     ` <CAAk-MO-RuWB_ecPr02Tr5brwv6E9dJWg+06=tpoxW1Ec=O3dUg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-19 17:33       ` Leon Romanovsky
2016-04-19 17:33         ` Leon Romanovsky
2016-04-20  7:50   ` [PATCH v1] " Hans Westgaard Ry
2016-04-20  7:50     ` Hans Westgaard Ry
2016-04-20  7:58     ` Joe Perches [this message]
2016-04-20 10:09   ` [PATCH v2] " Hans Westgaard Ry
2016-04-20 10:09     ` Hans Westgaard Ry
2016-04-21 11:13   ` [PATCH v3] " Hans Westgaard Ry
2016-04-21 11:13     ` Hans Westgaard Ry
     [not found]     ` <1461237201-25738-1-git-send-email-hans.westgaard.ry-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2016-04-21 12:58       ` Hans Westgaard Ry
2016-04-21 12:58         ` Hans Westgaard Ry
2016-05-12 20:10     ` Doug Ledford
2016-05-12 20:10       ` Doug Ledford

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=1461139122.1917.52.camel@perches.com \
    --to=joe@perches.com \
    --cc=dledford@redhat.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=hans.westgaard.ry@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=santosh.shilimkar@oracle.com \
    --cc=sean.hefty@intel.com \
    --cc=yuval.shaia@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.