RDMA/qedr: notify user application if DPM is supported
authorAmrani, Ram <Ram.Amrani@cavium.com>
Mon, 26 Jun 2017 16:05:05 +0000 (19:05 +0300)
committerDoug Ledford <dledford@redhat.com>
Thu, 27 Jul 2017 12:59:52 +0000 (08:59 -0400)
Direct Packet Mode support may be disabled, e.g, due to limited
resources. Notifying the user application prevents wasting cycles
on attempting to send these kind of packets.

Signed-off-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/qedr/main.c
drivers/infiniband/hw/qedr/qedr.h
drivers/infiniband/hw/qedr/verbs.c
include/uapi/rdma/qedr-abi.h

index 0ae30f5c8cbc8b666e3f9640da066a503ab930de..199b6edbef92c15a4539e02a98299ff7d5920d16 100644 (file)
@@ -777,6 +777,7 @@ static struct qedr_dev *qedr_add(struct qed_dev *cdev, struct pci_dev *pdev,
        if (rc)
                goto init_err;
 
+       dev->user_dpm_enabled = dev_info.user_dpm_enabled;
        dev->num_hwfns = dev_info.common.num_hwfns;
        dev->rdma_ctx = dev->ops->rdma_get_rdma_ctx(cdev);
 
index 392e76e268406b36000e0e5f165e6a81938d1e74..b2bb42e2805ddfb220b7033620d988e0877f3d6a 100644 (file)
@@ -162,6 +162,8 @@ struct qedr_dev {
        struct qedr_qp          *gsi_qp;
 
        unsigned long enet_state;
+
+       u8 user_dpm_enabled;
 };
 
 #define QEDR_MAX_SQ_PBL                        (0x8000)
index 2ae71b8f1ba8a49f1c2aae0e6c59908ed4063093..4322ee00498efc9b73af8f8a1db8d2856afc512e 100644 (file)
@@ -376,6 +376,7 @@ struct ib_ucontext *qedr_alloc_ucontext(struct ib_device *ibdev,
 
        memset(&uresp, 0, sizeof(uresp));
 
+       uresp.dpm_enabled = dev->user_dpm_enabled;
        uresp.db_pa = ctx->dpi_phys_addr;
        uresp.db_size = ctx->dpi_size;
        uresp.max_send_wr = dev->attr.max_sqe;
index 75c270d839c8d5097757baf8644a0426db4fb16f..2684004ec4fd5ae2b413b0bfdba31994131b00bd 100644 (file)
@@ -49,6 +49,7 @@ struct qedr_alloc_ucontext_resp {
        __u32 sges_per_recv_wr;
        __u32 sges_per_srq_wr;
        __u32 max_cqes;
+       __u8 dpm_enabled;
 };
 
 struct qedr_alloc_pd_ureq {