]> Git Repo - linux.git/commitdiff
Merge branch 'uverbs_dev_cleanups' into rdma.git for-next
authorJason Gunthorpe <[email protected]>
Wed, 5 Sep 2018 22:21:22 +0000 (16:21 -0600)
committerJason Gunthorpe <[email protected]>
Wed, 5 Sep 2018 22:21:22 +0000 (16:21 -0600)
For dependencies, branch based on rdma.git 'for-rc' of
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/

Pull 'uverbs_dev_cleanups' from Leon Romanovsky:

====================
Reuse the char device code interfaces to simplify ib_uverbs_device
creation and destruction. As part of this series, we are sending fix to
cleanup path, which was discovered during internal review,

The fix definitely can go to -rc, but it means that this series will be
dependent on rdma-rc.
====================

* branch 'uverbs_dev_cleanups':
  RDMA/uverbs: Use device.groups to initialize device attributes
  RDMA/uverbs: Use cdev_device_add() instead of cdev_add()
  RDMA/core: Depend on device_add() to add device attributes
  RDMA/uverbs: Fix error cleanup path of ib_uverbs_add_one()

Resolved conflict in ib_device_unregister_sysfs()

Signed-off-by: Jason Gunthorpe <[email protected]>
1  2 
drivers/infiniband/core/sysfs.c
drivers/infiniband/hw/bnxt_re/qplib_fp.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
include/rdma/ib_verbs.h

index 62351b3fcafc8290045ae9629016f621a823b021,185075af3ad6bf63172cbd68d607f5696eb7b323..0b04dbff884f48efac7c7ffc49619dfe73b45c8f
@@@ -1183,7 -1183,7 +1183,7 @@@ err_put
        return ret;
  }
  
- static ssize_t show_node_type(struct device *device,
+ static ssize_t node_type_show(struct device *device,
                              struct device_attribute *attr, char *buf)
  {
        struct ib_device *dev = container_of(device, struct ib_device, dev);
        default:                  return sprintf(buf, "%d: <unknown>\n", dev->node_type);
        }
  }
+ static DEVICE_ATTR_RO(node_type);
  
- static ssize_t show_sys_image_guid(struct device *device,
+ static ssize_t sys_image_guid_show(struct device *device,
                                   struct device_attribute *dev_attr, char *buf)
  {
        struct ib_device *dev = container_of(device, struct ib_device, dev);
                       be16_to_cpu(((__be16 *) &dev->attrs.sys_image_guid)[2]),
                       be16_to_cpu(((__be16 *) &dev->attrs.sys_image_guid)[3]));
  }
+ static DEVICE_ATTR_RO(sys_image_guid);
  
- static ssize_t show_node_guid(struct device *device,
+ static ssize_t node_guid_show(struct device *device,
                              struct device_attribute *attr, char *buf)
  {
        struct ib_device *dev = container_of(device, struct ib_device, dev);
                       be16_to_cpu(((__be16 *) &dev->node_guid)[2]),
                       be16_to_cpu(((__be16 *) &dev->node_guid)[3]));
  }
+ static DEVICE_ATTR_RO(node_guid);
  
