]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/infiniband/hw/cxgb3/iwch_provider.c
RDMA/cxgb3: Return correct max_inline_data when creating a QP
[mirror_ubuntu-bionic-kernel.git] / drivers / infiniband / hw / cxgb3 / iwch_provider.c
index b5436ca92e68cdb8d09063861ecd7af6bb89eeb5..ee3d63cd1f963a6ac660434fc9a1661db1875e11 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/ethtool.h>
+#include <linux/rtnetlink.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -645,7 +646,7 @@ static struct ib_mr *iwch_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
        if (err)
                goto err;
 
-       if (udata && t3b_device(rhp)) {
+       if (udata && !t3a_device(rhp)) {
                uresp.pbl_addr = (mhp->attr.pbl_addr -
                                 rhp->rdev.rnic_info.pbl_base) >> 3;
                PDBG("%s user resp pbl_addr 0x%x\n", __FUNCTION__,
@@ -818,8 +819,11 @@ static struct ib_qp *iwch_create_qp(struct ib_pd *pd,
                kfree(qhp);
                return ERR_PTR(-ENOMEM);
        }
+
        attrs->cap.max_recv_wr = rqsize - 1;
        attrs->cap.max_send_wr = sqsize;
+       attrs->cap.max_inline_data = T3_MAX_INLINE;
+
        qhp->rhp = rhp;
        qhp->attr.pd = php->pdid;
        qhp->attr.scq = ((struct iwch_cq *) attrs->send_cq)->cq.cqid;
@@ -1053,7 +1057,9 @@ static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
        struct net_device *lldev = dev->rdev.t3cdev_p->lldev;
 
        PDBG("%s class dev 0x%p\n", __FUNCTION__, cdev);
+       rtnl_lock();
        lldev->ethtool_ops->get_drvinfo(lldev, &info);
+       rtnl_unlock();
        return sprintf(buf, "%s\n", info.fw_version);
 }
 
@@ -1065,7 +1071,9 @@ static ssize_t show_hca(struct class_device *cdev, char *buf)
        struct net_device *lldev = dev->rdev.t3cdev_p->lldev;
 
        PDBG("%s class dev 0x%p\n", __FUNCTION__, cdev);
+       rtnl_lock();
        lldev->ethtool_ops->get_drvinfo(lldev, &info);
+       rtnl_unlock();
        return sprintf(buf, "%s\n", info.driver);
 }