aboutsummaryrefslogtreecommitdiff
path: root/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-15 08:01:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-15 08:01:15 -0700
commit97c7d1ea1f80f457da78b11ca638b7096a4548ee (patch)
tree797050142acefb12ddd94bfd08ef2cfab53462aa /drivers/infiniband/ulp/ipoib/ipoib_ethtool.c
parent4d3702b62e004172f44870763cf56793d8de0cbf (diff)
parentf507d28bff0601f1a8a96b7939fa3855c50d25b6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (52 commits) IB/mlx4: Use kzalloc() for new QPs so flags are initialized to 0 mlx4_core: Use MOD_STAT_CFG command to get minimal page size RDMA/cma: Simplify locking needed for serialization of callbacks RDMA/addr: Keep pointer to netdevice in struct rdma_dev_addr RDMA/cxgb3: Fixes for zero STag RDMA/core: Add local DMA L_Key support IB/mthca: Fix check of max_send_sge for special QPs IB/mthca: Use round_jiffies() for catastrophic error polling timer IB/mthca: Remove "stop" flag for catastrophic error polling timer IPoIB: Double default RX/TX ring sizes IPoIB/cm: Reduce connected mode TX object size IB/ipath: Use IEEE OUI for vendor_id reported by ibv_query_device() IPoIB: Use dev_set_mtu() to change mtu IPoIB: Use rtnl lock/unlock when changing device flags IPoIB: Get rid of ipoib_mcast_detach() wrapper IPoIB: Only set Q_Key once: after joining broadcast group IPoIB: Remove priv->mcast_mutex IPoIB: Remove unused IPOIB_MCAST_STARTED code RDMA/cxgb3: Set rkey field for new memory windows in iwch_alloc_mw() RDMA/nes: Get rid of ring_doorbell parameter of nes_post_cqp_request() ...
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_ethtool.c')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ethtool.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c
index 10279b79c44..66af5c1a76e 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c
@@ -86,11 +86,57 @@ static int ipoib_set_coalesce(struct net_device *dev,
return 0;
}
+static const char ipoib_stats_keys[][ETH_GSTRING_LEN] = {
+ "LRO aggregated", "LRO flushed",
+ "LRO avg aggr", "LRO no desc"
+};
+
+static void ipoib_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
+{
+ switch (stringset) {
+ case ETH_SS_STATS:
+ memcpy(data, *ipoib_stats_keys, sizeof(ipoib_stats_keys));
+ break;
+ }
+}
+
+static int ipoib_get_sset_count(struct net_device *dev, int sset)
+{
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(ipoib_stats_keys);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+
+static void ipoib_get_ethtool_stats(struct net_device *dev,
+ struct ethtool_stats *stats, uint64_t *data)
+{
+ struct ipoib_dev_priv *priv = netdev_priv(dev);
+ int index = 0;
+
+ /* Get LRO statistics */
+ data[index++] = priv->lro.lro_mgr.stats.aggregated;
+ data[index++] = priv->lro.lro_mgr.stats.flushed;
+ if (priv->lro.lro_mgr.stats.flushed)
+ data[index++] = priv->lro.lro_mgr.stats.aggregated /
+ priv->lro.lro_mgr.stats.flushed;
+ else
+ data[index++] = 0;
+ data[index++] = priv->lro.lro_mgr.stats.no_desc;
+}
+
static const struct ethtool_ops ipoib_ethtool_ops = {
.get_drvinfo = ipoib_get_drvinfo,
.get_tso = ethtool_op_get_tso,
.get_coalesce = ipoib_get_coalesce,
.set_coalesce = ipoib_set_coalesce,
+ .get_flags = ethtool_op_get_flags,
+ .set_flags = ethtool_op_set_flags,
+ .get_strings = ipoib_get_strings,
+ .get_sset_count = ipoib_get_sset_count,
+ .get_ethtool_stats = ipoib_get_ethtool_stats,
};
void ipoib_set_ethtool_ops(struct net_device *dev)