- static ssize_t show_node_desc(struct device *device,
+ static ssize_t node_desc_show(struct device *device,
                              struct device_attribute *attr, char *buf)
  {
        struct ib_device *dev = container_of(device, struct ib_device, dev);
        return sprintf(buf, "%.64s\n", dev->node_desc);
  }
  
- static ssize_t set_node_desc(struct device *device,
-                            struct device_attribute *attr,
-                            const char *buf, size_t count)
+ static ssize_t node_desc_store(struct device *device,
+                              struct device_attribute *attr,
+                              const char *buf, size_t count)
  {
        struct ib_device *dev = container_of(device, struct ib_device, dev);
        struct ib_device_modify desc = {};
  
        return count;
  }
+ static DEVICE_ATTR_RW(node_desc);
  
- static ssize_t show_fw_ver(struct device *device, struct device_attribute *attr,
+ static ssize_t fw_ver_show(struct device *device, struct device_attribute *attr,
                           char *buf)
  {
        struct ib_device *dev = container_of(device, struct ib_device, dev);
        strlcat(buf, "\n", IB_FW_VERSION_NAME_MAX);
        return strlen(buf);
  }
+ static DEVICE_ATTR_RO(fw_ver);
+ static struct attribute *ib_dev_attrs[] = {
+       &dev_attr_node_type.attr,
+       &dev_attr_node_guid.attr,
+       &dev_attr_sys_image_guid.attr,
+       &dev_attr_fw_ver.attr,
+       &dev_attr_node_desc.attr,
+       NULL,
+ };
  
- static DEVICE_ATTR(node_type, S_IRUGO, show_node_type, NULL);
- static DEVICE_ATTR(sys_image_guid, S_IRUGO, show_sys_image_guid, NULL);
- static DEVICE_ATTR(node_guid, S_IRUGO, show_node_guid, NULL);
- static DEVICE_ATTR(node_desc, S_IRUGO | S_IWUSR, show_node_desc, set_node_desc);
- static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
- static struct device_attribute *ib_class_attributes[] = {
-       &dev_attr_node_type,
-       &dev_attr_sys_image_guid,
-       &dev_attr_node_guid,
-       &dev_attr_node_desc,
-       &dev_attr_fw_ver,
+ static const struct attribute_group dev_attr_group = {
+       .attrs = ib_dev_attrs,
  };
  
  static void free_port_list_attributes(struct ib_device *device)
@@@ -1311,16 -1315,13 +1315,13 @@@ int ib_device_register_sysfs(struct ib_
        if (ret)
                return ret;
  
+       device->groups[0] = &dev_attr_group;
+       class_dev->groups = device->groups;
        ret = device_add(class_dev);
        if (ret)
                goto err;
  
-       for (i = 0; i < ARRAY_SIZE(ib_class_attributes); ++i) {
-               ret = device_create_file(class_dev, ib_class_attributes[i]);
-               if (ret)
-                       goto err_unregister;
-       }
        device->ports_parent = kobject_create_and_add("ports",
                                                      &class_dev->kobj);
        if (!device->ports_parent) {
  
  err_put:
        free_port_list_attributes(device);
- err_unregister:
        device_del(class_dev);
  err:
        return ret;
  }
  
  void ib_device_unregister_sysfs(struct ib_device *device)
  {
-       int i;
 -      /* Hold kobject until ib_dealloc_device() */
 -      kobject_get(&device->dev.kobj);
 +      /* Hold device until ib_dealloc_device() */
 +      get_device(&device->dev);
  
        free_port_list_attributes(device);
  
                free_hsag(&device->dev.kobj, device->hw_stats_ag);
        }
  
-       for (i = 0; i < ARRAY_SIZE(ib_class_attributes); ++i)
-               device_remove_file(&device->dev, ib_class_attributes[i]);
        device_unregister(&device->dev);
  }
index f92605aa42b48bff2eed61c59866bc3e542842c2,6ad0d46ab879a6a1bf6d231e22b6e766b796efd2..6eaa4b2abb7824f3ae5f8ceb67d5e0c2be64c787
@@@ -36,8 -36,6 +36,8 @@@
   * Description: Fast Path Operators
   */
  
 +#define dev_fmt(fmt) "QPLIB: " fmt
 +
  #include <linux/interrupt.h>
  #include <linux/spinlock.h>
  #include <linux/sched.h>
@@@ -73,7 -71,8 +73,7 @@@ static void __bnxt_qplib_add_flush_qp(s
  
        if (!qp->sq.flushed) {
                dev_dbg(&scq->hwq.pdev->dev,
 -                      "QPLIB: FP: Adding to SQ Flush list = %p",
 -                      qp);
 +                      "FP: Adding to SQ Flush list = %p\n", qp);
                bnxt_qplib_cancel_phantom_processing(qp);
                list_add_tail(&qp->sq_flush, &scq->sqf_head);
                qp->sq.flushed = true;
@@@ -81,7 -80,8 +81,7 @@@
        if (!qp->srq) {
                if (!qp->rq.flushed) {
                        dev_dbg(&rcq->hwq.pdev->dev,
 -                              "QPLIB: FP: Adding to RQ Flush list = %p",
 -                              qp);
 +                              "FP: Adding to RQ Flush list = %p\n", qp);
                        list_add_tail(&qp->rq_flush, &rcq->rqf_head);
                        qp->rq.flushed = true;
                }
@@@ -196,7 -196,7 +196,7 @@@ static int bnxt_qplib_alloc_qp_hdr_buf(
                                       struct bnxt_qplib_qp *qp)
  {
        struct bnxt_qplib_q *rq = &qp->rq;
-       struct bnxt_qplib_q *sq = &qp->rq;
+       struct bnxt_qplib_q *sq = &qp->sq;
        int rc = 0;
  
        if (qp->sq_hdr_buf_size && sq->hwq.max_elements) {
                if (!qp->sq_hdr_buf) {
                        rc = -ENOMEM;
                        dev_err(&res->pdev->dev,
 -                              "QPLIB: Failed to create sq_hdr_buf");
 +                              "Failed to create sq_hdr_buf\n");
                        goto fail;
                }
        }
                if (!qp->rq_hdr_buf) {
                        rc = -ENOMEM;
                        dev_err(&res->pdev->dev,
 -                              "QPLIB: Failed to create rq_hdr_buf");
 +                              "Failed to create rq_hdr_buf\n");
                        goto fail;
                }
        }
@@@ -277,7 -277,8 +277,7 @@@ static void bnxt_qplib_service_nq(unsig
                                num_cqne_processed++;
                        else
                                dev_warn(&nq->pdev->dev,
 -                                       "QPLIB: cqn - type 0x%x not handled",
 -                                       type);
 +                                       "cqn - type 0x%x not handled\n", type);
                        spin_unlock_bh(&cq->compl_lock);
                        break;
                }
                                num_srqne_processed++;
                        else
                                dev_warn(&nq->pdev->dev,
 -                                       "QPLIB: SRQ event 0x%x not handled",
 +                                       "SRQ event 0x%x not handled\n",
                                         nqsrqe->event);
                        break;
                }
                        break;
                default:
                        dev_warn(&nq->pdev->dev,
 -                               "QPLIB: nqe with type = 0x%x not handled",
 -                               type);
 +                               "nqe with type = 0x%x not handled\n", type);
                        break;
                }
                raw_cons++;
