[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1461139122.1917.52.camel@perches.com>
Date: Wed, 20 Apr 2016 00:58:42 -0700
From: Joe Perches <joe@...ches.com>
To: Hans Westgaard Ry <hans.westgaard.ry@...cle.com>
Cc: Doug Ledford <dledford@...hat.com>,
Sean Hefty <sean.hefty@...el.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
Or Gerlitz <ogerlitz@...lanox.com>,
Santosh Shilimkar <santosh.shilimkar@...cle.com>,
Yuval Shaia <yuval.shaia@...cle.com>,
"open list:INFINIBAND SUBSYSTEM" <linux-rdma@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] IB/ipoib: Add readout of statistics using ethtool
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?
Powered by blists - more mailing lists