RDMA/ocrdma: Use MCC_CREATE_EXT_V1 for MCC create
authorNaresh Gottumukkala <bgottumukkala@emulex.com>
Mon, 10 Jun 2013 04:42:38 +0000 (04:42 +0000)
committerRoland Dreier <roland@purestorage.com>
Thu, 20 Jun 2013 11:52:14 +0000 (04:52 -0700)
Use MCC_CREATE_EXT_V1 to create MCC_queue to receive RoCE events.

Signed-off-by: Naresh Gottumukkala <bgottumukkala@emulex.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/ocrdma/ocrdma_hw.c
drivers/infiniband/hw/ocrdma/ocrdma_sli.h

index 910b706a91c7aae30a6f0560006cc0084f0a23e2..f671d5d9ce3ab16dd38bbe12ed20da01ee12547f 100644 (file)
@@ -563,32 +563,19 @@ static int ocrdma_mbx_create_mq(struct ocrdma_dev *dev,
        memset(cmd, 0, sizeof(*cmd));
        num_pages = PAGES_4K_SPANNED(mq->va, mq->size);
 
-       if (dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) {
-               ocrdma_init_mch(&cmd->req, OCRDMA_CMD_CREATE_MQ,
-                               OCRDMA_SUBSYS_COMMON, sizeof(*cmd));
-               cmd->v0.pages = num_pages;
-               cmd->v0.async_cqid_valid = OCRDMA_CREATE_MQ_ASYNC_CQ_VALID;
-               cmd->v0.async_cqid_valid = (cq->id << 1);
-               cmd->v0.cqid_ringsize |= (ocrdma_encoded_q_len(mq->len) <<
-                                            OCRDMA_CREATE_MQ_RING_SIZE_SHIFT);
-               cmd->v0.cqid_ringsize |=
-                       (cq->id << OCRDMA_CREATE_MQ_V0_CQ_ID_SHIFT);
-               cmd->v0.valid = OCRDMA_CREATE_MQ_VALID;
-               pa = &cmd->v0.pa[0];
-       } else {
-               ocrdma_init_mch(&cmd->req, OCRDMA_CMD_CREATE_MQ_EXT,
-                               OCRDMA_SUBSYS_COMMON, sizeof(*cmd));
-               cmd->req.rsvd_version = 1;
-               cmd->v1.cqid_pages = num_pages;
-               cmd->v1.cqid_pages |= (cq->id << OCRDMA_CREATE_MQ_CQ_ID_SHIFT);
-               cmd->v1.async_cqid_valid = OCRDMA_CREATE_MQ_ASYNC_CQ_VALID;
-               cmd->v1.async_event_bitmap = Bit(20);
-               cmd->v1.async_cqid_ringsize = cq->id;
-               cmd->v1.async_cqid_ringsize |= (ocrdma_encoded_q_len(mq->len) <<
-                                            OCRDMA_CREATE_MQ_RING_SIZE_SHIFT);
-               cmd->v1.valid = OCRDMA_CREATE_MQ_VALID;
-               pa = &cmd->v1.pa[0];
-       }
+       ocrdma_init_mch(&cmd->req, OCRDMA_CMD_CREATE_MQ_EXT,
+                       OCRDMA_SUBSYS_COMMON, sizeof(*cmd));
+       cmd->req.rsvd_version = 1;
+       cmd->cqid_pages = num_pages;
+       cmd->cqid_pages |= (cq->id << OCRDMA_CREATE_MQ_CQ_ID_SHIFT);
+       cmd->async_cqid_valid = OCRDMA_CREATE_MQ_ASYNC_CQ_VALID;
+       cmd->async_event_bitmap = Bit(20);
+       cmd->async_cqid_ringsize = cq->id;
+       cmd->async_cqid_ringsize |= (ocrdma_encoded_q_len(mq->len) <<
+                               OCRDMA_CREATE_MQ_RING_SIZE_SHIFT);
+       cmd->valid = OCRDMA_CREATE_MQ_VALID;
+       pa = &cmd->pa[0];
+
        ocrdma_build_q_pages(pa, num_pages, mq->dma, PAGE_SIZE_4K);
        status = be_roce_mcc_cmd(dev->nic_info.netdev,
                                 cmd, sizeof(*cmd), NULL, NULL);
index c75cbdfa87e7b82a3e3d6cd5d1e7be78b4dd1f19..cd0512f1fb5b5c3b65910c2ddf1694d5f18298e6 100644 (file)
@@ -608,16 +608,8 @@ enum {
        OCRDMA_CREATE_MQ_ASYNC_CQ_VALID         = Bit(0)
 };
 
-struct ocrdma_create_mq_v0 {
-       u32 pages;
-       u32 cqid_ringsize;
-       u32 valid;
-       u32 async_cqid_valid;
-       u32 rsvd;
-       struct ocrdma_pa pa[8];
-} __packed;
-
-struct ocrdma_create_mq_v1 {
+struct ocrdma_create_mq_req {
+       struct ocrdma_mbx_hdr req;
        u32 cqid_pages;
        u32 async_event_bitmap;
        u32 async_cqid_ringsize;
@@ -627,14 +619,6 @@ struct ocrdma_create_mq_v1 {
        struct ocrdma_pa pa[8];
 } __packed;
 
-struct ocrdma_create_mq_req {
-       struct ocrdma_mbx_hdr req;
-       union {
-               struct ocrdma_create_mq_v0 v0;
-               struct ocrdma_create_mq_v1 v1;
-       };
-} __packed;
-
 struct ocrdma_create_mq_rsp {
        struct ocrdma_mbx_rsp rsp;
        u32 id;