diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2015-12-18 11:59:46 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-12-22 22:39:00 +0300 |
commit | 4a061b287b1eb58676875cc45929679911d1ca38 (patch) | |
tree | 8ed8dad4965bdc2592f7547593aaf2ed01e3bfae /drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | |
parent | 86bee4c9c126b4f73e3f152cd43c806cac9135ad (diff) | |
download | linux-4a061b287b1eb58676875cc45929679911d1ca38.tar.xz |
IB/ulps: Avoid calling ib_query_device
Instead, use the cached copy of the attributes present on the device.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_ethtool.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c index 078cadd6c797..a53fa5fc0dec 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c @@ -40,15 +40,11 @@ static void ipoib_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) { struct ipoib_dev_priv *priv = netdev_priv(netdev); - struct ib_device_attr *attr; - - attr = kmalloc(sizeof(*attr), GFP_KERNEL); - if (attr && !ib_query_device(priv->ca, attr)) - snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), - "%d.%d.%d", (int)(attr->fw_ver >> 32), - (int)(attr->fw_ver >> 16) & 0xffff, - (int)attr->fw_ver & 0xffff); - kfree(attr); + + snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), + "%d.%d.%d", (int)(priv->ca->attrs.fw_ver >> 32), + (int)(priv->ca->attrs.fw_ver >> 16) & 0xffff, + (int)priv->ca->attrs.fw_ver & 0xffff); strlcpy(drvinfo->bus_info, dev_name(priv->ca->dma_device), sizeof(drvinfo->bus_info)); |