@@@ -394,7 -396,7 +394,7 @@@ int bnxt_qplib_nq_start_irq(struct bnxt
        rc = irq_set_affinity_hint(nq->vector, &nq->mask);
        if (rc) {
                dev_warn(&nq->pdev->dev,
 -                       "QPLIB: set affinity failed; vector: %d nq_idx: %d\n",
 +                       "set affinity failed; vector: %d nq_idx: %d\n",
                         nq->vector, nq_indx);
        }
        nq->requested = true;
@@@ -441,7 -443,7 +441,7 @@@ int bnxt_qplib_enable_nq(struct pci_de
        rc = bnxt_qplib_nq_start_irq(nq, nq_idx, msix_vector, true);
        if (rc) {
                dev_err(&nq->pdev->dev,
 -                      "QPLIB: Failed to request irq for nq-idx %d", nq_idx);
 +                      "Failed to request irq for nq-idx %d\n", nq_idx);
                goto fail;
        }
  
@@@ -660,8 -662,8 +660,8 @@@ int bnxt_qplib_post_srq_recv(struct bnx
  
        spin_lock(&srq_hwq->lock);
        if (srq->start_idx == srq->last_idx) {
 -              dev_err(&srq_hwq->pdev->dev, "QPLIB: FP: SRQ (0x%x) is full!",
 -                      srq->id);
 +              dev_err(&srq_hwq->pdev->dev,
 +                      "FP: SRQ (0x%x) is full!\n", srq->id);
                rc = -EINVAL;
                spin_unlock(&srq_hwq->lock);
                goto done;
@@@ -1322,7 -1324,7 +1322,7 @@@ int bnxt_qplib_query_qp(struct bnxt_qpl
                }
        }
        if (i == res->sgid_tbl.max)
 -              dev_warn(&res->pdev->dev, "QPLIB: SGID not found??");
 +              dev_warn(&res->pdev->dev, "SGID not found??\n");
  
        qp->ah.hop_limit = sb->hop_limit;
        qp->ah.traffic_class = sb->traffic_class;
@@@ -1534,7 -1536,7 +1534,7 @@@ int bnxt_qplib_post_send(struct bnxt_qp
  
        if (bnxt_qplib_queue_full(sq)) {
                dev_err(&sq->hwq.pdev->dev,
 -                      "QPLIB: prod = %#x cons = %#x qdepth = %#x delta = %#x",
 +                      "prod = %#x cons = %#x qdepth = %#x delta = %#x\n",
                        sq->hwq.prod, sq->hwq.cons, sq->hwq.max_elements,
                        sq->q_full_delta);
                rc = -ENOMEM;
                /* Copy the inline data */
                if (wqe->inline_len > BNXT_QPLIB_SWQE_MAX_INLINE_LENGTH) {
                        dev_warn(&sq->hwq.pdev->dev,
 -                               "QPLIB: Inline data length > 96 detected");
 +                               "Inline data length > 96 detected\n");
                        data_len = BNXT_QPLIB_SWQE_MAX_INLINE_LENGTH;
                } else {
                        data_len = wqe->inline_len;
@@@ -1774,7 -1776,7 +1774,7 @@@ done
                        queue_work(qp->scq->nq->cqn_wq, &nq_work->work);
                } else {
                        dev_err(&sq->hwq.pdev->dev,
 -                              "QPLIB: FP: Failed to allocate SQ nq_work!");
 +                              "FP: Failed to allocate SQ nq_work!\n");
                        rc = -ENOMEM;
                }
        }
@@@ -1813,12 -1815,13 +1813,12 @@@ int bnxt_qplib_post_recv(struct bnxt_qp
        if (qp->state == CMDQ_MODIFY_QP_NEW_STATE_ERR) {
                sch_handler = true;
                dev_dbg(&rq->hwq.pdev->dev,
 -                      "%s Error QP. Scheduling for poll_cq\n",
 -                      __func__);
 +                      "%s: Error QP. Scheduling for poll_cq\n", __func__);
                goto queue_err;
        }
        if (bnxt_qplib_queue_full(rq)) {
                dev_err(&rq->hwq.pdev->dev,
 -                      "QPLIB: FP: QP (0x%x) RQ is full!", qp->id);
 +                      "FP: QP (0x%x) RQ is full!\n", qp->id);
                rc = -EINVAL;
                goto done;
        }
@@@ -1867,7 -1870,7 +1867,7 @@@ queue_err
                        queue_work(qp->rcq->nq->cqn_wq, &nq_work->work);
                } else {
                        dev_err(&rq->hwq.pdev->dev,
 -                              "QPLIB: FP: Failed to allocate RQ nq_work!");
 +                              "FP: Failed to allocate RQ nq_work!\n");
                        rc = -ENOMEM;
                }
        }
@@@ -1929,7 -1932,7 +1929,7 @@@ int bnxt_qplib_create_cq(struct bnxt_qp
  
        if (!cq->dpi) {
                dev_err(&rcfw->pdev->dev,
 -                      "QPLIB: FP: CREATE_CQ failed due to NULL DPI");
 +                      "FP: CREATE_CQ failed due to NULL DPI\n");
                return -EINVAL;
        }
        req.dpi = cpu_to_le32(cq->dpi->dpi);
