Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/mthca: Add device-specific support for resizing CQs

Add low-level driver support for resizing CQs (both kernel and
userspace) to mthca.

Signed-off-by: Roland Dreier <rolandd@cisco.com>

+308 -52
+32 -1
drivers/infiniband/hw/mthca/mthca_cmd.c
··· 1 1 /* 2 2 * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. 3 3 * Copyright (c) 2005 Mellanox Technologies. All rights reserved. 4 - * Copyright (c) 2005 Cisco Systems. All rights reserved. 4 + * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. 5 5 * 6 6 * This software is available to you under a choice of one of two 7 7 * licenses. You may choose to be licensed under the terms of the GNU ··· 1512 1512 return mthca_cmd_box(dev, 0, mailbox->dma, cq_num, 0, 1513 1513 CMD_HW2SW_CQ, 1514 1514 CMD_TIME_CLASS_A, status); 1515 + } 1516 + 1517 + int mthca_RESIZE_CQ(struct mthca_dev *dev, int cq_num, u32 lkey, u8 log_size, 1518 + u8 *status) 1519 + { 1520 + struct mthca_mailbox *mailbox; 1521 + __be32 *inbox; 1522 + int err; 1523 + 1524 + #define RESIZE_CQ_IN_SIZE 0x40 1525 + #define RESIZE_CQ_LOG_SIZE_OFFSET 0x0c 1526 + #define RESIZE_CQ_LKEY_OFFSET 0x1c 1527 + 1528 + mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); 1529 + if (IS_ERR(mailbox)) 1530 + return PTR_ERR(mailbox); 1531 + inbox = mailbox->buf; 1532 + 1533 + memset(inbox, 0, RESIZE_CQ_IN_SIZE); 1534 + /* 1535 + * Leave start address fields zeroed out -- mthca assumes that 1536 + * MRs for CQs always start at virtual address 0. 1537 + */ 1538 + MTHCA_PUT(inbox, log_size, RESIZE_CQ_LOG_SIZE_OFFSET); 1539 + MTHCA_PUT(inbox, lkey, RESIZE_CQ_LKEY_OFFSET); 1540 + 1541 + err = mthca_cmd(dev, mailbox->dma, cq_num, 1, CMD_RESIZE_CQ, 1542 + CMD_TIME_CLASS_B, status); 1543 + 1544 + mthca_free_mailbox(dev, mailbox); 1545 + return err; 1515 1546 } 1516 1547 1517 1548 int mthca_SW2HW_SRQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
+3
drivers/infiniband/hw/mthca/mthca_cmd.h
··· 1 1 /* 2 2 * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. 3 3 * Copyright (c) 2005 Mellanox Technologies. All rights reserved. 4 + * Copyright (c) 2006 Cisco Systems. All rights reserved. 4 5 * 5 6 * This software is available to you under a choice of one of two 6 7 * licenses. You may choose to be licensed under the terms of the GNU ··· 299 298 int cq_num, u8 *status); 300 299 int mthca_HW2SW_CQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, 301 300 int cq_num, u8 *status); 301 + int mthca_RESIZE_CQ(struct mthca_dev *dev, int cq_num, u32 lkey, u8 log_size, 302 + u8 *status); 302 303 int mthca_SW2HW_SRQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, 303 304 int srq_num, u8 *status); 304 305 int mthca_HW2SW_SRQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
+105 -27
drivers/infiniband/hw/mthca/mthca_cq.c
··· 1 1 /* 2 2 * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. 3 3 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. 4 - * Copyright (c) 2005 Cisco Systems, Inc. All rights reserved. 4 + * Copyright (c) 2005, 2006 Cisco Systems, Inc. All rights reserved. 5 5 * Copyright (c) 2005 Mellanox Technologies. All rights reserved. 6 6 * Copyright (c) 2004 Voltaire, Inc. All rights reserved. 7 7 * ··· 150 150 #define MTHCA_ARBEL_CQ_DB_REQ_NOT (2 << 24) 151 151 #define MTHCA_ARBEL_CQ_DB_REQ_NOT_MULT (3 << 24) 152 152 153 - static inline struct mthca_cqe *get_cqe(struct mthca_cq *cq, int entry) 153 + static inline struct mthca_cqe *get_cqe_from_buf(struct mthca_cq_buf *buf, 154 + int entry) 154 155 { 155 - if (cq->is_direct) 156 - return cq->queue.direct.buf + (entry * MTHCA_CQ_ENTRY_SIZE); 156 + if (buf->is_direct) 157 + return buf->queue.direct.buf + (entry * MTHCA_CQ_ENTRY_SIZE); 157 158 else 158 - return cq->queue.page_list[entry * MTHCA_CQ_ENTRY_SIZE / PAGE_SIZE].buf 159 + return buf->queue.page_list[entry * MTHCA_CQ_ENTRY_SIZE / PAGE_SIZE].buf 159 160 + (entry * MTHCA_CQ_ENTRY_SIZE) % PAGE_SIZE; 160 161 } 161 162 162 - static inline struct mthca_cqe *cqe_sw(struct mthca_cq *cq, int i) 163 + static inline struct mthca_cqe *get_cqe(struct mthca_cq *cq, int entry) 163 164 { 164 - struct mthca_cqe *cqe = get_cqe(cq, i); 165 + return get_cqe_from_buf(&cq->buf, entry); 166 + } 167 + 168 + static inline struct mthca_cqe *cqe_sw(struct mthca_cqe *cqe) 169 + { 165 170 return MTHCA_CQ_ENTRY_OWNER_HW & cqe->owner ? NULL : cqe; 166 171 } 167 172 168 173 static inline struct mthca_cqe *next_cqe_sw(struct mthca_cq *cq) 169 174 { 170 - return cqe_sw(cq, cq->cons_index & cq->ibcq.cqe); 175 + return cqe_sw(get_cqe(cq, cq->cons_index & cq->ibcq.cqe)); 171 176 } 172 177 173 178 static inline void set_cqe_hw(struct mthca_cqe *cqe) ··· 294 289 * from our QP and therefore don't need to be checked. 295 290 */ 296 291 for (prod_index = cq->cons_index; 297 - cqe_sw(cq, prod_index & cq->ibcq.cqe); 292 + cqe_sw(get_cqe(cq, prod_index & cq->ibcq.cqe)); 298 293 ++prod_index) 299 294 if (prod_index == cq->cons_index + cq->ibcq.cqe) 300 295 break; ··· 327 322 spin_unlock_irq(&cq->lock); 328 323 if (atomic_dec_and_test(&cq->refcount)) 329 324 wake_up(&cq->wait); 325 + } 326 + 327 + void mthca_cq_resize_copy_cqes(struct mthca_cq *cq) 328 + { 329 + int i; 330 + 331 + /* 332 + * In Tavor mode, the hardware keeps the consumer and producer 333 + * indices mod the CQ size. Since we might be making the CQ 334 + * bigger, we need to deal with the case where the producer 335 + * index wrapped around before the CQ was resized. 336 + */ 337 + if (!mthca_is_memfree(to_mdev(cq->ibcq.device)) && 338 + cq->ibcq.cqe < cq->resize_buf->cqe) { 339 + cq->cons_index &= cq->ibcq.cqe; 340 + if (cqe_sw(get_cqe(cq, cq->ibcq.cqe))) 341 + cq->cons_index -= cq->ibcq.cqe + 1; 342 + } 343 + 344 + for (i = cq->cons_index; cqe_sw(get_cqe(cq, i & cq->ibcq.cqe)); ++i) 345 + memcpy(get_cqe_from_buf(&cq->resize_buf->buf, 346 + i & cq->resize_buf->cqe), 347 + get_cqe(cq, i & cq->ibcq.cqe), MTHCA_CQ_ENTRY_SIZE); 348 + } 349 + 350 + int mthca_alloc_cq_buf(struct mthca_dev *dev, struct mthca_cq_buf *buf, int nent) 351 + { 352 + int ret; 353 + int i; 354 + 355 + ret = mthca_buf_alloc(dev, nent * MTHCA_CQ_ENTRY_SIZE, 356 + MTHCA_MAX_DIRECT_CQ_SIZE, 357 + &buf->queue, &buf->is_direct, 358 + &dev->driver_pd, 1, &buf->mr); 359 + if (ret) 360 + return ret; 361 + 362 + for (i = 0; i < nent; ++i) 363 + set_cqe_hw(get_cqe_from_buf(buf, i)); 364 + 365 + return 0; 366 + } 367 + 368 + void mthca_free_cq_buf(struct mthca_dev *dev, struct mthca_cq_buf *buf, int cqe) 369 + { 370 + mthca_buf_free(dev, (cqe + 1) * MTHCA_CQ_ENTRY_SIZE, &buf->queue, 371 + buf->is_direct, &buf->mr); 330 372 } 331 373 332 374 static void handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq, ··· 661 609 662 610 spin_lock_irqsave(&cq->lock, flags); 663 611 664 - for (npolled = 0; npolled < num_entries; ++npolled) { 612 + npolled = 0; 613 + repoll: 614 + while (npolled < num_entries) { 665 615 err = mthca_poll_one(dev, cq, &qp, 666 616 &freed, entry + npolled); 667 617 if (err) 668 618 break; 619 + ++npolled; 669 620 } 670 621 671 622 if (freed) { 672 623 wmb(); 673 624 update_cons_index(dev, cq, freed); 625 + } 626 + 627 + /* 628 + * If a CQ resize is in progress and we discovered that the 629 + * old buffer is empty, then peek in the new buffer, and if 630 + * it's not empty, switch to the new buffer and continue 631 + * polling there. 632 + */ 633 + if (unlikely(err == -EAGAIN && cq->resize_buf && 634 + cq->resize_buf->state == CQ_RESIZE_READY)) { 635 + /* 636 + * In Tavor mode, the hardware keeps the producer 637 + * index modulo the CQ size. Since we might be making 638 + * the CQ bigger, we need to mask our consumer index 639 + * using the size of the old CQ buffer before looking 640 + * in the new CQ buffer. 641 + */ 642 + if (!mthca_is_memfree(dev)) 643 + cq->cons_index &= cq->ibcq.cqe; 644 + 645 + if (cqe_sw(get_cqe_from_buf(&cq->resize_buf->buf, 646 + cq->cons_index & cq->resize_buf->cqe))) { 647 + struct mthca_cq_buf tbuf; 648 + int tcqe; 649 + 650 + tbuf = cq->buf; 651 + tcqe = cq->ibcq.cqe; 652 + cq->buf = cq->resize_buf->buf; 653 + cq->ibcq.cqe = cq->resize_buf->cqe; 654 + 655 + cq->resize_buf->buf = tbuf; 656 + cq->resize_buf->cqe = tcqe; 657 + cq->resize_buf->state = CQ_RESIZE_SWAPPED; 658 + 659 + goto repoll; 660 + } 674 661 } 675 662 676 663 spin_unlock_irqrestore(&cq->lock, flags); ··· 770 679 return 0; 771 680 } 772 681 773 - static void mthca_free_cq_buf(struct mthca_dev *dev, struct mthca_cq *cq) 774 - { 775 - mthca_buf_free(dev, (cq->ibcq.cqe + 1) * MTHCA_CQ_ENTRY_SIZE, 776 - &cq->queue, cq->is_direct, &cq->mr); 777 - } 778 - 779 682 int mthca_init_cq(struct mthca_dev *dev, int nent, 780 683 struct mthca_ucontext *ctx, u32 pdn, 781 684 struct mthca_cq *cq) 782 685 { 783 - int size = nent * MTHCA_CQ_ENTRY_SIZE; 784 686 struct mthca_mailbox *mailbox; 785 687 struct mthca_cq_context *cq_context; 786 688 int err = -ENOMEM; 787 689 u8 status; 788 - int i; 789 690 790 691 cq->ibcq.cqe = nent - 1; 791 692 cq->is_kernel = !ctx; ··· 815 732 cq_context = mailbox->buf; 816 733 817 734 if (cq->is_kernel) { 818 - err = mthca_buf_alloc(dev, size, MTHCA_MAX_DIRECT_CQ_SIZE, 819 - &cq->queue, &cq->is_direct, 820 - &dev->driver_pd, 1, &cq->mr); 735 + err = mthca_alloc_cq_buf(dev, &cq->buf, nent); 821 736 if (err) 822 737 goto err_out_mailbox; 823 - 824 - for (i = 0; i < nent; ++i) 825 - set_cqe_hw(get_cqe(cq, i)); 826 738 } 827 739 828 740 spin_lock_init(&cq->lock); ··· 836 758 cq_context->error_eqn = cpu_to_be32(dev->eq_table.eq[MTHCA_EQ_ASYNC].eqn); 837 759 cq_context->comp_eqn = cpu_to_be32(dev->eq_table.eq[MTHCA_EQ_COMP].eqn); 838 760 cq_context->pd = cpu_to_be32(pdn); 839 - cq_context->lkey = cpu_to_be32(cq->mr.ibmr.lkey); 761 + cq_context->lkey = cpu_to_be32(cq->buf.mr.ibmr.lkey); 840 762 cq_context->cqn = cpu_to_be32(cq->cqn); 841 763 842 764 if (mthca_is_memfree(dev)) { ··· 874 796 875 797 err_out_free_mr: 876 798 if (cq->is_kernel) 877 - mthca_free_cq_buf(dev, cq); 799 + mthca_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); 878 800 879 801 err_out_mailbox: 880 802 mthca_free_mailbox(dev, mailbox); ··· 940 862 wait_event(cq->wait, !atomic_read(&cq->refcount)); 941 863 942 864 if (cq->is_kernel) { 943 - mthca_free_cq_buf(dev, cq); 865 + mthca_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); 944 866 if (mthca_is_memfree(dev)) { 945 867 mthca_free_db(dev, MTHCA_DB_TYPE_CQ_ARM, cq->arm_db_index); 946 868 mthca_free_db(dev, MTHCA_DB_TYPE_CQ_SET_CI, cq->set_ci_db_index);
+4 -1
drivers/infiniband/hw/mthca/mthca_dev.h
··· 1 1 /* 2 2 * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. 3 3 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. 4 - * Copyright (c) 2005 Cisco Systems. All rights reserved. 4 + * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. 5 5 * Copyright (c) 2005 Mellanox Technologies. All rights reserved. 6 6 * Copyright (c) 2004 Voltaire, Inc. All rights reserved. 7 7 * ··· 470 470 enum ib_event_type event_type); 471 471 void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn, 472 472 struct mthca_srq *srq); 473 + void mthca_cq_resize_copy_cqes(struct mthca_cq *cq); 474 + int mthca_alloc_cq_buf(struct mthca_dev *dev, struct mthca_cq_buf *buf, int nent); 475 + void mthca_free_cq_buf(struct mthca_dev *dev, struct mthca_cq_buf *buf, int cqe); 473 476 474 477 int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd, 475 478 struct ib_srq_attr *attr, struct mthca_srq *srq);
+123 -4
drivers/infiniband/hw/mthca/mthca_provider.c
··· 1 1 /* 2 2 * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. 3 3 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. 4 - * Copyright (c) 2005 Cisco Systems. All rights reserved. 4 + * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. 5 5 * Copyright (c) 2005 Mellanox Technologies. All rights reserved. 6 6 * Copyright (c) 2004 Voltaire, Inc. All rights reserved. 7 7 * ··· 669 669 } 670 670 671 671 if (context) { 672 - cq->mr.ibmr.lkey = ucmd.lkey; 673 - cq->set_ci_db_index = ucmd.set_db_index; 674 - cq->arm_db_index = ucmd.arm_db_index; 672 + cq->buf.mr.ibmr.lkey = ucmd.lkey; 673 + cq->set_ci_db_index = ucmd.set_db_index; 674 + cq->arm_db_index = ucmd.arm_db_index; 675 675 } 676 676 677 677 for (nent = 1; nent <= entries; nent <<= 1) ··· 689 689 goto err_free; 690 690 } 691 691 692 + cq->resize_buf = NULL; 693 + 692 694 return &cq->ibcq; 693 695 694 696 err_free: ··· 707 705 to_mucontext(context)->db_tab, ucmd.set_db_index); 708 706 709 707 return ERR_PTR(err); 708 + } 709 + 710 + static int mthca_alloc_resize_buf(struct mthca_dev *dev, struct mthca_cq *cq, 711 + int entries) 712 + { 713 + int ret; 714 + 715 + spin_lock_irq(&cq->lock); 716 + if (cq->resize_buf) { 717 + ret = -EBUSY; 718 + goto unlock; 719 + } 720 + 721 + cq->resize_buf = kmalloc(sizeof *cq->resize_buf, GFP_ATOMIC); 722 + if (!cq->resize_buf) { 723 + ret = -ENOMEM; 724 + goto unlock; 725 + } 726 + 727 + cq->resize_buf->state = CQ_RESIZE_ALLOC; 728 + 729 + ret = 0; 730 + 731 + unlock: 732 + spin_unlock_irq(&cq->lock); 733 + 734 + if (ret) 735 + return ret; 736 + 737 + ret = mthca_alloc_cq_buf(dev, &cq->resize_buf->buf, entries); 738 + if (ret) { 739 + spin_lock_irq(&cq->lock); 740 + kfree(cq->resize_buf); 741 + cq->resize_buf = NULL; 742 + spin_unlock_irq(&cq->lock); 743 + return ret; 744 + } 745 + 746 + cq->resize_buf->cqe = entries - 1; 747 + 748 + spin_lock_irq(&cq->lock); 749 + cq->resize_buf->state = CQ_RESIZE_READY; 750 + spin_unlock_irq(&cq->lock); 751 + 752 + return 0; 753 + } 754 + 755 + static int mthca_resize_cq(struct ib_cq *ibcq, int entries, struct ib_udata *udata) 756 + { 757 + struct mthca_dev *dev = to_mdev(ibcq->device); 758 + struct mthca_cq *cq = to_mcq(ibcq); 759 + struct mthca_resize_cq ucmd; 760 + u32 lkey; 761 + u8 status; 762 + int ret; 763 + 764 + if (entries < 1 || entries > dev->limits.max_cqes) 765 + return -EINVAL; 766 + 767 + entries = roundup_pow_of_two(entries + 1); 768 + if (entries == ibcq->cqe + 1) 769 + return 0; 770 + 771 + if (cq->is_kernel) { 772 + ret = mthca_alloc_resize_buf(dev, cq, entries); 773 + if (ret) 774 + return ret; 775 + lkey = cq->resize_buf->buf.mr.ibmr.lkey; 776 + } else { 777 + if (ib_copy_from_udata(&ucmd, udata, sizeof ucmd)) 778 + return -EFAULT; 779 + lkey = ucmd.lkey; 780 + } 781 + 782 + ret = mthca_RESIZE_CQ(dev, cq->cqn, lkey, long_log2(entries), &status); 783 + if (status) 784 + ret = -EINVAL; 785 + 786 + if (ret) { 787 + if (cq->resize_buf) { 788 + mthca_free_cq_buf(dev, &cq->resize_buf->buf, 789 + cq->resize_buf->cqe); 790 + kfree(cq->resize_buf); 791 + spin_lock_irq(&cq->lock); 792 + cq->resize_buf = NULL; 793 + spin_unlock_irq(&cq->lock); 794 + } 795 + return ret; 796 + } 797 + 798 + if (cq->is_kernel) { 799 + struct mthca_cq_buf tbuf; 800 + int tcqe; 801 + 802 + spin_lock_irq(&cq->lock); 803 + if (cq->resize_buf->state == CQ_RESIZE_READY) { 804 + mthca_cq_resize_copy_cqes(cq); 805 + tbuf = cq->buf; 806 + tcqe = cq->ibcq.cqe; 807 + cq->buf = cq->resize_buf->buf; 808 + cq->ibcq.cqe = cq->resize_buf->cqe; 809 + } else { 810 + tbuf = cq->resize_buf->buf; 811 + tcqe = cq->resize_buf->cqe; 812 + } 813 + 814 + kfree(cq->resize_buf); 815 + cq->resize_buf = NULL; 816 + spin_unlock_irq(&cq->lock); 817 + 818 + mthca_free_cq_buf(dev, &tbuf, tcqe); 819 + } else 820 + ibcq->cqe = entries - 1; 821 + 822 + return 0; 710 823 } 711 824 712 825 static int mthca_destroy_cq(struct ib_cq *cq) ··· 1230 1113 (1ull << IB_USER_VERBS_CMD_DEREG_MR) | 1231 1114 (1ull << IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL) | 1232 1115 (1ull << IB_USER_VERBS_CMD_CREATE_CQ) | 1116 + (1ull << IB_USER_VERBS_CMD_RESIZE_CQ) | 1233 1117 (1ull << IB_USER_VERBS_CMD_DESTROY_CQ) | 1234 1118 (1ull << IB_USER_VERBS_CMD_CREATE_QP) | 1235 1119 (1ull << IB_USER_VERBS_CMD_MODIFY_QP) | ··· 1272 1154 dev->ib_dev.modify_qp = mthca_modify_qp; 1273 1155 dev->ib_dev.destroy_qp = mthca_destroy_qp; 1274 1156 dev->ib_dev.create_cq = mthca_create_cq; 1157 + dev->ib_dev.resize_cq = mthca_resize_cq; 1275 1158 dev->ib_dev.destroy_cq = mthca_destroy_cq; 1276 1159 dev->ib_dev.poll_cq = mthca_poll_cq; 1277 1160 dev->ib_dev.get_dma_mr = mthca_get_dma_mr;
+35 -18
drivers/infiniband/hw/mthca/mthca_provider.h
··· 1 1 /* 2 2 * Copyright (c) 2004 Topspin Communications. All rights reserved. 3 - * Copyright (c) 2005 Cisco Systems. All rights reserved. 3 + * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. 4 4 * Copyright (c) 2005 Mellanox Technologies. All rights reserved. 5 5 * 6 6 * This software is available to you under a choice of one of two ··· 164 164 * - wait_event until ref count is zero 165 165 * 166 166 * It is the consumer's responsibilty to make sure that no QP 167 - * operations (WQE posting or state modification) are pending when the 167 + * operations (WQE posting or state modification) are pending when a 168 168 * QP is destroyed. Also, the consumer must make sure that calls to 169 - * qp_modify are serialized. 169 + * qp_modify are serialized. Similarly, the consumer is responsible 170 + * for ensuring that no CQ resize operations are pending when a CQ 171 + * is destroyed. 170 172 * 171 173 * Possible optimizations (wait for profile data to see if/where we 172 174 * have locks bouncing between CPUs): ··· 178 176 * send queue and one for the receive queue) 179 177 */ 180 178 179 + struct mthca_cq_buf { 180 + union mthca_buf queue; 181 + struct mthca_mr mr; 182 + int is_direct; 183 + }; 184 + 185 + struct mthca_cq_resize { 186 + struct mthca_cq_buf buf; 187 + int cqe; 188 + enum { 189 + CQ_RESIZE_ALLOC, 190 + CQ_RESIZE_READY, 191 + CQ_RESIZE_SWAPPED 192 + } state; 193 + }; 194 + 181 195 struct mthca_cq { 182 - struct ib_cq ibcq; 183 - spinlock_t lock; 184 - atomic_t refcount; 185 - int cqn; 186 - u32 cons_index; 187 - int is_direct; 188 - int is_kernel; 196 + struct ib_cq ibcq; 197 + spinlock_t lock; 198 + atomic_t refcount; 199 + int cqn; 200 + u32 cons_index; 201 + struct mthca_cq_buf buf; 202 + struct mthca_cq_resize *resize_buf; 203 + int is_kernel; 189 204 190 205 /* Next fields are Arbel only */ 191 - int set_ci_db_index; 192 - __be32 *set_ci_db; 193 - int arm_db_index; 194 - __be32 *arm_db; 195 - int arm_sn; 206 + int set_ci_db_index; 207 + __be32 *set_ci_db; 208 + int arm_db_index; 209 + __be32 *arm_db; 210 + int arm_sn; 196 211 197 - union mthca_buf queue; 198 - struct mthca_mr mr; 199 - wait_queue_head_t wait; 212 + wait_queue_head_t wait; 200 213 }; 201 214 202 215 struct mthca_srq {
+6 -1
drivers/infiniband/hw/mthca/mthca_user.h
··· 1 1 /* 2 2 * Copyright (c) 2005 Topspin Communications. All rights reserved. 3 - * Copyright (c) 2005 Cisco Systems. All rights reserved. 3 + * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. 4 4 * 5 5 * This software is available to you under a choice of one of two 6 6 * licenses. You may choose to be licensed under the terms of the GNU ··· 72 72 73 73 struct mthca_create_cq_resp { 74 74 __u32 cqn; 75 + __u32 reserved; 76 + }; 77 + 78 + struct mthca_resize_cq { 79 + __u32 lkey; 75 80 __u32 reserved; 76 81 }; 77 82