diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2015-12-18 10:59:46 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-12-22 14:39:00 -0500 |
commit | 4a061b287b1eb58676875cc45929679911d1ca38 (patch) | |
tree | 8ed8dad4965bdc2592f7547593aaf2ed01e3bfae /drivers/infiniband/ulp/ipoib/ipoib_main.c | |
parent | 86bee4c9c126b4f73e3f152cd43c806cac9135ad (diff) | |
download | lwn-4a061b287b1eb58676875cc45929679911d1ca38.tar.gz lwn-4a061b287b1eb58676875cc45929679911d1ca38.zip |
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_main.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 7d3281866ffc..58732c531ad6 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1777,26 +1777,7 @@ int ipoib_add_pkey_attr(struct net_device *dev) int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca) { - struct ib_device_attr *device_attr; - int result = -ENOMEM; - - device_attr = kmalloc(sizeof *device_attr, GFP_KERNEL); - if (!device_attr) { - printk(KERN_WARNING "%s: allocation of %zu bytes failed\n", - hca->name, sizeof *device_attr); - return result; - } - - result = ib_query_device(hca, device_attr); - if (result) { - printk(KERN_WARNING "%s: ib_query_device failed (ret = %d)\n", - hca->name, result); - kfree(device_attr); - return result; - } - priv->hca_caps = device_attr->device_cap_flags; - - kfree(device_attr); + priv->hca_caps = hca->attrs.device_cap_flags; if (priv->hca_caps & IB_DEVICE_UD_IP_CSUM) { priv->dev->hw_features = NETIF_F_SG | |