@@@ -2169,7 -2172,7 +2169,7 @@@ static int do_wa9060(struct bnxt_qplib_
                                                 *  comes back
                                                 */
                                                dev_dbg(&cq->hwq.pdev->dev,
 -                                                      "FP:Got Phantom CQE");
 +                                                      "FP: Got Phantom CQE\n");
                                                sq->condition = false;
                                                sq->single = true;
                                                rc = 0;
                        peek_raw_cq_cons++;
                }
                dev_err(&cq->hwq.pdev->dev,
 -                      "Should not have come here! cq_cons=0x%x qp=0x%x sq cons sw=0x%x hw=0x%x",
 +                      "Should not have come here! cq_cons=0x%x qp=0x%x sq cons sw=0x%x hw=0x%x\n",
                        cq_cons, qp->id, sw_sq_cons, cqe_sq_cons);
                rc = -EINVAL;
        }
@@@ -2210,7 -2213,7 +2210,7 @@@ static int bnxt_qplib_cq_process_req(st
                                      le64_to_cpu(hwcqe->qp_handle));
        if (!qp) {
                dev_err(&cq->hwq.pdev->dev,
 -                      "QPLIB: FP: Process Req qp is NULL");
 +                      "FP: Process Req qp is NULL\n");
                return -EINVAL;
        }
        sq = &qp->sq;
        cqe_sq_cons = HWQ_CMP(le16_to_cpu(hwcqe->sq_cons_idx), &sq->hwq);
        if (cqe_sq_cons > sq->hwq.max_elements) {
                dev_err(&cq->hwq.pdev->dev,
 -                      "QPLIB: FP: CQ Process req reported ");
 -              dev_err(&cq->hwq.pdev->dev,
 -                      "QPLIB: sq_cons_idx 0x%x which exceeded max 0x%x",
 +                      "FP: CQ Process req reported sq_cons_idx 0x%x which exceeded max 0x%x\n",
                        cqe_sq_cons, sq->hwq.max_elements);
                return -EINVAL;
        }
  
        if (qp->sq.flushed) {
                dev_dbg(&cq->hwq.pdev->dev,
 -                      "%s: QPLIB: QP in Flush QP = %p\n", __func__, qp);
 +                      "%s: QP in Flush QP = %p\n", __func__, qp);
                goto done;
        }
        /* Require to walk the sq's swq to fabricate CQEs for all previously
                    hwcqe->status != CQ_REQ_STATUS_OK) {
                        cqe->status = hwcqe->status;
                        dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: FP: CQ Processed Req ");
 -                      dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: wr_id[%d] = 0x%llx with status 0x%x",
 +                              "FP: CQ Processed Req wr_id[%d] = 0x%llx with status 0x%x\n",
                                sw_sq_cons, cqe->wr_id, cqe->status);
                        cqe++;
                        (*budget)--;
@@@ -2323,12 -2330,12 +2323,12 @@@ static int bnxt_qplib_cq_process_res_rc
        qp = (struct bnxt_qplib_qp *)((unsigned long)
                                      le64_to_cpu(hwcqe->qp_handle));
        if (!qp) {
 -              dev_err(&cq->hwq.pdev->dev, "QPLIB: process_cq RC qp is NULL");
 +              dev_err(&cq->hwq.pdev->dev, "process_cq RC qp is NULL\n");
                return -EINVAL;
        }
        if (qp->rq.flushed) {
                dev_dbg(&cq->hwq.pdev->dev,
 -                      "%s: QPLIB: QP in Flush QP = %p\n", __func__, qp);
 +                      "%s: QP in Flush QP = %p\n", __func__, qp);
                goto done;
        }
  
                        return -EINVAL;
                if (wr_id_idx >= srq->hwq.max_elements) {
                        dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: FP: CQ Process RC ");
 -                      dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: wr_id idx 0x%x exceeded SRQ max 0x%x",
 +                              "FP: CQ Process RC wr_id idx 0x%x exceeded SRQ max 0x%x\n",
                                wr_id_idx, srq->hwq.max_elements);
                        return -EINVAL;
                }
                rq = &qp->rq;
                if (wr_id_idx >= rq->hwq.max_elements) {
                        dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: FP: CQ Process RC ");
 -                      dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: wr_id idx 0x%x exceeded RQ max 0x%x",
 +                              "FP: CQ Process RC wr_id idx 0x%x exceeded RQ max 0x%x\n",
                                wr_id_idx, rq->hwq.max_elements);
                        return -EINVAL;
                }
@@@ -2398,12 -2409,12 +2398,12 @@@ static int bnxt_qplib_cq_process_res_ud
        qp = (struct bnxt_qplib_qp *)((unsigned long)
                                      le64_to_cpu(hwcqe->qp_handle));
        if (!qp) {
 -              dev_err(&cq->hwq.pdev->dev, "QPLIB: process_cq UD qp is NULL");
 +              dev_err(&cq->hwq.pdev->dev, "process_cq UD qp is NULL\n");
                return -EINVAL;
        }
        if (qp->rq.flushed) {
                dev_dbg(&cq->hwq.pdev->dev,
 -                      "%s: QPLIB: QP in Flush QP = %p\n", __func__, qp);
 +                      "%s: QP in Flush QP = %p\n", __func__, qp);
                goto done;
        }
        cqe = *pcqe;
  
                if (wr_id_idx >= srq->hwq.max_elements) {
                        dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: FP: CQ Process UD ");
 -                      dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: wr_id idx 0x%x exceeded SRQ max 0x%x",
 +                              "FP: CQ Process UD wr_id idx 0x%x exceeded SRQ max 0x%x\n",
                                wr_id_idx, srq->hwq.max_elements);
                        return -EINVAL;
                }
                rq = &qp->rq;
                if (wr_id_idx >= rq->hwq.max_elements) {
                        dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: FP: CQ Process UD ");
 -                      dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: wr_id idx 0x%x exceeded RQ max 0x%x",
 +                              "FP: CQ Process UD wr_id idx 0x%x exceeded RQ max 0x%x\n",
                                wr_id_idx, rq->hwq.max_elements);
                        return -EINVAL;
                }
@@@ -2493,12 -2508,13 +2493,12 @@@ static int bnxt_qplib_cq_process_res_ra
        qp = (struct bnxt_qplib_qp *)((unsigned long)
                                      le64_to_cpu(hwcqe->qp_handle));
        if (!qp) {
 -              dev_err(&cq->hwq.pdev->dev,
 -                      "QPLIB: process_cq Raw/QP1 qp is NULL");
 +              dev_err(&cq->hwq.pdev->dev, "process_cq Raw/QP1 qp is NULL\n");
                return -EINVAL;
        }
        if (qp->rq.flushed) {
                dev_dbg(&cq->hwq.pdev->dev,
 -                      "%s: QPLIB: QP in Flush QP = %p\n", __func__, qp);
 +                      "%s: QP in Flush QP = %p\n", __func__, qp);
                goto done;
        }
        cqe = *pcqe;
                srq = qp->srq;
                if (!srq) {
                        dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: FP: SRQ used but not defined??");
 +                              "FP: SRQ used but not defined??\n");
                        return -EINVAL;
                }
                if (wr_id_idx >= srq->hwq.max_elements) {
                        dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: FP: CQ Process Raw/QP1 ");
 -                      dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: wr_id idx 0x%x exceeded SRQ max 0x%x",
 +                              "FP: CQ Process Raw/QP1 wr_id idx 0x%x exceeded SRQ max 0x%x\n",
                                wr_id_idx, srq->hwq.max_elements);
                        return -EINVAL;
                }
                rq = &qp->rq;
                if (wr_id_idx >= rq->hwq.max_elements) {
                        dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: FP: CQ Process Raw/QP1 RQ wr_id ");
 -                      dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: ix 0x%x exceeded RQ max 0x%x",
 +                              "FP: CQ Process Raw/QP1 RQ wr_id idx 0x%x exceeded RQ max 0x%x\n",
                                wr_id_idx, rq->hwq.max_elements);
                        return -EINVAL;
                }
@@@ -2580,14 -2600,14 +2580,14 @@@ static int bnxt_qplib_cq_process_termin
        /* Check the Status */
        if (hwcqe->status != CQ_TERMINAL_STATUS_OK)
                dev_warn(&cq->hwq.pdev->dev,
 -                       "QPLIB: FP: CQ Process Terminal Error status = 0x%x",
 +                       "FP: CQ Process Terminal Error status = 0x%x\n",
                         hwcqe->status);
  
        qp = (struct bnxt_qplib_qp *)((unsigned long)
                                      le64_to_cpu(hwcqe->qp_handle));
        if (!qp) {
                dev_err(&cq->hwq.pdev->dev,
 -                      "QPLIB: FP: CQ Process terminal qp is NULL");
 +                      "FP: CQ Process terminal qp is NULL\n");
                return -EINVAL;
        }
  
  
        if (cqe_cons > sq->hwq.max_elements) {
                dev_err(&cq->hwq.pdev->dev,
 -                      "QPLIB: FP: CQ Process terminal reported ");
 -              dev_err(&cq->hwq.pdev->dev,
 -                      "QPLIB: sq_cons_idx 0x%x which exceeded max 0x%x",
 +                      "FP: CQ Process terminal reported sq_cons_idx 0x%x which exceeded max 0x%x\n",
                        cqe_cons, sq->hwq.max_elements);
                goto do_rq;
        }
  
        if (qp->sq.flushed) {
                dev_dbg(&cq->hwq.pdev->dev,
 -                      "%s: QPLIB: QP in Flush QP = %p\n", __func__, qp);
 +                      "%s: QP in Flush QP = %p\n", __func__, qp);
                goto sq_done;
        }
  
