diff options
author | Naresh Gottumukkala <bgottumukkala@emulex.com> | 2013-06-10 00:42:38 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-06-20 07:52:14 -0400 |
commit | b1d58b99194a121a44ec77571f84f62a6ccd6431 (patch) | |
tree | 271d653114e3519556a5f286803b0be681280fdd /drivers/infiniband/hw | |
parent | 27159f5087f9ff59fdc42958a31bca3a291b9f67 (diff) |
RDMA/ocrdma: Use MCC_CREATE_EXT_V1 for MCC create
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>
Diffstat (limited to 'drivers/infiniband/hw')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 39 | ||||
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_sli.h | 20 |
2 files changed, 15 insertions, 44 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index 910b706a91c7..f671d5d9ce3a 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c | |||
@@ -563,32 +563,19 @@ static int ocrdma_mbx_create_mq(struct ocrdma_dev *dev, | |||
563 | memset(cmd, 0, sizeof(*cmd)); | 563 | memset(cmd, 0, sizeof(*cmd)); |
564 | num_pages = PAGES_4K_SPANNED(mq->va, mq->size); | 564 | num_pages = PAGES_4K_SPANNED(mq->va, mq->size); |
565 | 565 | ||
566 | if (dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) { | 566 | ocrdma_init_mch(&cmd->req, OCRDMA_CMD_CREATE_MQ_EXT, |
567 | ocrdma_init_mch(&cmd->req, OCRDMA_CMD_CREATE_MQ, | 567 | OCRDMA_SUBSYS_COMMON, sizeof(*cmd)); |
568 | OCRDMA_SUBSYS_COMMON, sizeof(*cmd)); | 568 | cmd->req.rsvd_version = 1; |
569 | cmd->v0.pages = num_pages; | 569 | cmd->cqid_pages = num_pages; |
570 | cmd->v0.async_cqid_valid = OCRDMA_CREATE_MQ_ASYNC_CQ_VALID; | 570 | cmd->cqid_pages |= (cq->id << OCRDMA_CREATE_MQ_CQ_ID_SHIFT); |
571 | cmd->v0.async_cqid_valid = (cq->id << 1); | 571 | cmd->async_cqid_valid = OCRDMA_CREATE_MQ_ASYNC_CQ_VALID; |
572 | cmd->v0.cqid_ringsize |= (ocrdma_encoded_q_len(mq->len) << | 572 | cmd->async_event_bitmap = Bit(20); |
573 | OCRDMA_CREATE_MQ_RING_SIZE_SHIFT); | 573 | cmd->async_cqid_ringsize = cq->id; |
574 | cmd->v0.cqid_ringsize |= | 574 | cmd->async_cqid_ringsize |= (ocrdma_encoded_q_len(mq->len) << |
575 | (cq->id << OCRDMA_CREATE_MQ_V0_CQ_ID_SHIFT); | 575 | OCRDMA_CREATE_MQ_RING_SIZE_SHIFT); |
576 | cmd->v0.valid = OCRDMA_CREATE_MQ_VALID; | 576 | cmd->valid = OCRDMA_CREATE_MQ_VALID; |
577 | pa = &cmd->v0.pa[0]; | 577 | pa = &cmd->pa[0]; |
578 | } else { | 578 | |
579 | ocrdma_init_mch(&cmd->req, OCRDMA_CMD_CREATE_MQ_EXT, | ||
580 | OCRDMA_SUBSYS_COMMON, sizeof(*cmd)); | ||
581 | cmd->req.rsvd_version = 1; | ||
582 | cmd->v1.cqid_pages = num_pages; | ||
583 | cmd->v1.cqid_pages |= (cq->id << OCRDMA_CREATE_MQ_CQ_ID_SHIFT); | ||
584 | cmd->v1.async_cqid_valid = OCRDMA_CREATE_MQ_ASYNC_CQ_VALID; | ||
585 | cmd->v1.async_event_bitmap = Bit(20); | ||
586 | cmd->v1.async_cqid_ringsize = cq->id; | ||
587 | cmd->v1.async_cqid_ringsize |= (ocrdma_encoded_q_len(mq->len) << | ||
588 | OCRDMA_CREATE_MQ_RING_SIZE_SHIFT); | ||
589 | cmd->v1.valid = OCRDMA_CREATE_MQ_VALID; | ||
590 | pa = &cmd->v1.pa[0]; | ||
591 | } | ||
592 | ocrdma_build_q_pages(pa, num_pages, mq->dma, PAGE_SIZE_4K); | 579 | ocrdma_build_q_pages(pa, num_pages, mq->dma, PAGE_SIZE_4K); |
593 | status = be_roce_mcc_cmd(dev->nic_info.netdev, | 580 | status = be_roce_mcc_cmd(dev->nic_info.netdev, |
594 | cmd, sizeof(*cmd), NULL, NULL); | 581 | cmd, sizeof(*cmd), NULL, NULL); |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h index c75cbdfa87e7..cd0512f1fb5b 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h +++ b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h | |||
@@ -608,16 +608,8 @@ enum { | |||
608 | OCRDMA_CREATE_MQ_ASYNC_CQ_VALID = Bit(0) | 608 | OCRDMA_CREATE_MQ_ASYNC_CQ_VALID = Bit(0) |
609 | }; | 609 | }; |
610 | 610 | ||
611 | struct ocrdma_create_mq_v0 { | 611 | struct ocrdma_create_mq_req { |
612 | u32 pages; | 612 | struct ocrdma_mbx_hdr req; |
613 | u32 cqid_ringsize; | ||
614 | u32 valid; | ||
615 | u32 async_cqid_valid; | ||
616 | u32 rsvd; | ||
617 | struct ocrdma_pa pa[8]; | ||
618 | } __packed; | ||
619 | |||
620 | struct ocrdma_create_mq_v1 { | ||
621 | u32 cqid_pages; | 613 | u32 cqid_pages; |
622 | u32 async_event_bitmap; | 614 | u32 async_event_bitmap; |
623 | u32 async_cqid_ringsize; | 615 | u32 async_cqid_ringsize; |
@@ -627,14 +619,6 @@ struct ocrdma_create_mq_v1 { | |||
627 | struct ocrdma_pa pa[8]; | 619 | struct ocrdma_pa pa[8]; |
628 | } __packed; | 620 | } __packed; |
629 | 621 | ||
630 | struct ocrdma_create_mq_req { | ||
631 | struct ocrdma_mbx_hdr req; | ||
632 | union { | ||
633 | struct ocrdma_create_mq_v0 v0; | ||
634 | struct ocrdma_create_mq_v1 v1; | ||
635 | }; | ||
636 | } __packed; | ||
637 | |||
638 | struct ocrdma_create_mq_rsp { | 622 | struct ocrdma_create_mq_rsp { |
639 | struct ocrdma_mbx_rsp rsp; | 623 | struct ocrdma_mbx_rsp rsp; |
640 | u32 id; | 624 | u32 id; |