aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorYan Burman <yanb@mellanox.com>2013-02-19 10:40:23 -0500
committerRoland Dreier <roland@purestorage.com>2013-02-19 11:21:36 -0500
commit4b48680b5572ee78834c276548e16ac5316908cb (patch)
tree26d37ba4ef4176b438188697d5a17aee9bf6a7a2 /drivers/infiniband
parent9d1ad66e3eae0faf3f19a618da74b4c377474845 (diff)
IPoIB: Add version and firmware info to ethtool reporting
Implement version info as well as report firmware version and bus info of the underlying IB HW device. Signed-off-by: Yan Burman <yanb@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib.h2
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ethtool.c19
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c5
3 files changed, 25 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index a7ac0977cb5e..eb71aaa26a9a 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -762,4 +762,6 @@ extern int ipoib_debug_level;
762 762
763#define IPOIB_QPN(ha) (be32_to_cpup((__be32 *) ha) & 0xffffff) 763#define IPOIB_QPN(ha) (be32_to_cpup((__be32 *) ha) & 0xffffff)
764 764
765extern const char ipoib_driver_version[];
766
765#endif /* _IPOIB_H */ 767#endif /* _IPOIB_H */
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c
index 29bc7b5724ac..c4b3940845e6 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c
@@ -39,7 +39,24 @@
39static void ipoib_get_drvinfo(struct net_device *netdev, 39static void ipoib_get_drvinfo(struct net_device *netdev,
40 struct ethtool_drvinfo *drvinfo) 40 struct ethtool_drvinfo *drvinfo)
41{ 41{
42 strncpy(drvinfo->driver, "ipoib", sizeof(drvinfo->driver) - 1); 42 struct ipoib_dev_priv *priv = netdev_priv(netdev);
43 struct ib_device_attr *attr;
44
45 attr = kmalloc(sizeof(*attr), GFP_KERNEL);
46 if (attr && !ib_query_device(priv->ca, attr))
47 snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
48 "%d.%d.%d", (int)(attr->fw_ver >> 32),
49 (int)(attr->fw_ver >> 16) & 0xffff,
50 (int)attr->fw_ver & 0xffff);
51 kfree(attr);
52
53 strlcpy(drvinfo->bus_info, dev_name(priv->ca->dma_device),
54 sizeof(drvinfo->bus_info));
55
56 strlcpy(drvinfo->version, ipoib_driver_version,
57 sizeof(drvinfo->version));
58
59 strlcpy(drvinfo->driver, "ib_ipoib", sizeof(drvinfo->driver));
43} 60}
44 61
45static int ipoib_get_coalesce(struct net_device *dev, 62static int ipoib_get_coalesce(struct net_device *dev,
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index a68628e4197a..4fe44eba2f9f 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -49,9 +49,14 @@
49#include <linux/jhash.h> 49#include <linux/jhash.h>
50#include <net/arp.h> 50#include <net/arp.h>
51 51
52#define DRV_VERSION "1.0.0"
53
54const char ipoib_driver_version[] = DRV_VERSION;
55
52MODULE_AUTHOR("Roland Dreier"); 56MODULE_AUTHOR("Roland Dreier");
53MODULE_DESCRIPTION("IP-over-InfiniBand net driver"); 57MODULE_DESCRIPTION("IP-over-InfiniBand net driver");
54MODULE_LICENSE("Dual BSD/GPL"); 58MODULE_LICENSE("Dual BSD/GPL");
59MODULE_VERSION(DRV_VERSION);
55 60
56int ipoib_sendq_size __read_mostly = IPOIB_TX_RING_SIZE; 61int ipoib_sendq_size __read_mostly = IPOIB_TX_RING_SIZE;
57int ipoib_recvq_size __read_mostly = IPOIB_RX_RING_SIZE; 62int ipoib_recvq_size __read_mostly = IPOIB_RX_RING_SIZE;