@@@ -2651,14 -2673,16 +2651,14 @@@ do_rq
                goto done;
        } else if (cqe_cons > rq->hwq.max_elements) {
                dev_err(&cq->hwq.pdev->dev,
 -                      "QPLIB: FP: CQ Processed terminal ");
 -              dev_err(&cq->hwq.pdev->dev,
 -                      "QPLIB: reported rq_cons_idx 0x%x exceeds max 0x%x",
 +                      "FP: CQ Processed terminal reported rq_cons_idx 0x%x exceeds max 0x%x\n",
                        cqe_cons, rq->hwq.max_elements);
                goto done;
        }
  
        if (qp->rq.flushed) {
                dev_dbg(&cq->hwq.pdev->dev,
 -                      "%s: QPLIB: QP in Flush QP = %p\n", __func__, qp);
 +                      "%s: QP in Flush QP = %p\n", __func__, qp);
                rc = 0;
                goto done;
        }
@@@ -2680,7 -2704,7 +2680,7 @@@ static int bnxt_qplib_cq_process_cutoff
        /* Check the Status */
        if (hwcqe->status != CQ_CUTOFF_STATUS_OK) {
                dev_err(&cq->hwq.pdev->dev,
 -                      "QPLIB: FP: CQ Process Cutoff Error status = 0x%x",
 +                      "FP: CQ Process Cutoff Error status = 0x%x\n",
                        hwcqe->status);
                return -EINVAL;
        }
