Commit abd712da authored by Dennis Dalessandro's avatar Dennis Dalessandro Committed by Doug Ledford

staging/rdma/hfi1: Remove CQ data structures and functions from hfi1

The completion queue is not a complex data structure and it can be removed
at the same time as its functions. Unlike the more complicated queue pair
which was done in multiple patches. This single patch removes all traces
of hfi1 specific completeion queues from the hfi1 driver.
Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
Reviewed-by: default avatarHarish Chegondi <harish.chegondi@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 94d5171c
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
obj-$(CONFIG_INFINIBAND_HFI1) += hfi1.o obj-$(CONFIG_INFINIBAND_HFI1) += hfi1.o
hfi1-y := chip.o cq.o device.o diag.o driver.o efivar.o eprom.o file_ops.o firmware.o \ hfi1-y := chip.o device.o diag.o driver.o efivar.o eprom.o file_ops.o firmware.o \
init.o intr.o mad.o pcie.o pio.o pio_copy.o \ init.o intr.o mad.o pcie.o pio.o pio_copy.o \
qp.o qsfp.o rc.o ruc.o sdma.o srq.o sysfs.o trace.o twsi.o \ qp.o qsfp.o rc.o ruc.o sdma.o srq.o sysfs.o trace.o twsi.o \
uc.o ud.o user_exp_rcv.o user_pages.o user_sdma.o verbs_mcast.o verbs.o uc.o ud.o user_exp_rcv.o user_pages.o user_sdma.o verbs_mcast.o verbs.o
......
This diff is collapsed.
...@@ -1009,8 +1009,6 @@ struct hfi1_devdata { ...@@ -1009,8 +1009,6 @@ struct hfi1_devdata {
u16 psxmitwait_check_rate; u16 psxmitwait_check_rate;
/* high volume overflow errors deferred to tasklet */ /* high volume overflow errors deferred to tasklet */
struct tasklet_struct error_tasklet; struct tasklet_struct error_tasklet;
/* per device cq worker */
struct kthread_worker *worker;
/* MSI-X information */ /* MSI-X information */
struct hfi1_msix_entry *msix_entries; struct hfi1_msix_entry *msix_entries;
......
...@@ -765,7 +765,6 @@ int hfi1_init(struct hfi1_devdata *dd, int reinit) ...@@ -765,7 +765,6 @@ int hfi1_init(struct hfi1_devdata *dd, int reinit)
/* enable chip even if we have an error, so we can debug cause */ /* enable chip even if we have an error, so we can debug cause */
enable_chip(dd); enable_chip(dd);
ret = hfi1_cq_init(dd);
done: done:
/* /*
* Set status even if port serdes is not initialized * Set status even if port serdes is not initialized
...@@ -1312,7 +1311,6 @@ static void cleanup_device_data(struct hfi1_devdata *dd) ...@@ -1312,7 +1311,6 @@ static void cleanup_device_data(struct hfi1_devdata *dd)
kfree(dd->boardname); kfree(dd->boardname);
vfree(dd->events); vfree(dd->events);
vfree(dd->status); vfree(dd->status);
hfi1_cq_exit(dd);
} }
/* /*
......
...@@ -304,7 +304,7 @@ int hfi1_error_qp(struct rvt_qp *qp, enum ib_wc_status err) ...@@ -304,7 +304,7 @@ int hfi1_error_qp(struct rvt_qp *qp, enum ib_wc_status err)
if (test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags)) { if (test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags)) {
wc.wr_id = qp->r_wr_id; wc.wr_id = qp->r_wr_id;
wc.status = err; wc.status = err;
hfi1_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1); rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc, 1);
} }
wc.status = IB_WC_WR_FLUSH_ERR; wc.status = IB_WC_WR_FLUSH_ERR;
...@@ -327,7 +327,7 @@ int hfi1_error_qp(struct rvt_qp *qp, enum ib_wc_status err) ...@@ -327,7 +327,7 @@ int hfi1_error_qp(struct rvt_qp *qp, enum ib_wc_status err)
wc.wr_id = get_rwqe_ptr(&qp->r_rq, tail)->wr_id; wc.wr_id = get_rwqe_ptr(&qp->r_rq, tail)->wr_id;
if (++tail >= qp->r_rq.size) if (++tail >= qp->r_rq.size)
tail = 0; tail = 0;
hfi1_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1); rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc, 1);
} }
wq->tail = tail; wq->tail = tail;
......
...@@ -1040,7 +1040,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_ib_header *hdr) ...@@ -1040,7 +1040,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_ib_header *hdr)
wc.opcode = ib_hfi1_wc_opcode[wqe->wr.opcode]; wc.opcode = ib_hfi1_wc_opcode[wqe->wr.opcode];
wc.byte_len = wqe->length; wc.byte_len = wqe->length;
wc.qp = &qp->ibqp; wc.qp = &qp->ibqp;
hfi1_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 0); rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.send_cq), &wc, 0);
} }
if (++qp->s_last >= qp->s_size) if (++qp->s_last >= qp->s_size)
qp->s_last = 0; qp->s_last = 0;
...@@ -1097,7 +1097,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, ...@@ -1097,7 +1097,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp,
wc.opcode = ib_hfi1_wc_opcode[wqe->wr.opcode]; wc.opcode = ib_hfi1_wc_opcode[wqe->wr.opcode];
wc.byte_len = wqe->length; wc.byte_len = wqe->length;
wc.qp = &qp->ibqp; wc.qp = &qp->ibqp;
hfi1_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 0); rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.send_cq), &wc, 0);
} }
if (++qp->s_last >= qp->s_size) if (++qp->s_last >= qp->s_size)
qp->s_last = 0; qp->s_last = 0;
...@@ -2157,8 +2157,8 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) ...@@ -2157,8 +2157,8 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
wc.dlid_path_bits = 0; wc.dlid_path_bits = 0;
wc.port_num = 0; wc.port_num = 0;
/* Signal completion event if the solicited bit is set. */ /* Signal completion event if the solicited bit is set. */
hfi1_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
(bth0 & IB_BTH_SOLICITED) != 0); (bth0 & IB_BTH_SOLICITED) != 0);
break; break;
case OP(RDMA_WRITE_FIRST): case OP(RDMA_WRITE_FIRST):
......
...@@ -138,7 +138,7 @@ static int init_sge(struct rvt_qp *qp, struct rvt_rwqe *wqe) ...@@ -138,7 +138,7 @@ static int init_sge(struct rvt_qp *qp, struct rvt_rwqe *wqe)
wc.opcode = IB_WC_RECV; wc.opcode = IB_WC_RECV;
wc.qp = &qp->ibqp; wc.qp = &qp->ibqp;
/* Signal solicited completion event. */ /* Signal solicited completion event. */
hfi1_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1); rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc, 1);
ret = 0; ret = 0;
bail: bail:
return ret; return ret;
...@@ -566,8 +566,8 @@ static void ruc_loopback(struct rvt_qp *sqp) ...@@ -566,8 +566,8 @@ static void ruc_loopback(struct rvt_qp *sqp)
wc.sl = qp->remote_ah_attr.sl; wc.sl = qp->remote_ah_attr.sl;
wc.port_num = 1; wc.port_num = 1;
/* Signal completion event if the solicited bit is set. */ /* Signal completion event if the solicited bit is set. */
hfi1_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
wqe->wr.send_flags & IB_SEND_SOLICITED); wqe->wr.send_flags & IB_SEND_SOLICITED);
send_comp: send_comp:
spin_lock_irqsave(&sqp->s_lock, flags); spin_lock_irqsave(&sqp->s_lock, flags);
...@@ -909,8 +909,8 @@ void hfi1_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe, ...@@ -909,8 +909,8 @@ void hfi1_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe,
wc.qp = &qp->ibqp; wc.qp = &qp->ibqp;
if (status == IB_WC_SUCCESS) if (status == IB_WC_SUCCESS)
wc.byte_len = wqe->length; wc.byte_len = wqe->length;
hfi1_cq_enter(to_icq(qp->ibqp.send_cq), &wc, rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.send_cq), &wc,
status != IB_WC_SUCCESS); status != IB_WC_SUCCESS);
} }
last = qp->s_last; last = qp->s_last;
......
...@@ -469,9 +469,9 @@ void hfi1_uc_rcv(struct hfi1_packet *packet) ...@@ -469,9 +469,9 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)
wc.dlid_path_bits = 0; wc.dlid_path_bits = 0;
wc.port_num = 0; wc.port_num = 0;
/* Signal completion event if the solicited bit is set. */ /* Signal completion event if the solicited bit is set. */
hfi1_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
(ohdr->bth[0] & (ohdr->bth[0] &
cpu_to_be32(IB_BTH_SOLICITED)) != 0); cpu_to_be32(IB_BTH_SOLICITED)) != 0);
break; break;
case OP(RDMA_WRITE_FIRST): case OP(RDMA_WRITE_FIRST):
......
...@@ -247,8 +247,8 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe) ...@@ -247,8 +247,8 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
wc.dlid_path_bits = ah_attr->dlid & ((1 << ppd->lmc) - 1); wc.dlid_path_bits = ah_attr->dlid & ((1 << ppd->lmc) - 1);
wc.port_num = qp->port_num; wc.port_num = qp->port_num;
/* Signal completion event if the solicited bit is set. */ /* Signal completion event if the solicited bit is set. */
hfi1_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
swqe->wr.send_flags & IB_SEND_SOLICITED); swqe->wr.send_flags & IB_SEND_SOLICITED);
ibp->rvp.n_loop_pkts++; ibp->rvp.n_loop_pkts++;
bail_unlock: bail_unlock:
spin_unlock_irqrestore(&qp->r_lock, flags); spin_unlock_irqrestore(&qp->r_lock, flags);
...@@ -878,9 +878,9 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) ...@@ -878,9 +878,9 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
dlid & ((1 << ppd_from_ibp(ibp)->lmc) - 1); dlid & ((1 << ppd_from_ibp(ibp)->lmc) - 1);
wc.port_num = qp->port_num; wc.port_num = qp->port_num;
/* Signal completion event if the solicited bit is set. */ /* Signal completion event if the solicited bit is set. */
hfi1_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc,
(ohdr->bth[0] & (ohdr->bth[0] &
cpu_to_be32(IB_BTH_SOLICITED)) != 0); cpu_to_be32(IB_BTH_SOLICITED)) != 0);
return; return;
drop: drop:
......
...@@ -1719,7 +1719,6 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) ...@@ -1719,7 +1719,6 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
/* Only need to initialize non-zero fields. */ /* Only need to initialize non-zero fields. */
spin_lock_init(&dev->n_cqs_lock);
spin_lock_init(&dev->n_qps_lock); spin_lock_init(&dev->n_qps_lock);
spin_lock_init(&dev->n_srqs_lock); spin_lock_init(&dev->n_srqs_lock);
spin_lock_init(&dev->n_mcast_grps_lock); spin_lock_init(&dev->n_mcast_grps_lock);
...@@ -1816,11 +1815,11 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) ...@@ -1816,11 +1815,11 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
ibdev->post_send = post_send; ibdev->post_send = post_send;
ibdev->post_recv = post_receive; ibdev->post_recv = post_receive;
ibdev->post_srq_recv = hfi1_post_srq_receive; ibdev->post_srq_recv = hfi1_post_srq_receive;
ibdev->create_cq = hfi1_create_cq; ibdev->create_cq = NULL;
ibdev->destroy_cq = hfi1_destroy_cq; ibdev->destroy_cq = NULL;
ibdev->resize_cq = hfi1_resize_cq; ibdev->resize_cq = NULL;
ibdev->poll_cq = hfi1_poll_cq; ibdev->poll_cq = NULL;
ibdev->req_notify_cq = hfi1_req_notify_cq; ibdev->req_notify_cq = NULL;
ibdev->get_dma_mr = NULL; ibdev->get_dma_mr = NULL;
ibdev->reg_user_mr = NULL; ibdev->reg_user_mr = NULL;
ibdev->dereg_mr = NULL; ibdev->dereg_mr = NULL;
...@@ -1860,14 +1859,20 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) ...@@ -1860,14 +1859,20 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
dd->verbs_dev.rdi.dparms.qos_shift = dd->qos_shift; dd->verbs_dev.rdi.dparms.qos_shift = dd->qos_shift;
dd->verbs_dev.rdi.dparms.qpn_res_start = kdeth_qp << 16; dd->verbs_dev.rdi.dparms.qpn_res_start = kdeth_qp << 16;
dd->verbs_dev.rdi.dparms.qpn_res_end = dd->verbs_dev.rdi.dparms.qpn_res_end =
dd->verbs_dev.rdi.dparms.qpn_res_start + 65535; dd->verbs_dev.rdi.dparms.qpn_res_start + 65535;
dd->verbs_dev.rdi.driver_f.qp_priv_alloc = qp_priv_alloc; dd->verbs_dev.rdi.driver_f.qp_priv_alloc = qp_priv_alloc;
dd->verbs_dev.rdi.driver_f.qp_priv_free = qp_priv_free; dd->verbs_dev.rdi.driver_f.qp_priv_free = qp_priv_free;
dd->verbs_dev.rdi.driver_f.free_all_qps = free_all_qps; dd->verbs_dev.rdi.driver_f.free_all_qps = free_all_qps;
dd->verbs_dev.rdi.driver_f.notify_qp_reset = notify_qp_reset; dd->verbs_dev.rdi.driver_f.notify_qp_reset = notify_qp_reset;
/* completeion queue */
snprintf(dd->verbs_dev.rdi.dparms.cq_name,
sizeof(dd->verbs_dev.rdi.dparms.cq_name),
"hfi1_cq%d", dd->unit);
dd->verbs_dev.rdi.dparms.node = dd->assigned_node_id;
/* misc settings */ /* misc settings */
dd->verbs_dev.rdi.flags = RVT_FLAG_CQ_INIT_DRIVER; dd->verbs_dev.rdi.flags = 0; /* Let rdmavt handle it all */
dd->verbs_dev.rdi.dparms.lkey_table_size = hfi1_lkey_table_size; dd->verbs_dev.rdi.dparms.lkey_table_size = hfi1_lkey_table_size;
dd->verbs_dev.rdi.dparms.nports = dd->num_pports; dd->verbs_dev.rdi.dparms.nports = dd->num_pports;
dd->verbs_dev.rdi.dparms.npkeys = hfi1_get_npkeys(dd); dd->verbs_dev.rdi.dparms.npkeys = hfi1_get_npkeys(dd);
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include <rdma/ib_mad.h> #include <rdma/ib_mad.h>
#include <rdma/rdma_vt.h> #include <rdma/rdma_vt.h>
#include <rdma/rdmavt_qp.h> #include <rdma/rdmavt_qp.h>
#include <rdma/rdmavt_cq.h>
struct hfi1_ctxtdata; struct hfi1_ctxtdata;
struct hfi1_pportdata; struct hfi1_pportdata;
...@@ -81,12 +82,6 @@ struct hfi1_packet; ...@@ -81,12 +82,6 @@ struct hfi1_packet;
*/ */
#define HFI1_UVERBS_ABI_VERSION 2 #define HFI1_UVERBS_ABI_VERSION 2
/*
* Define an ib_cq_notify value that is not valid so we know when CQ
* notifications are armed.
*/
#define IB_CQ_NONE (IB_CQ_NEXT_COMP + 1)
#define IB_SEQ_NAK (3 << 29) #define IB_SEQ_NAK (3 << 29)
/* AETH NAK opcode values */ /* AETH NAK opcode values */
...@@ -235,35 +230,6 @@ struct hfi1_mcast { ...@@ -235,35 +230,6 @@ struct hfi1_mcast {
int n_attached; int n_attached;
}; };
/*
* This structure is used to contain the head pointer, tail pointer,
* and completion queue entries as a single memory allocation so
* it can be mmap'ed into user space.
*/
struct hfi1_cq_wc {
u32 head; /* index of next entry to fill */
u32 tail; /* index of next ib_poll_cq() entry */
union {
/* these are actually size ibcq.cqe + 1 */
struct ib_uverbs_wc uqueue[0];
struct ib_wc kqueue[0];
};
};
/*
* The completion queue structure.
*/
struct hfi1_cq {
struct ib_cq ibcq;
struct kthread_work comptask;
struct hfi1_devdata *dd;
spinlock_t lock; /* protect changes in this struct */
u8 notify;
u8 triggered;
struct hfi1_cq_wc *queue;
struct rvt_mmap_info *ip;
};
/* /*
* hfi1 specific data structures that will be hidden from rvt after the queue * hfi1 specific data structures that will be hidden from rvt after the queue
* pair is made common * pair is made common
...@@ -363,8 +329,6 @@ struct hfi1_ibdev { ...@@ -363,8 +329,6 @@ struct hfi1_ibdev {
u64 n_kmem_wait; u64 n_kmem_wait;
u64 n_send_schedule; u64 n_send_schedule;
u32 n_cqs_allocated; /* number of CQs allocated for device */
spinlock_t n_cqs_lock;
u32 n_qps_allocated; /* number of QPs allocated for device */ u32 n_qps_allocated; /* number of QPs allocated for device */
spinlock_t n_qps_lock; spinlock_t n_qps_lock;
u32 n_srqs_allocated; /* number of SRQs allocated for device */ u32 n_srqs_allocated; /* number of SRQs allocated for device */
...@@ -395,11 +359,6 @@ struct hfi1_verbs_counters { ...@@ -395,11 +359,6 @@ struct hfi1_verbs_counters {
u32 vl15_dropped; u32 vl15_dropped;
}; };
static inline struct hfi1_cq *to_icq(struct ib_cq *ibcq)
{
return container_of(ibcq, struct hfi1_cq, ibcq);
}
static inline struct rvt_qp *to_iqp(struct ib_qp *ibqp) static inline struct rvt_qp *to_iqp(struct ib_qp *ibqp)
{ {
return container_of(ibqp, struct rvt_qp, ibqp); return container_of(ibqp, struct rvt_qp, ibqp);
...@@ -563,28 +522,6 @@ int hfi1_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr); ...@@ -563,28 +522,6 @@ int hfi1_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr);
int hfi1_destroy_srq(struct ib_srq *ibsrq); int hfi1_destroy_srq(struct ib_srq *ibsrq);
int hfi1_cq_init(struct hfi1_devdata *dd);
void hfi1_cq_exit(struct hfi1_devdata *dd);
void hfi1_cq_enter(struct hfi1_cq *cq, struct ib_wc *entry, int sig);
int hfi1_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry);
struct ib_cq *hfi1_create_cq(
struct ib_device *ibdev,
const struct ib_cq_init_attr *attr,
struct ib_ucontext *context,
struct ib_udata *udata);
int hfi1_destroy_cq(struct ib_cq *ibcq);
int hfi1_req_notify_cq(
struct ib_cq *ibcq,
enum ib_cq_notify_flags notify_flags);
int hfi1_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata);
static inline void hfi1_put_ss(struct rvt_sge_state *ss) static inline void hfi1_put_ss(struct rvt_sge_state *ss)
{ {
while (ss->num_sge) { while (ss->num_sge) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment