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

staging/rdma/hfi1: Remove modify queue pair from hfi1

In addition to removing the modify queue pair verb from hfi1 we also
remove ancillary functions which existed only for modify queue pair and
are also already present in hfi1.
Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 0facc5a1
...@@ -1133,13 +1133,6 @@ int rvt_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, ...@@ -1133,13 +1133,6 @@ int rvt_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
qp->remote_ah_attr = qp->alt_ah_attr; qp->remote_ah_attr = qp->alt_ah_attr;
qp->port_num = qp->alt_ah_attr.port_num; qp->port_num = qp->alt_ah_attr.port_num;
qp->s_pkey_index = qp->s_alt_pkey_index; qp->s_pkey_index = qp->s_alt_pkey_index;
/*
* Ignored by drivers which do not support it. Not
* really worth creating a call back into the driver
* just to set a flag.
*/
qp->s_flags |= RVT_S_AHG_CLEAR;
} }
} }
......
...@@ -345,7 +345,6 @@ struct hfi1_message_header { ...@@ -345,7 +345,6 @@ struct hfi1_message_header {
#define HFI1_AETH_CREDIT_MASK 0x1F #define HFI1_AETH_CREDIT_MASK 0x1F
#define HFI1_AETH_CREDIT_INVAL 0x1F #define HFI1_AETH_CREDIT_INVAL 0x1F
#define HFI1_MSN_MASK 0xFFFFFF #define HFI1_MSN_MASK 0xFFFFFF
#define HFI1_QPN_MASK 0xFFFFFF
#define HFI1_FECN_SHIFT 31 #define HFI1_FECN_SHIFT 31
#define HFI1_FECN_MASK 1 #define HFI1_FECN_MASK 1
#define HFI1_FECN_SMASK BIT(HFI1_FECN_SHIFT) #define HFI1_FECN_SMASK BIT(HFI1_FECN_SHIFT)
......
...@@ -282,6 +282,8 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd, ...@@ -282,6 +282,8 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
u32 rte = rhf_rcv_type_err(packet->rhf); u32 rte = rhf_rcv_type_err(packet->rhf);
int lnh = be16_to_cpu(rhdr->lrh[0]) & 3; int lnh = be16_to_cpu(rhdr->lrh[0]) & 3;
struct hfi1_ibport *ibp = &ppd->ibport_data; struct hfi1_ibport *ibp = &ppd->ibport_data;
struct hfi1_devdata *dd = ppd->dd;
struct rvt_dev_info *rdi = &dd->verbs_dev.rdi;
if (packet->rhf & (RHF_VCRC_ERR | RHF_ICRC_ERR)) if (packet->rhf & (RHF_VCRC_ERR | RHF_ICRC_ERR))
return; return;
...@@ -316,13 +318,13 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd, ...@@ -316,13 +318,13 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
goto drop; goto drop;
/* Get the destination QP number. */ /* Get the destination QP number. */
qp_num = be32_to_cpu(ohdr->bth[1]) & HFI1_QPN_MASK; qp_num = be32_to_cpu(ohdr->bth[1]) & RVT_QPN_MASK;
if (lid < be16_to_cpu(IB_MULTICAST_LID_BASE)) { if (lid < be16_to_cpu(IB_MULTICAST_LID_BASE)) {
struct rvt_qp *qp; struct rvt_qp *qp;
unsigned long flags; unsigned long flags;
rcu_read_lock(); rcu_read_lock();
qp = hfi1_lookup_qpn(ibp, qp_num); qp = rvt_lookup_qpn(rdi, &ibp->rvp, qp_num);
if (!qp) { if (!qp) {
rcu_read_unlock(); rcu_read_unlock();
goto drop; goto drop;
...@@ -397,9 +399,9 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd, ...@@ -397,9 +399,9 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
sc5 |= 0x10; sc5 |= 0x10;
sl = ibp->sc_to_sl[sc5]; sl = ibp->sc_to_sl[sc5];
lqpn = be32_to_cpu(bth[1]) & HFI1_QPN_MASK; lqpn = be32_to_cpu(bth[1]) & RVT_QPN_MASK;
rcu_read_lock(); rcu_read_lock();
qp = hfi1_lookup_qpn(ibp, lqpn); qp = rvt_lookup_qpn(rdi, &ibp->rvp, lqpn);
if (qp == NULL) { if (qp == NULL) {
rcu_read_unlock(); rcu_read_unlock();
goto drop; goto drop;
...@@ -470,7 +472,7 @@ static void process_ecn(struct rvt_qp *qp, struct hfi1_ib_header *hdr, ...@@ -470,7 +472,7 @@ static void process_ecn(struct rvt_qp *qp, struct hfi1_ib_header *hdr,
case IB_QPT_GSI: case IB_QPT_GSI:
case IB_QPT_UD: case IB_QPT_UD:
rlid = be16_to_cpu(hdr->lrh[3]); rlid = be16_to_cpu(hdr->lrh[3]);
rqpn = be32_to_cpu(ohdr->u.ud.deth[1]) & HFI1_QPN_MASK; rqpn = be32_to_cpu(ohdr->u.ud.deth[1]) & RVT_QPN_MASK;
svc_type = IB_CC_SVCTYPE_UD; svc_type = IB_CC_SVCTYPE_UD;
break; break;
case IB_QPT_UC: case IB_QPT_UC:
...@@ -500,7 +502,7 @@ static void process_ecn(struct rvt_qp *qp, struct hfi1_ib_header *hdr, ...@@ -500,7 +502,7 @@ static void process_ecn(struct rvt_qp *qp, struct hfi1_ib_header *hdr,
if (bth1 & HFI1_BECN_SMASK) { if (bth1 & HFI1_BECN_SMASK) {
struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
u32 lqpn = bth1 & HFI1_QPN_MASK; u32 lqpn = bth1 & RVT_QPN_MASK;
u8 sl = ibp->sc_to_sl[sc5]; u8 sl = ibp->sc_to_sl[sc5];
process_becn(ppd, sl, rlid, lqpn, rqpn, svc_type); process_becn(ppd, sl, rlid, lqpn, rqpn, svc_type);
...@@ -599,6 +601,7 @@ static void prescan_rxq(struct hfi1_packet *packet) ...@@ -599,6 +601,7 @@ static void prescan_rxq(struct hfi1_packet *packet)
struct hfi1_ib_header *hdr; struct hfi1_ib_header *hdr;
struct hfi1_other_headers *ohdr; struct hfi1_other_headers *ohdr;
struct ib_grh *grh = NULL; struct ib_grh *grh = NULL;
struct rvt_dev_info *rdi = &dd->verbs_dev.rdi;
u64 rhf = rhf_to_cpu(rhf_addr); u64 rhf = rhf_to_cpu(rhf_addr);
u32 etype = rhf_rcv_type(rhf), qpn, bth1; u32 etype = rhf_rcv_type(rhf), qpn, bth1;
int is_ecn = 0; int is_ecn = 0;
...@@ -631,9 +634,9 @@ static void prescan_rxq(struct hfi1_packet *packet) ...@@ -631,9 +634,9 @@ static void prescan_rxq(struct hfi1_packet *packet)
if (!is_ecn) if (!is_ecn)
goto next; goto next;
qpn = bth1 & HFI1_QPN_MASK; qpn = bth1 & RVT_QPN_MASK;
rcu_read_lock(); rcu_read_lock();
qp = hfi1_lookup_qpn(ibp, qpn); qp = rvt_lookup_qpn(rdi, &ibp->rvp, qpn);
if (qp == NULL) { if (qp == NULL) {
rcu_read_unlock(); rcu_read_unlock();
......
This diff is collapsed.
...@@ -57,38 +57,6 @@ ...@@ -57,38 +57,6 @@
extern unsigned int hfi1_qp_table_size; extern unsigned int hfi1_qp_table_size;
static inline u32 qpn_hash(struct rvt_qp_ibdev *dev, u32 qpn)
{
return hash_32(qpn, dev->qp_table_bits);
}
/**
* hfi1_lookup_qpn - return the QP with the given QPN
* @ibp: the ibport
* @qpn: the QP number to look up
*
* The caller must hold the rcu_read_lock(), and keep the lock until
* the returned qp is no longer in use.
*/
static inline struct rvt_qp *hfi1_lookup_qpn(struct hfi1_ibport *ibp,
u32 qpn) __must_hold(RCU)
{
struct rvt_qp *qp = NULL;
if (unlikely(qpn <= 1)) {
qp = rcu_dereference(ibp->rvp.qp[qpn]);
} else {
struct hfi1_ibdev *dev = &ppd_from_ibp(ibp)->dd->verbs_dev;
u32 n = qpn_hash(dev->rdi.qp_dev, qpn);
for (qp = rcu_dereference(dev->rdi.qp_dev->qp_table[n]); qp;
qp = rcu_dereference(qp->next))
if (qp->ibqp.qp_num == qpn)
break;
}
return qp;
}
/* /*
* free_ahg - clear ahg from QP * free_ahg - clear ahg from QP
*/ */
...@@ -103,30 +71,6 @@ static inline void clear_ahg(struct rvt_qp *qp) ...@@ -103,30 +71,6 @@ static inline void clear_ahg(struct rvt_qp *qp)
qp->s_ahgidx = -1; qp->s_ahgidx = -1;
} }
/**
* hfi1_error_qp - put a QP into the error state
* @qp: the QP to put into the error state
* @err: the receive completion error to signal if a RWQE is active
*
* Flushes both send and receive work queues.
* Returns true if last WQE event should be generated.
* The QP r_lock and s_lock should be held and interrupts disabled.
* If we are already in error state, just return.
*/
int hfi1_error_qp(struct rvt_qp *qp, enum ib_wc_status err);
/**
* hfi1_modify_qp - modify the attributes of a queue pair
* @ibqp: the queue pair who's attributes we're modifying
* @attr: the new attributes
* @attr_mask: the mask of attributes to modify
* @udata: user data for libibverbs.so
*
* Returns 0 on success, otherwise returns an errno.
*/
int hfi1_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
int attr_mask, struct ib_udata *udata);
int hfi1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int hfi1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
int attr_mask, struct ib_qp_init_attr *init_attr); int attr_mask, struct ib_qp_init_attr *init_attr);
...@@ -253,5 +197,12 @@ void *qp_priv_alloc(struct rvt_dev_info *rdi, struct rvt_qp *qp, ...@@ -253,5 +197,12 @@ void *qp_priv_alloc(struct rvt_dev_info *rdi, struct rvt_qp *qp,
void qp_priv_free(struct rvt_dev_info *rdi, struct rvt_qp *qp); void qp_priv_free(struct rvt_dev_info *rdi, struct rvt_qp *qp);
unsigned free_all_qps(struct rvt_dev_info *rdi); unsigned free_all_qps(struct rvt_dev_info *rdi);
void notify_qp_reset(struct rvt_qp *qp); void notify_qp_reset(struct rvt_qp *qp);
int get_pmtu_from_attr(struct rvt_dev_info *rdi, struct rvt_qp *qp,
struct ib_qp_attr *attr);
void flush_qp_waiters(struct rvt_qp *qp);
void notify_error_qp(struct rvt_qp *qp);
void stop_send_queue(struct rvt_qp *qp);
void quiesce_qp(struct rvt_qp *qp);
u32 mtu_from_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp, u32 pmtu);
int mtu_to_path_mtu(u32 mtu);
#endif /* _QP_H */ #endif /* _QP_H */
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
*/ */
#include <linux/io.h> #include <linux/io.h>
#include <rdma/rdma_vt.h>
#include <rdma/rdmavt_qp.h>
#include "hfi.h" #include "hfi.h"
#include "qp.h" #include "qp.h"
...@@ -891,7 +893,7 @@ static void restart_rc(struct rvt_qp *qp, u32 psn, int wait) ...@@ -891,7 +893,7 @@ static void restart_rc(struct rvt_qp *qp, u32 psn, int wait)
qp->s_retry = qp->s_retry_cnt; qp->s_retry = qp->s_retry_cnt;
} else if (qp->s_last == qp->s_acked) { } else if (qp->s_last == qp->s_acked) {
hfi1_send_complete(qp, wqe, IB_WC_RETRY_EXC_ERR); hfi1_send_complete(qp, wqe, IB_WC_RETRY_EXC_ERR);
hfi1_error_qp(qp, IB_WC_WR_FLUSH_ERR); rvt_error_qp(qp, IB_WC_WR_FLUSH_ERR);
return; return;
} else /* need to handle delayed completion */ } else /* need to handle delayed completion */
return; return;
...@@ -1355,7 +1357,7 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode, ...@@ -1355,7 +1357,7 @@ static int do_rc_ack(struct rvt_qp *qp, u32 aeth, u32 psn, int opcode,
class_b: class_b:
if (qp->s_last == qp->s_acked) { if (qp->s_last == qp->s_acked) {
hfi1_send_complete(qp, wqe, status); hfi1_send_complete(qp, wqe, status);
hfi1_error_qp(qp, IB_WC_WR_FLUSH_ERR); rvt_error_qp(qp, IB_WC_WR_FLUSH_ERR);
} }
break; break;
...@@ -1601,7 +1603,7 @@ static void rc_rcv_resp(struct hfi1_ibport *ibp, ...@@ -1601,7 +1603,7 @@ static void rc_rcv_resp(struct hfi1_ibport *ibp,
ack_err: ack_err:
if (qp->s_last == qp->s_acked) { if (qp->s_last == qp->s_acked) {
hfi1_send_complete(qp, wqe, status); hfi1_send_complete(qp, wqe, status);
hfi1_error_qp(qp, IB_WC_WR_FLUSH_ERR); rvt_error_qp(qp, IB_WC_WR_FLUSH_ERR);
} }
ack_done: ack_done:
spin_unlock_irqrestore(&qp->s_lock, flags); spin_unlock_irqrestore(&qp->s_lock, flags);
...@@ -1832,7 +1834,7 @@ void hfi1_rc_error(struct rvt_qp *qp, enum ib_wc_status err) ...@@ -1832,7 +1834,7 @@ void hfi1_rc_error(struct rvt_qp *qp, enum ib_wc_status err)
int lastwqe; int lastwqe;
spin_lock_irqsave(&qp->s_lock, flags); spin_lock_irqsave(&qp->s_lock, flags);
lastwqe = hfi1_error_qp(qp, err); lastwqe = rvt_error_qp(qp, err);
spin_unlock_irqrestore(&qp->s_lock, flags); spin_unlock_irqrestore(&qp->s_lock, flags);
if (lastwqe) { if (lastwqe) {
...@@ -1873,8 +1875,8 @@ static void log_cca_event(struct hfi1_pportdata *ppd, u8 sl, u32 rlid, ...@@ -1873,8 +1875,8 @@ static void log_cca_event(struct hfi1_pportdata *ppd, u8 sl, u32 rlid,
cc_event = &ppd->cc_events[ppd->cc_log_idx++]; cc_event = &ppd->cc_events[ppd->cc_log_idx++];
if (ppd->cc_log_idx == OPA_CONG_LOG_ELEMS) if (ppd->cc_log_idx == OPA_CONG_LOG_ELEMS)
ppd->cc_log_idx = 0; ppd->cc_log_idx = 0;
cc_event->lqpn = lqpn & HFI1_QPN_MASK; cc_event->lqpn = lqpn & RVT_QPN_MASK;
cc_event->rqpn = rqpn & HFI1_QPN_MASK; cc_event->rqpn = rqpn & RVT_QPN_MASK;
cc_event->sl = sl; cc_event->sl = sl;
cc_event->svc_type = svc_type; cc_event->svc_type = svc_type;
cc_event->rlid = rlid; cc_event->rlid = rlid;
...@@ -2063,7 +2065,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) ...@@ -2063,7 +2065,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
/* OK, process the packet. */ /* OK, process the packet. */
switch (opcode) { switch (opcode) {
case OP(SEND_FIRST): case OP(SEND_FIRST):
ret = hfi1_get_rwqe(qp, 0); ret = hfi1_rvt_get_rwqe(qp, 0);
if (ret < 0) if (ret < 0)
goto nack_op_err; goto nack_op_err;
if (!ret) if (!ret)
...@@ -2084,7 +2086,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) ...@@ -2084,7 +2086,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
case OP(RDMA_WRITE_LAST_WITH_IMMEDIATE): case OP(RDMA_WRITE_LAST_WITH_IMMEDIATE):
/* consume RWQE */ /* consume RWQE */
ret = hfi1_get_rwqe(qp, 1); ret = hfi1_rvt_get_rwqe(qp, 1);
if (ret < 0) if (ret < 0)
goto nack_op_err; goto nack_op_err;
if (!ret) if (!ret)
...@@ -2093,7 +2095,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) ...@@ -2093,7 +2095,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
case OP(SEND_ONLY): case OP(SEND_ONLY):
case OP(SEND_ONLY_WITH_IMMEDIATE): case OP(SEND_ONLY_WITH_IMMEDIATE):
ret = hfi1_get_rwqe(qp, 0); ret = hfi1_rvt_get_rwqe(qp, 0);
if (ret < 0) if (ret < 0)
goto nack_op_err; goto nack_op_err;
if (!ret) if (!ret)
...@@ -2125,7 +2127,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) ...@@ -2125,7 +2127,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
if (unlikely(wc.byte_len > qp->r_len)) if (unlikely(wc.byte_len > qp->r_len))
goto nack_inv; goto nack_inv;
hfi1_copy_sge(&qp->r_sge, data, tlen, 1); hfi1_copy_sge(&qp->r_sge, data, tlen, 1);
hfi1_put_ss(&qp->r_sge); rvt_put_ss(&qp->r_sge);
qp->r_msn++; qp->r_msn++;
if (!test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags)) if (!test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags))
break; break;
...@@ -2193,7 +2195,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) ...@@ -2193,7 +2195,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)
goto send_middle; goto send_middle;
else if (opcode == OP(RDMA_WRITE_ONLY)) else if (opcode == OP(RDMA_WRITE_ONLY))
goto no_immediate_data; goto no_immediate_data;
ret = hfi1_get_rwqe(qp, 1); ret = hfi1_rvt_get_rwqe(qp, 1);
if (ret < 0) if (ret < 0)
goto nack_op_err; goto nack_op_err;
if (!ret) if (!ret)
......
...@@ -145,7 +145,7 @@ static int init_sge(struct rvt_qp *qp, struct rvt_rwqe *wqe) ...@@ -145,7 +145,7 @@ static int init_sge(struct rvt_qp *qp, struct rvt_rwqe *wqe)
} }
/** /**
* hfi1_get_rwqe - copy the next RWQE into the QP's RWQE * hfi1_rvt_get_rwqe - copy the next RWQE into the QP's RWQE
* @qp: the QP * @qp: the QP
* @wr_id_only: update qp->r_wr_id only, not qp->r_sge * @wr_id_only: update qp->r_wr_id only, not qp->r_sge
* *
...@@ -154,7 +154,7 @@ static int init_sge(struct rvt_qp *qp, struct rvt_rwqe *wqe) ...@@ -154,7 +154,7 @@ static int init_sge(struct rvt_qp *qp, struct rvt_rwqe *wqe)
* *
* Can be called from interrupt level. * Can be called from interrupt level.
*/ */
int hfi1_get_rwqe(struct rvt_qp *qp, int wr_id_only) int hfi1_rvt_get_rwqe(struct rvt_qp *qp, int wr_id_only)
{ {
unsigned long flags; unsigned long flags;
struct rvt_rq *rq; struct rvt_rq *rq;
...@@ -192,7 +192,7 @@ int hfi1_get_rwqe(struct rvt_qp *qp, int wr_id_only) ...@@ -192,7 +192,7 @@ int hfi1_get_rwqe(struct rvt_qp *qp, int wr_id_only)
} }
/* Make sure entry is read after head index is read. */ /* Make sure entry is read after head index is read. */
smp_rmb(); smp_rmb();
wqe = get_rwqe_ptr(rq, tail); wqe = rvt_get_rwqe_ptr(rq, tail);
/* /*
* Even though we update the tail index in memory, the verbs * Even though we update the tail index in memory, the verbs
* consumer is not supposed to post more entries until a * consumer is not supposed to post more entries until a
...@@ -377,7 +377,8 @@ static void ruc_loopback(struct rvt_qp *sqp) ...@@ -377,7 +377,8 @@ static void ruc_loopback(struct rvt_qp *sqp)
* Note that we check the responder QP state after * Note that we check the responder QP state after
* checking the requester's state. * checking the requester's state.
*/ */
qp = hfi1_lookup_qpn(ibp, sqp->remote_qpn); qp = rvt_lookup_qpn(ib_to_rvt(sqp->ibqp.device), &ibp->rvp,
sqp->remote_qpn);
spin_lock_irqsave(&sqp->s_lock, flags); spin_lock_irqsave(&sqp->s_lock, flags);
...@@ -441,7 +442,7 @@ static void ruc_loopback(struct rvt_qp *sqp) ...@@ -441,7 +442,7 @@ static void ruc_loopback(struct rvt_qp *sqp)
wc.ex.imm_data = wqe->wr.ex.imm_data; wc.ex.imm_data = wqe->wr.ex.imm_data;
/* FALLTHROUGH */ /* FALLTHROUGH */
case IB_WR_SEND: case IB_WR_SEND:
ret = hfi1_get_rwqe(qp, 0); ret = hfi1_rvt_get_rwqe(qp, 0);
if (ret < 0) if (ret < 0)
goto op_err; goto op_err;
if (!ret) if (!ret)
...@@ -453,7 +454,7 @@ static void ruc_loopback(struct rvt_qp *sqp) ...@@ -453,7 +454,7 @@ static void ruc_loopback(struct rvt_qp *sqp)
goto inv_err; goto inv_err;
wc.wc_flags = IB_WC_WITH_IMM; wc.wc_flags = IB_WC_WITH_IMM;
wc.ex.imm_data = wqe->wr.ex.imm_data; wc.ex.imm_data = wqe->wr.ex.imm_data;
ret = hfi1_get_rwqe(qp, 1); ret = hfi1_rvt_get_rwqe(qp, 1);
if (ret < 0) if (ret < 0)
goto op_err; goto op_err;
if (!ret) if (!ret)
...@@ -548,7 +549,7 @@ static void ruc_loopback(struct rvt_qp *sqp) ...@@ -548,7 +549,7 @@ static void ruc_loopback(struct rvt_qp *sqp)
sqp->s_len -= len; sqp->s_len -= len;
} }
if (release) if (release)
hfi1_put_ss(&qp->r_sge); rvt_put_ss(&qp->r_sge);
if (!test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags)) if (!test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags))
goto send_comp; goto send_comp;
...@@ -623,7 +624,7 @@ static void ruc_loopback(struct rvt_qp *sqp) ...@@ -623,7 +624,7 @@ static void ruc_loopback(struct rvt_qp *sqp)
spin_lock_irqsave(&sqp->s_lock, flags); spin_lock_irqsave(&sqp->s_lock, flags);
hfi1_send_complete(sqp, wqe, send_status); hfi1_send_complete(sqp, wqe, send_status);
if (sqp->ibqp.qp_type == IB_QPT_RC) { if (sqp->ibqp.qp_type == IB_QPT_RC) {
int lastwqe = hfi1_error_qp(sqp, IB_WC_WR_FLUSH_ERR); int lastwqe = rvt_error_qp(sqp, IB_WC_WR_FLUSH_ERR);
sqp->s_flags &= ~RVT_S_BUSY; sqp->s_flags &= ~RVT_S_BUSY;
spin_unlock_irqrestore(&sqp->s_lock, flags); spin_unlock_irqrestore(&sqp->s_lock, flags);
......
...@@ -93,7 +93,7 @@ int hfi1_post_srq_receive(struct ib_srq *ibsrq, struct ib_recv_wr *wr, ...@@ -93,7 +93,7 @@ int hfi1_post_srq_receive(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
goto bail; goto bail;
} }
wqe = get_rwqe_ptr(&srq->rq, wq->head); wqe = rvt_get_rwqe_ptr(&srq->rq, wq->head);
wqe->wr_id = wr->wr_id; wqe->wr_id = wr->wr_id;
wqe->num_sge = wr->num_sge; wqe->num_sge = wr->num_sge;
for (i = 0; i < wr->num_sge; i++) for (i = 0; i < wr->num_sge; i++)
...@@ -299,7 +299,7 @@ int hfi1_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr, ...@@ -299,7 +299,7 @@ int hfi1_modify_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr,
struct rvt_rwqe *wqe; struct rvt_rwqe *wqe;
int i; int i;
wqe = get_rwqe_ptr(&srq->rq, tail); wqe = rvt_get_rwqe_ptr(&srq->rq, tail);
p->wr_id = wqe->wr_id; p->wr_id = wqe->wr_id;
p->num_sge = wqe->num_sge; p->num_sge = wqe->num_sge;
for (i = 0; i < wqe->num_sge; i++) for (i = 0; i < wqe->num_sge; i++)
......
...@@ -166,7 +166,7 @@ const char *parse_everbs_hdrs( ...@@ -166,7 +166,7 @@ const char *parse_everbs_hdrs(
case OP(UD, SEND_ONLY_WITH_IMMEDIATE): case OP(UD, SEND_ONLY_WITH_IMMEDIATE):
trace_seq_printf(p, DETH_PRN, trace_seq_printf(p, DETH_PRN,
be32_to_cpu(eh->ud.deth[0]), be32_to_cpu(eh->ud.deth[0]),
be32_to_cpu(eh->ud.deth[1]) & HFI1_QPN_MASK); be32_to_cpu(eh->ud.deth[1]) & RVT_QPN_MASK);
break; break;
} }
trace_seq_putc(p, 0); trace_seq_putc(p, 0);
......
...@@ -363,37 +363,6 @@ DEFINE_EVENT(hfi1_qpsleepwakeup_template, hfi1_qpsleep, ...@@ -363,37 +363,6 @@ DEFINE_EVENT(hfi1_qpsleepwakeup_template, hfi1_qpsleep,
TP_PROTO(struct rvt_qp *qp, u32 flags), TP_PROTO(struct rvt_qp *qp, u32 flags),
TP_ARGS(qp, flags)); TP_ARGS(qp, flags));
#undef TRACE_SYSTEM
#define TRACE_SYSTEM hfi1_qphash
DECLARE_EVENT_CLASS(hfi1_qphash_template,
TP_PROTO(struct rvt_qp *qp, u32 bucket),
TP_ARGS(qp, bucket),
TP_STRUCT__entry(
DD_DEV_ENTRY(dd_from_ibdev(qp->ibqp.device))
__field(u32, qpn)
__field(u32, bucket)
),
TP_fast_assign(
DD_DEV_ASSIGN(dd_from_ibdev(qp->ibqp.device))
__entry->qpn = qp->ibqp.qp_num;
__entry->bucket = bucket;
),
TP_printk(
"[%s] qpn 0x%x bucket %u",
__get_str(dev),
__entry->qpn,
__entry->bucket
)
);
DEFINE_EVENT(hfi1_qphash_template, hfi1_qpinsert,
TP_PROTO(struct rvt_qp *qp, u32 bucket),
TP_ARGS(qp, bucket));
DEFINE_EVENT(hfi1_qphash_template, hfi1_qpremove,
TP_PROTO(struct rvt_qp *qp, u32 bucket),
TP_ARGS(qp, bucket));
#undef TRACE_SYSTEM #undef TRACE_SYSTEM
#define TRACE_SYSTEM hfi1_ibhdrs #define TRACE_SYSTEM hfi1_ibhdrs
...@@ -538,7 +507,7 @@ DECLARE_EVENT_CLASS(hfi1_ibhdr_template, ...@@ -538,7 +507,7 @@ DECLARE_EVENT_CLASS(hfi1_ibhdr_template,
(be32_to_cpu(ohdr->bth[1]) >> HFI1_BECN_SHIFT) (be32_to_cpu(ohdr->bth[1]) >> HFI1_BECN_SHIFT)
& HFI1_BECN_MASK; & HFI1_BECN_MASK;
__entry->qpn = __entry->qpn =
be32_to_cpu(ohdr->bth[1]) & HFI1_QPN_MASK; be32_to_cpu(ohdr->bth[1]) & RVT_QPN_MASK;
__entry->a = __entry->a =
(be32_to_cpu(ohdr->bth[2]) >> 31) & 1; (be32_to_cpu(ohdr->bth[2]) >> 31) & 1;
/* allow for larger PSN */ /* allow for larger PSN */
...@@ -627,7 +596,7 @@ TRACE_EVENT(snoop_capture, ...@@ -627,7 +596,7 @@ TRACE_EVENT(snoop_capture,
DD_DEV_ASSIGN(dd); DD_DEV_ASSIGN(dd);
__entry->slid = be16_to_cpu(hdr->lrh[3]); __entry->slid = be16_to_cpu(hdr->lrh[3]);
__entry->dlid = be16_to_cpu(hdr->lrh[1]); __entry->dlid = be16_to_cpu(hdr->lrh[1]);
__entry->qpn = be32_to_cpu(ohdr->bth[1]) & HFI1_QPN_MASK; __entry->qpn = be32_to_cpu(ohdr->bth[1]) & RVT_QPN_MASK;
__entry->opcode = (be32_to_cpu(ohdr->bth[0]) >> 24) & 0xff; __entry->opcode = (be32_to_cpu(ohdr->bth[0]) >> 24) & 0xff;
__entry->sl = (u8)(be16_to_cpu(hdr->lrh[0]) >> 4) & 0xf; __entry->sl = (u8)(be16_to_cpu(hdr->lrh[0]) >> 4) & 0xf;
__entry->pkey = be32_to_cpu(ohdr->bth[0]) & 0xffff; __entry->pkey = be32_to_cpu(ohdr->bth[0]) & 0xffff;
......
...@@ -292,7 +292,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet) ...@@ -292,7 +292,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)
u16 rlid = be16_to_cpu(hdr->lrh[3]); u16 rlid = be16_to_cpu(hdr->lrh[3]);
u8 sl, sc5; u8 sl, sc5;
lqpn = bth1 & HFI1_QPN_MASK; lqpn = bth1 & RVT_QPN_MASK;
rqpn = qp->remote_qpn; rqpn = qp->remote_qpn;
sc5 = ibp->sl_to_sc[qp->remote_ah_attr.sl]; sc5 = ibp->sl_to_sc[qp->remote_ah_attr.sl];
...@@ -335,7 +335,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet) ...@@ -335,7 +335,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)
set_bit(RVT_R_REWIND_SGE, &qp->r_aflags); set_bit(RVT_R_REWIND_SGE, &qp->r_aflags);
qp->r_sge.num_sge = 0; qp->r_sge.num_sge = 0;
} else } else
hfi1_put_ss(&qp->r_sge); rvt_put_ss(&qp->r_sge);
qp->r_state = OP(SEND_LAST); qp->r_state = OP(SEND_LAST);
switch (opcode) { switch (opcode) {
case OP(SEND_FIRST): case OP(SEND_FIRST):
...@@ -394,7 +394,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet) ...@@ -394,7 +394,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)
if (test_and_clear_bit(RVT_R_REWIND_SGE, &qp->r_aflags)) if (test_and_clear_bit(RVT_R_REWIND_SGE, &qp->r_aflags))
qp->r_sge = qp->s_rdma_read_sge; qp->r_sge = qp->s_rdma_read_sge;
else { else {
ret = hfi1_get_rwqe(qp, 0); ret = hfi1_rvt_get_rwqe(qp, 0);
if (ret < 0) if (ret < 0)
goto op_err; goto op_err;
if (!ret) if (!ret)
...@@ -444,7 +444,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet) ...@@ -444,7 +444,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)
goto rewind; goto rewind;
wc.opcode = IB_WC_RECV; wc.opcode = IB_WC_RECV;
hfi1_copy_sge(&qp->r_sge, data, tlen, 0); hfi1_copy_sge(&qp->r_sge, data, tlen, 0);
hfi1_put_ss(&qp->s_rdma_read_sge); rvt_put_ss(&qp->s_rdma_read_sge);
last_imm: last_imm:
wc.wr_id = qp->r_wr_id; wc.wr_id = qp->r_wr_id;
wc.status = IB_WC_SUCCESS; wc.status = IB_WC_SUCCESS;
...@@ -537,9 +537,9 @@ void hfi1_uc_rcv(struct hfi1_packet *packet) ...@@ -537,9 +537,9 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)
if (unlikely(tlen + qp->r_rcv_len != qp->r_len)) if (unlikely(tlen + qp->r_rcv_len != qp->r_len))
goto drop; goto drop;
if (test_and_clear_bit(RVT_R_REWIND_SGE, &qp->r_aflags)) if (test_and_clear_bit(RVT_R_REWIND_SGE, &qp->r_aflags))
hfi1_put_ss(&qp->s_rdma_read_sge); rvt_put_ss(&qp->s_rdma_read_sge);
else { else {
ret = hfi1_get_rwqe(qp, 1); ret = hfi1_rvt_get_rwqe(qp, 1);
if (ret < 0) if (ret < 0)
goto op_err; goto op_err;
if (!ret) if (!ret)
...@@ -548,7 +548,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet) ...@@ -548,7 +548,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)
wc.byte_len = qp->r_len; wc.byte_len = qp->r_len;
wc.opcode = IB_WC_RECV_RDMA_WITH_IMM; wc.opcode = IB_WC_RECV_RDMA_WITH_IMM;
hfi1_copy_sge(&qp->r_sge, data, tlen, 1); hfi1_copy_sge(&qp->r_sge, data, tlen, 1);
hfi1_put_ss(&qp->r_sge); rvt_put_ss(&qp->r_sge);
goto last_imm; goto last_imm;
case OP(RDMA_WRITE_LAST): case OP(RDMA_WRITE_LAST):
...@@ -564,7 +564,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet) ...@@ -564,7 +564,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)
if (unlikely(tlen + qp->r_rcv_len != qp->r_len)) if (unlikely(tlen + qp->r_rcv_len != qp->r_len))
goto drop; goto drop;
hfi1_copy_sge(&qp->r_sge, data, tlen, 1); hfi1_copy_sge(&qp->r_sge, data, tlen, 1);
hfi1_put_ss(&qp->r_sge); rvt_put_ss(&qp->r_sge);
break; break;
default: default:
......
...@@ -80,7 +80,8 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe) ...@@ -80,7 +80,8 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
rcu_read_lock(); rcu_read_lock();
qp = hfi1_lookup_qpn(ibp, swqe->ud_wr.remote_qpn); qp = rvt_lookup_qpn(ib_to_rvt(sqp->ibqp.device), &ibp->rvp,
swqe->ud_wr.remote_qpn);
if (!qp) { if (!qp) {
ibp->rvp.n_pkt_drops++; ibp->rvp.n_pkt_drops++;
rcu_read_unlock(); rcu_read_unlock();
...@@ -166,7 +167,7 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe) ...@@ -166,7 +167,7 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
else { else {
int ret; int ret;
ret = hfi1_get_rwqe(qp, 0); ret = hfi1_rvt_get_rwqe(qp, 0);
if (ret < 0) { if (ret < 0) {
hfi1_rc_error(qp, IB_WC_LOC_QP_OP_ERR); hfi1_rc_error(qp, IB_WC_LOC_QP_OP_ERR);
goto bail_unlock; goto bail_unlock;
...@@ -222,7 +223,7 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe) ...@@ -222,7 +223,7 @@ static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe)
} }
length -= len; length -= len;
} }
hfi1_put_ss(&qp->r_sge); rvt_put_ss(&qp->r_sge);
if (!test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags)) if (!test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags))
goto bail_unlock; goto bail_unlock;
wc.wr_id = qp->r_wr_id; wc.wr_id = qp->r_wr_id;
...@@ -664,7 +665,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) ...@@ -664,7 +665,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
struct ib_grh *grh = NULL; struct ib_grh *grh = NULL;
qkey = be32_to_cpu(ohdr->u.ud.deth[0]); qkey = be32_to_cpu(ohdr->u.ud.deth[0]);
src_qp = be32_to_cpu(ohdr->u.ud.deth[1]) & HFI1_QPN_MASK; src_qp = be32_to_cpu(ohdr->u.ud.deth[1]) & RVT_QPN_MASK;
dlid = be16_to_cpu(hdr->lrh[1]); dlid = be16_to_cpu(hdr->lrh[1]);
is_mcast = (dlid > be16_to_cpu(IB_MULTICAST_LID_BASE)) && is_mcast = (dlid > be16_to_cpu(IB_MULTICAST_LID_BASE)) &&
(dlid != be16_to_cpu(IB_LID_PERMISSIVE)); (dlid != be16_to_cpu(IB_LID_PERMISSIVE));
...@@ -675,7 +676,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) ...@@ -675,7 +676,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
* error path. * error path.
*/ */
struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
u32 lqpn = be32_to_cpu(ohdr->bth[1]) & HFI1_QPN_MASK; u32 lqpn = be32_to_cpu(ohdr->bth[1]) & RVT_QPN_MASK;
u8 sl, sc5; u8 sl, sc5;
sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf; sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf;
...@@ -817,7 +818,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) ...@@ -817,7 +818,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
else { else {
int ret; int ret;
ret = hfi1_get_rwqe(qp, 0); ret = hfi1_rvt_get_rwqe(qp, 0);
if (ret < 0) { if (ret < 0) {
hfi1_rc_error(qp, IB_WC_LOC_QP_OP_ERR); hfi1_rc_error(qp, IB_WC_LOC_QP_OP_ERR);
return; return;
...@@ -840,7 +841,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) ...@@ -840,7 +841,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
} else } else
hfi1_skip_sge(&qp->r_sge, sizeof(struct ib_grh), 1); hfi1_skip_sge(&qp->r_sge, sizeof(struct ib_grh), 1);
hfi1_copy_sge(&qp->r_sge, data, wc.byte_len - sizeof(struct ib_grh), 1); hfi1_copy_sge(&qp->r_sge, data, wc.byte_len - sizeof(struct ib_grh), 1);
hfi1_put_ss(&qp->r_sge); rvt_put_ss(&qp->r_sge);
if (!test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags)) if (!test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags))
return; return;
wc.wr_id = qp->r_wr_id; wc.wr_id = qp->r_wr_id;
......
...@@ -368,7 +368,7 @@ static int post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr, ...@@ -368,7 +368,7 @@ static int post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,
goto bail; goto bail;
} }
wqe = get_rwqe_ptr(&qp->r_rq, wq->head); wqe = rvt_get_rwqe_ptr(&qp->r_rq, wq->head);
wqe->wr_id = wr->wr_id; wqe->wr_id = wr->wr_id;
wqe->num_sge = wr->num_sge; wqe->num_sge = wr->num_sge;
for (i = 0; i < wr->num_sge; i++) for (i = 0; i < wr->num_sge; i++)
...@@ -418,6 +418,7 @@ void hfi1_ib_rcv(struct hfi1_packet *packet) ...@@ -418,6 +418,7 @@ void hfi1_ib_rcv(struct hfi1_packet *packet)
u32 tlen = packet->tlen; u32 tlen = packet->tlen;
struct hfi1_pportdata *ppd = rcd->ppd; struct hfi1_pportdata *ppd = rcd->ppd;
struct hfi1_ibport *ibp = &ppd->ibport_data; struct hfi1_ibport *ibp = &ppd->ibport_data;
struct rvt_dev_info *rdi = &ppd->dd->verbs_dev.rdi;
unsigned long flags; unsigned long flags;
u32 qp_num; u32 qp_num;
int lnh; int lnh;
...@@ -447,7 +448,7 @@ void hfi1_ib_rcv(struct hfi1_packet *packet) ...@@ -447,7 +448,7 @@ void hfi1_ib_rcv(struct hfi1_packet *packet)
inc_opstats(tlen, &rcd->opstats->stats[opcode]); inc_opstats(tlen, &rcd->opstats->stats[opcode]);
/* Get the destination QP number. */ /* Get the destination QP number. */
qp_num = be32_to_cpu(packet->ohdr->bth[1]) & HFI1_QPN_MASK; qp_num = be32_to_cpu(packet->ohdr->bth[1]) & RVT_QPN_MASK;
lid = be16_to_cpu(hdr->lrh[1]); lid = be16_to_cpu(hdr->lrh[1]);
if (unlikely((lid >= be16_to_cpu(IB_MULTICAST_LID_BASE)) && if (unlikely((lid >= be16_to_cpu(IB_MULTICAST_LID_BASE)) &&
(lid != be16_to_cpu(IB_LID_PERMISSIVE)))) { (lid != be16_to_cpu(IB_LID_PERMISSIVE)))) {
...@@ -474,7 +475,7 @@ void hfi1_ib_rcv(struct hfi1_packet *packet) ...@@ -474,7 +475,7 @@ void hfi1_ib_rcv(struct hfi1_packet *packet)
wake_up(&mcast->wait); wake_up(&mcast->wait);
} else { } else {
rcu_read_lock(); rcu_read_lock();
packet->qp = hfi1_lookup_qpn(ibp, qp_num); packet->qp = rvt_lookup_qpn(rdi, &ibp->rvp, qp_num);
if (!packet->qp) { if (!packet->qp) {
rcu_read_unlock(); rcu_read_unlock();
goto drop; goto drop;
...@@ -1534,7 +1535,6 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) ...@@ -1534,7 +1535,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_qps_lock);
spin_lock_init(&dev->n_srqs_lock); spin_lock_init(&dev->n_srqs_lock);
init_timer(&dev->mem_timer); init_timer(&dev->mem_timer);
dev->mem_timer.function = mem_timer; dev->mem_timer.function = mem_timer;
...@@ -1623,7 +1623,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) ...@@ -1623,7 +1623,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
ibdev->query_srq = hfi1_query_srq; ibdev->query_srq = hfi1_query_srq;
ibdev->destroy_srq = hfi1_destroy_srq; ibdev->destroy_srq = hfi1_destroy_srq;
ibdev->create_qp = NULL; ibdev->create_qp = NULL;
ibdev->modify_qp = hfi1_modify_qp; ibdev->modify_qp = NULL;
ibdev->query_qp = hfi1_query_qp; ibdev->query_qp = hfi1_query_qp;
ibdev->destroy_qp = hfi1_destroy_qp; ibdev->destroy_qp = hfi1_destroy_qp;
ibdev->post_send = NULL; ibdev->post_send = NULL;
...@@ -1674,12 +1674,26 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) ...@@ -1674,12 +1674,26 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
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.dparms.max_rdma_atomic = HFI1_MAX_RDMA_ATOMIC;
dd->verbs_dev.rdi.dparms.psn_mask = PSN_MASK;
dd->verbs_dev.rdi.dparms.psn_shift = PSN_SHIFT;
dd->verbs_dev.rdi.dparms.psn_modify_mask = PSN_MODIFY_MASK;
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;
dd->verbs_dev.rdi.driver_f.do_send = hfi1_do_send; dd->verbs_dev.rdi.driver_f.do_send = hfi1_do_send;
dd->verbs_dev.rdi.driver_f.schedule_send = hfi1_schedule_send; dd->verbs_dev.rdi.driver_f.schedule_send = hfi1_schedule_send;
dd->verbs_dev.rdi.driver_f.get_pmtu_from_attr = get_pmtu_from_attr;
dd->verbs_dev.rdi.driver_f.notify_error_qp = notify_error_qp;
dd->verbs_dev.rdi.driver_f.flush_qp_waiters = flush_qp_waiters;
dd->verbs_dev.rdi.driver_f.stop_send_queue = stop_send_queue;
dd->verbs_dev.rdi.driver_f.quiesce_qp = quiesce_qp;
dd->verbs_dev.rdi.driver_f.notify_error_qp = notify_error_qp;
dd->verbs_dev.rdi.driver_f.mtu_from_qp = mtu_from_qp;
dd->verbs_dev.rdi.driver_f.mtu_to_path_mtu = mtu_to_path_mtu;
dd->verbs_dev.rdi.driver_f.check_modify_qp = hfi1_check_modify_qp;
dd->verbs_dev.rdi.driver_f.modify_qp = hfi1_modify_qp;
/* completeion queue */ /* completeion queue */
snprintf(dd->verbs_dev.rdi.dparms.cq_name, snprintf(dd->verbs_dev.rdi.dparms.cq_name,
......
...@@ -225,18 +225,6 @@ struct hfi1_pkt_state { ...@@ -225,18 +225,6 @@ struct hfi1_pkt_state {
#define HFI1_PSN_CREDIT 16 #define HFI1_PSN_CREDIT 16
/*
* Since struct rvt_rwqe is not a fixed size, we can't simply index into
* struct rvt_rwq.wq. This function does the array index computation.
*/
static inline struct rvt_rwqe *get_rwqe_ptr(struct rvt_rq *rq, unsigned n)
{
return (struct rvt_rwqe *)
((char *) rq->wq->wq +
(sizeof(struct rvt_rwqe) +
rq->max_sge * sizeof(struct ib_sge)) * n);
}
struct hfi1_opcode_stats { struct hfi1_opcode_stats {
u64 n_packets; /* number of packets */ u64 n_packets; /* number of packets */
u64 n_bytes; /* total number of bytes */ u64 n_bytes; /* total number of bytes */
...@@ -286,8 +274,6 @@ struct hfi1_ibdev { ...@@ -286,8 +274,6 @@ struct hfi1_ibdev {
u64 n_kmem_wait; u64 n_kmem_wait;
u64 n_send_schedule; u64 n_send_schedule;
u32 n_qps_allocated; /* number of QPs allocated for device */
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 */
spinlock_t n_srqs_lock; spinlock_t n_srqs_lock;
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
...@@ -464,19 +450,16 @@ int hfi1_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr); ...@@ -464,19 +450,16 @@ 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);
static inline void hfi1_put_ss(struct rvt_sge_state *ss) int hfi1_rvt_get_rwqe(struct rvt_qp *qp, int wr_id_only);
{
while (ss->num_sge) {
rvt_put_mr(ss->sge.mr);
if (--ss->num_sge)
ss->sge = *ss->sg_list++;
}
}
int hfi1_get_rwqe(struct rvt_qp *qp, int wr_id_only);
void hfi1_migrate_qp(struct rvt_qp *qp); void hfi1_migrate_qp(struct rvt_qp *qp);
int hfi1_check_modify_qp(struct rvt_qp *qp, struct ib_qp_attr *attr,
int attr_mask, struct ib_udata *udata);
void hfi1_modify_qp(struct rvt_qp *qp, struct ib_qp_attr *attr,
int attr_mask, struct ib_udata *udata);
int hfi1_ruc_check_hdr(struct hfi1_ibport *ibp, struct hfi1_ib_header *hdr, int hfi1_ruc_check_hdr(struct hfi1_ibport *ibp, struct hfi1_ib_header *hdr,
int has_grh, struct rvt_qp *qp, u32 bth0); int has_grh, struct rvt_qp *qp, u32 bth0);
......
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