@@@ -2700,12 -2724,16 +2700,12 @@@ int bnxt_qplib_process_flush_list(struc
  
        spin_lock_irqsave(&cq->flush_lock, flags);
        list_for_each_entry(qp, &cq->sqf_head, sq_flush) {
 -              dev_dbg(&cq->hwq.pdev->dev,
 -                      "QPLIB: FP: Flushing SQ QP= %p",
 -                      qp);
 +              dev_dbg(&cq->hwq.pdev->dev, "FP: Flushing SQ QP= %p\n", qp);
                __flush_sq(&qp->sq, qp, &cqe, &budget);
        }
  
        list_for_each_entry(qp, &cq->rqf_head, rq_flush) {
 -              dev_dbg(&cq->hwq.pdev->dev,
 -                      "QPLIB: FP: Flushing RQ QP= %p",
 -                      qp);
 +              dev_dbg(&cq->hwq.pdev->dev, "FP: Flushing RQ QP= %p\n", qp);
                __flush_rq(&qp->rq, qp, &cqe, &budget);
        }
        spin_unlock_irqrestore(&cq->flush_lock, flags);
@@@ -2773,7 -2801,7 +2773,7 @@@ int bnxt_qplib_poll_cq(struct bnxt_qpli
                        goto exit;
                default:
                        dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: process_cq unknown type 0x%lx",
 +                              "process_cq unknown type 0x%lx\n",
                                hw_cqe->cqe_type_toggle &
                                CQ_BASE_CQE_TYPE_MASK);
                        rc = -EINVAL;
                         * next one
                         */
                        dev_err(&cq->hwq.pdev->dev,
 -                              "QPLIB: process_cqe error rc = 0x%x", rc);
 +                              "process_cqe error rc = 0x%x\n", rc);
                }
                raw_cons++;
        }
index 8cac8e9c8c6346403fbf0cfc726f7f8153a9292a,9fed54017659de3b0f58a1287a7eff605c077f6c..25a9b8a8f63e20a5914ffc05ede29d0a4d0c9d95
@@@ -100,6 -100,11 +100,6 @@@ struct mlx5e_tc_flow_parse_attr 
        int mirred_ifindex;
  };
  
 -enum {
 -      MLX5_HEADER_TYPE_VXLAN = 0x0,
 -      MLX5_HEADER_TYPE_NVGRE = 0x1,
 -};
 -
  #define MLX5E_TC_TABLE_NUM_GROUPS 4
  #define MLX5E_TC_TABLE_MAX_GROUP_SIZE BIT(16)
  
@@@ -681,7 -686,7 +681,7 @@@ mlx5e_tc_add_nic_flow(struct mlx5e_pri
                .action = attr->action,
                .has_flow_tag = true,
                .flow_tag = attr->flow_tag,
 -              .encap_id = 0,
 +              .reformat_id = 0,
        };
        struct mlx5_fc *counter = NULL;
        struct mlx5_flow_handle *rule;
@@@ -829,7 -834,7 +829,7 @@@ mlx5e_tc_add_fdb_flow(struct mlx5e_pri
        struct mlx5e_priv *out_priv;
        int err;
  
 -      if (attr->action & MLX5_FLOW_CONTEXT_ACTION_ENCAP) {
 +      if (attr->action & MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT) {
                out_dev = __dev_get_by_index(dev_net(priv->netdev),
                                             attr->parse_attr->mirred_ifindex);
                err = mlx5e_attach_encap(priv, &parse_attr->tun_info,
@@@ -885,7 -890,7 +885,7 @@@ err_add_rule
  err_mod_hdr:
        mlx5_eswitch_del_vlan_action(esw, attr);
  err_add_vlan:
 -      if (attr->action & MLX5_FLOW_CONTEXT_ACTION_ENCAP)
 +      if (attr->action & MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT)
                mlx5e_detach_encap(priv, flow);
  err_attach_encap:
        return rule;
@@@ -906,7 -911,7 +906,7 @@@ static void mlx5e_tc_del_fdb_flow(struc
  
        mlx5_eswitch_del_vlan_action(esw, attr);
  
 -      if (attr->action & MLX5_FLOW_CONTEXT_ACTION_ENCAP) {
 +      if (attr->action & MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT) {
                mlx5e_detach_encap(priv, flow);
                kvfree(attr->parse_attr);
        }
@@@ -923,10 -928,9 +923,10 @@@ void mlx5e_tc_encap_flows_add(struct ml
        struct mlx5e_tc_flow *flow;
        int err;
  
 -      err = mlx5_encap_alloc(priv->mdev, e->tunnel_type,
 -                             e->encap_size, e->encap_header,
 -                             &e->encap_id);
 +      err = mlx5_packet_reformat_alloc(priv->mdev, e->tunnel_type,
 +                                       e->encap_size, e->encap_header,
 +                                       MLX5_FLOW_NAMESPACE_FDB,
 +                                       &e->encap_id);
        if (err) {
                mlx5_core_warn(priv->mdev, "Failed to offload cached encapsulation header, %d\n",
                               err);
@@@ -980,7 -984,7 +980,7 @@@ void mlx5e_tc_encap_flows_del(struct ml
  
        if (e->flags & MLX5_ENCAP_ENTRY_VALID) {
                e->flags &= ~MLX5_ENCAP_ENTRY_VALID;
 -              mlx5_encap_dealloc(priv->mdev, e->encap_id);
 +              mlx5_packet_reformat_dealloc(priv->mdev, e->encap_id);
        }
  }
  
@@@ -1049,7 -1053,7 +1049,7 @@@ static void mlx5e_detach_encap(struct m
                mlx5e_rep_encap_entry_detach(netdev_priv(e->out_dev), e);
  
                if (e->flags & MLX5_ENCAP_ENTRY_VALID)
 -                      mlx5_encap_dealloc(priv->mdev, e->encap_id);
 +                      mlx5_packet_reformat_dealloc(priv->mdev, e->encap_id);
  
                hash_del_rcu(&e->encap_hlist);
                kfree(e->encap_header);
@@@ -1978,14 -1982,15 +1978,15 @@@ static bool modify_header_match_support
                goto out_ok;
  
        modify_ip_header = false;
-       tcf_exts_to_list(exts, &actions);
-       list_for_each_entry(a, &actions, list) {
+       tcf_exts_for_each_action(i, a, exts) {
+               int k;
                if (!is_tcf_pedit(a))
                        continue;
  
                nkeys = tcf_pedit_nkeys(a);
-               for (i = 0; i < nkeys; i++) {
-                       htype = tcf_pedit_htype(a, i);
+               for (k = 0; k < nkeys; k++) {
+                       htype = tcf_pedit_htype(a, k);
                        if (htype == TCA_PEDIT_KEY_EX_HDR_TYPE_IP4 ||
                            htype == TCA_PEDIT_KEY_EX_HDR_TYPE_IP6) {
                                modify_ip_header = true;
@@@ -2049,15 -2054,14 +2050,14 @@@ static int parse_tc_nic_actions(struct 
        const struct tc_action *a;
        LIST_HEAD(actions);
        u32 action = 0;
-       int err;
+       int err, i;
  
        if (!tcf_exts_has_actions(exts))
                return -EINVAL;
  
        attr->flow_tag = MLX5_FS_DEFAULT_FLOW_TAG;
  
-       tcf_exts_to_list(exts, &actions);
-       list_for_each_entry(a, &actions, list) {
+       tcf_exts_for_each_action(i, a, exts) {
                if (is_tcf_gact_shot(a)) {
                        action |= MLX5_FLOW_CONTEXT_ACTION_DROP;
                        if (MLX5_CAP_FLOWTABLE(priv->mdev,
@@@ -2324,7 -2328,7 +2324,7 @@@ static int mlx5e_create_encap_header_ip
                return -ENOMEM;
  
        switch (e->tunnel_type) {
 -      case MLX5_HEADER_TYPE_VXLAN:
 +      case MLX5_REFORMAT_TYPE_L2_TO_VXLAN:
                fl4.flowi4_proto = IPPROTO_UDP;
                fl4.fl4_dport = tun_key->tp_dst;
                break;
        read_unlock_bh(&n->lock);
  
        switch (e->tunnel_type) {
 -      case MLX5_HEADER_TYPE_VXLAN:
 +      case MLX5_REFORMAT_TYPE_L2_TO_VXLAN:
                gen_vxlan_header_ipv4(out_dev, encap_header,
                                      ipv4_encap_size, e->h_dest, tos, ttl,
                                      fl4.daddr,
                goto out;
        }
  
 -      err = mlx5_encap_alloc(priv->mdev, e->tunnel_type,
 -                             ipv4_encap_size, encap_header, &e->encap_id);
 +      err = mlx5_packet_reformat_alloc(priv->mdev, e->tunnel_type,
 +                                       ipv4_encap_size, encap_header,
 +                                       MLX5_FLOW_NAMESPACE_FDB,
 +                                       &e->encap_id);
        if (err)
                goto destroy_neigh_entry;
  
@@@ -2435,7 -2437,7 +2435,7 @@@ static int mlx5e_create_encap_header_ip
                return -ENOMEM;
  
        switch (e->tunnel_type) {
 -      case MLX5_HEADER_TYPE_VXLAN:
 +      case MLX5_REFORMAT_TYPE_L2_TO_VXLAN:
                fl6.flowi6_proto = IPPROTO_UDP;
                fl6.fl6_dport = tun_key->tp_dst;
                break;
        read_unlock_bh(&n->lock);
  
        switch (e->tunnel_type) {
 -      case MLX5_HEADER_TYPE_VXLAN:
 +      case MLX5_REFORMAT_TYPE_L2_TO_VXLAN:
                gen_vxlan_header_ipv6(out_dev, encap_header,
                                      ipv6_encap_size, e->h_dest, tos, ttl,
                                      &fl6.daddr,
                goto out;
        }
  
 -      err = mlx5_encap_alloc(priv->mdev, e->tunnel_type,
 -                             ipv6_encap_size, encap_header, &e->encap_id);
 +      err = mlx5_packet_reformat_alloc(priv->mdev, e->tunnel_type,
 +                                       ipv6_encap_size, encap_header,
 +                                       MLX5_FLOW_NAMESPACE_FDB,
 +                                       &e->encap_id);
        if (err)
                goto destroy_neigh_entry;
  
@@@ -2551,7 -2551,7 +2551,7 @@@ vxlan_encap_offload_err
  
        if (mlx5_vxlan_lookup_port(priv->mdev->vxlan, be16_to_cpu(key->tp_dst)) &&
            MLX5_CAP_ESW(priv->mdev, vxlan_encap_decap)) {
 -              tunnel_type = MLX5_HEADER_TYPE_VXLAN;
 +              tunnel_type = MLX5_REFORMAT_TYPE_L2_TO_VXLAN;
        } else {
                netdev_warn(priv->netdev,
                            "%d isn't an offloaded vxlan udp dport\n", be16_to_cpu(key->tp_dst));
@@@ -2666,7 -2666,7 +2666,7 @@@ static int parse_tc_fdb_actions(struct 
        LIST_HEAD(actions);
        bool encap = false;
        u32 action = 0;
-       int err;
+       int err, i;
  
        if (!tcf_exts_has_actions(exts))
                return -EINVAL;
        attr->in_rep = rpriv->rep;
        attr->in_mdev = priv->mdev;
  
-       tcf_exts_to_list(exts, &actions);
-       list_for_each_entry(a, &actions, list) {
+       tcf_exts_for_each_action(i, a, exts) {
                if (is_tcf_gact_shot(a)) {
                        action |= MLX5_FLOW_CONTEXT_ACTION_DROP |
                                  MLX5_FLOW_CONTEXT_ACTION_COUNT;
                                parse_attr->mirred_ifindex = out_dev->ifindex;
                                parse_attr->tun_info = *info;
                                attr->parse_attr = parse_attr;
 -                              action |= MLX5_FLOW_CONTEXT_ACTION_ENCAP |
 +                              action |= MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT |
                                          MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
                                          MLX5_FLOW_CONTEXT_ACTION_COUNT;
                                /* attr->out_rep is resolved when we handle encap */
@@@ -2872,8 -2871,7 +2871,8 @@@ int mlx5e_configure_flower(struct mlx5e
                flow->flags |= MLX5E_TC_FLOW_OFFLOADED;
  
        if (!(flow->flags & MLX5E_TC_FLOW_ESWITCH) ||
 -          !(flow->esw_attr->action & MLX5_FLOW_CONTEXT_ACTION_ENCAP))
 +          !(flow->esw_attr->action &
 +            MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT))
                kvfree(parse_attr);
  
        err = rhashtable_insert_fast(tc_ht, &flow->node, tc_ht_params);
diff --combined include/rdma/ib_verbs.h
index a4c3a09a91bc99a2c18499c643c73adf4fb78f86,cd0f935f0bc175009db1b045d747e87d81e03ace..ddc7c317e1364c1949d7ffdabc2550fa4855258e
@@@ -71,7 -71,6 +71,7 @@@
  
  extern struct workqueue_struct *ib_wq;
  extern struct workqueue_struct *ib_comp_wq;
 +extern struct workqueue_struct *ib_comp_unbound_wq;
  
  union ib_gid {
        u8      raw[16];
@@@ -1486,7 -1485,7 +1486,7 @@@ struct ib_ucontext 
         * it is set when we are closing the file descriptor and indicates
         * that mm_sem may be locked.
         */
 -      int                     closing;
 +      bool closing;
  
        bool cleanup_retryable;
  
@@@ -1571,10 -1570,9 +1571,10 @@@ struct ib_ah 
  typedef void (*ib_comp_handler)(struct ib_cq *cq, void *cq_context);
  
  enum ib_poll_context {
 -      IB_POLL_DIRECT,         /* caller context, no hw completions */
 -      IB_POLL_SOFTIRQ,        /* poll from softirq context */
 -      IB_POLL_WORKQUEUE,      /* poll from workqueue */
 +      IB_POLL_DIRECT,            /* caller context, no hw completions */
 +      IB_POLL_SOFTIRQ,           /* poll from softirq context */
 +      IB_POLL_WORKQUEUE,         /* poll from workqueue */
 +      IB_POLL_UNBOUND_WORKQUEUE, /* poll from unbound workqueue */
  };
  
  struct ib_cq {
                struct irq_poll         iop;
                struct work_struct      work;
        };
 +      struct workqueue_struct *comp_wq;
        /*
         * Implementation details of the RDMA core, don't use in drivers:
         */
@@@ -2539,6 -2536,9 +2539,9 @@@ struct ib_device 
  
        struct module               *owner;
        struct device                dev;
+       /* First group for device attributes, NULL terminated array */
+       const struct attribute_group    *groups[2];
        struct kobject               *ports_parent;
        struct list_head             port_list;
  
This page took 0.099464 seconds and 4 git commands to generate.