Skip to content

Commit

Permalink
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/roland/infiniband

* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband:
  IB/mthca: make a function static
  IB/ipath: Fix whitespace
  IB/ipath: Make more names static
  IB/mad: Fix RMPP version check during agent registration
  IB/srp: Remove request from list when SCSI abort succeeds
  • Loading branch information
Linus Torvalds committed Apr 19, 2006
2 parents 949b211 + 415dcd9 commit 52824b6
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 162 deletions.
5 changes: 1 addition & 4 deletions drivers/infiniband/core/mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
goto error1;
}
/* Make sure class supplied is consistent with RMPP */
if (ib_is_mad_class_rmpp(mad_reg_req->mgmt_class)) {
if (!rmpp_version)
goto error1;
} else {
if (!ib_is_mad_class_rmpp(mad_reg_req->mgmt_class)) {
if (rmpp_version)
goto error1;
}
Expand Down
12 changes: 0 additions & 12 deletions drivers/infiniband/hw/ipath/ipath_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,3 @@ static ssize_t ipath_diag_write(struct file *fp, const char __user *data,
bail:
return ret;
}

void ipath_diag_bringup_link(struct ipath_devdata *dd)
{
if (diag_set_link || (dd->ipath_flags & IPATH_LINKACTIVE))
return;

diag_set_link = 1;
ipath_cdbg(VERBOSE, "Trying to set to set link active for "
"diag pkt\n");
ipath_layer_set_linkstate(dd, IPATH_IB_LINKARM);
ipath_layer_set_linkstate(dd, IPATH_IB_LINKACTIVE);
}
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/ipath/ipath_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ void ipath_free_pddata(struct ipath_devdata *dd, u32 port, int freehdrq)
}
}

int __init infinipath_init(void)
static int __init infinipath_init(void)
{
int ret;

Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/ipath/ipath_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ static void handle_e_ibstatuschanged(struct ipath_devdata *dd,
"was %s\n", dd->ipath_unit,
ib_linkstate(lstate),
ib_linkstate((unsigned)
dd->ipath_lastibcstat
& IPATH_IBSTATE_MASK));
dd->ipath_lastibcstat
& IPATH_IBSTATE_MASK));
}
else {
lstate = dd->ipath_lastibcstat & IPATH_IBSTATE_MASK;
Expand Down
1 change: 0 additions & 1 deletion drivers/infiniband/hw/ipath/ipath_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ extern spinlock_t ipath_devs_lock;
extern struct ipath_devdata *ipath_lookup(int unit);

extern u16 ipath_layer_rcv_opcode;
extern int ipath_verbs_registered;
extern int __ipath_layer_intr(struct ipath_devdata *, u32);
extern int ipath_layer_intr(struct ipath_devdata *, u32);
extern int __ipath_layer_rcv(struct ipath_devdata *, void *,
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/ipath/ipath_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static int (*layer_rcv)(void *, void *, struct sk_buff *);
static int (*layer_rcv_lid)(void *, void *);
static int (*verbs_piobufavail)(void *);
static void (*verbs_rcv)(void *, void *, void *, u32);
int ipath_verbs_registered;
static int ipath_verbs_registered;

static void *(*layer_add_one)(int, struct ipath_devdata *);
static void (*layer_remove_one)(void *);
Expand Down
10 changes: 5 additions & 5 deletions drivers/infiniband/hw/ipath/ipath_pe800.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ static const struct ipath_cregs ipath_pe_cregs = {
* we'll print them and continue. We reuse the same message buffer as
* ipath_handle_errors() to avoid excessive stack usage.
*/
void ipath_pe_handle_hwerrors(struct ipath_devdata *dd, char *msg,
size_t msgl)
static void ipath_pe_handle_hwerrors(struct ipath_devdata *dd, char *msg,
size_t msgl)
{
ipath_err_t hwerrs;
u32 bits, ctrl;
Expand Down Expand Up @@ -552,7 +552,7 @@ static int ipath_pe_boardname(struct ipath_devdata *dd, char *name,
* freeze mode), and enable hardware errors as errors (along with
* everything else) in errormask
*/
void ipath_pe_init_hwerrors(struct ipath_devdata *dd)
static void ipath_pe_init_hwerrors(struct ipath_devdata *dd)
{
ipath_err_t val;
u64 extsval;
Expand All @@ -577,7 +577,7 @@ void ipath_pe_init_hwerrors(struct ipath_devdata *dd)
* ipath_pe_bringup_serdes - bring up the serdes
* @dd: the infinipath device
*/
int ipath_pe_bringup_serdes(struct ipath_devdata *dd)
static int ipath_pe_bringup_serdes(struct ipath_devdata *dd)
{
u64 val, tmp, config1;
int ret = 0, change = 0;
Expand Down Expand Up @@ -694,7 +694,7 @@ int ipath_pe_bringup_serdes(struct ipath_devdata *dd)
* @dd: the infinipath device
* Called when driver is being unloaded
*/
void ipath_pe_quiet_serdes(struct ipath_devdata *dd)
static void ipath_pe_quiet_serdes(struct ipath_devdata *dd)
{
u64 val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_serdesconfig0);

Expand Down
124 changes: 62 additions & 62 deletions drivers/infiniband/hw/ipath/ipath_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ static void free_qpn(struct ipath_qp_table *qpt, u32 qpn)
* Allocate the next available QPN and put the QP into the hash table.
* The hash table holds a reference to the QP.
*/
int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp,
enum ib_qp_type type)
static int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp,
enum ib_qp_type type)
{
unsigned long flags;
u32 qpn;
Expand Down Expand Up @@ -232,7 +232,7 @@ int ipath_alloc_qpn(struct ipath_qp_table *qpt, struct ipath_qp *qp,
* Remove the QP from the table so it can't be found asynchronously by
* the receive interrupt routine.
*/
void ipath_free_qp(struct ipath_qp_table *qpt, struct ipath_qp *qp)
static void ipath_free_qp(struct ipath_qp_table *qpt, struct ipath_qp *qp)
{
struct ipath_qp *q, **qpp;
unsigned long flags;
Expand Down Expand Up @@ -357,6 +357,65 @@ static void ipath_reset_qp(struct ipath_qp *qp)
qp->r_reuse_sge = 0;
}

/**
* ipath_error_qp - put a QP into an error state
* @qp: the QP to put into an error state
*
* Flushes both send and receive work queues.
* QP r_rq.lock and s_lock should be held.
*/

static void ipath_error_qp(struct ipath_qp *qp)
{
struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
struct ib_wc wc;

_VERBS_INFO("QP%d/%d in error state\n",
qp->ibqp.qp_num, qp->remote_qpn);

spin_lock(&dev->pending_lock);
/* XXX What if its already removed by the timeout code? */
if (qp->timerwait.next != LIST_POISON1)
list_del(&qp->timerwait);
if (qp->piowait.next != LIST_POISON1)
list_del(&qp->piowait);
spin_unlock(&dev->pending_lock);

wc.status = IB_WC_WR_FLUSH_ERR;
wc.vendor_err = 0;
wc.byte_len = 0;
wc.imm_data = 0;
wc.qp_num = qp->ibqp.qp_num;
wc.src_qp = 0;
wc.wc_flags = 0;
wc.pkey_index = 0;
wc.slid = 0;
wc.sl = 0;
wc.dlid_path_bits = 0;
wc.port_num = 0;

while (qp->s_last != qp->s_head) {
struct ipath_swqe *wqe = get_swqe_ptr(qp, qp->s_last);

wc.wr_id = wqe->wr.wr_id;
wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode];
if (++qp->s_last >= qp->s_size)
qp->s_last = 0;
ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 1);
}
qp->s_cur = qp->s_tail = qp->s_head;
qp->s_hdrwords = 0;
qp->s_ack_state = IB_OPCODE_RC_ACKNOWLEDGE;

wc.opcode = IB_WC_RECV;
while (qp->r_rq.tail != qp->r_rq.head) {
wc.wr_id = get_rwqe_ptr(&qp->r_rq, qp->r_rq.tail)->wr_id;
if (++qp->r_rq.tail >= qp->r_rq.size)
qp->r_rq.tail = 0;
ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1);
}
}

/**
* ipath_modify_qp - modify the attributes of a queue pair
* @ibqp: the queue pair who's attributes we're modifying
Expand Down Expand Up @@ -820,65 +879,6 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc)
qp->state = IB_QPS_SQE;
}

/**
* ipath_error_qp - put a QP into an error state
* @qp: the QP to put into an error state
*
* Flushes both send and receive work queues.
* QP r_rq.lock and s_lock should be held.
*/

void ipath_error_qp(struct ipath_qp *qp)
{
struct ipath_ibdev *dev = to_idev(qp->ibqp.device);
struct ib_wc wc;

_VERBS_INFO("QP%d/%d in error state\n",
qp->ibqp.qp_num, qp->remote_qpn);

spin_lock(&dev->pending_lock);
/* XXX What if its already removed by the timeout code? */
if (qp->timerwait.next != LIST_POISON1)
list_del(&qp->timerwait);
if (qp->piowait.next != LIST_POISON1)
list_del(&qp->piowait);
spin_unlock(&dev->pending_lock);

wc.status = IB_WC_WR_FLUSH_ERR;
wc.vendor_err = 0;
wc.byte_len = 0;
wc.imm_data = 0;
wc.qp_num = qp->ibqp.qp_num;
wc.src_qp = 0;
wc.wc_flags = 0;
wc.pkey_index = 0;
wc.slid = 0;
wc.sl = 0;
wc.dlid_path_bits = 0;
wc.port_num = 0;

while (qp->s_last != qp->s_head) {
struct ipath_swqe *wqe = get_swqe_ptr(qp, qp->s_last);

wc.wr_id = wqe->wr.wr_id;
wc.opcode = ib_ipath_wc_opcode[wqe->wr.opcode];
if (++qp->s_last >= qp->s_size)
qp->s_last = 0;
ipath_cq_enter(to_icq(qp->ibqp.send_cq), &wc, 1);
}
qp->s_cur = qp->s_tail = qp->s_head;
qp->s_hdrwords = 0;
qp->s_ack_state = IB_OPCODE_RC_ACKNOWLEDGE;

wc.opcode = IB_WC_RECV;
while (qp->r_rq.tail != qp->r_rq.head) {
wc.wr_id = get_rwqe_ptr(&qp->r_rq, qp->r_rq.tail)->wr_id;
if (++qp->r_rq.tail >= qp->r_rq.size)
qp->r_rq.tail = 0;
ipath_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 1);
}
}

/**
* ipath_get_credit - flush the send work queue of a QP
* @qp: the qp who's send work queue to flush
Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/ipath/ipath_ud.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
* This is called from ipath_post_ud_send() to forward a WQE addressed
* to the same HCA.
*/
void ipath_ud_loopback(struct ipath_qp *sqp, struct ipath_sge_state *ss,
u32 length, struct ib_send_wr *wr, struct ib_wc *wc)
static void ipath_ud_loopback(struct ipath_qp *sqp, struct ipath_sge_state *ss,
u32 length, struct ib_send_wr *wr, struct ib_wc *wc)
{
struct ipath_ibdev *dev = to_idev(sqp->ibqp.device);
struct ipath_qp *qp;
Expand Down
Loading

0 comments on commit 52824b6

Please sign in to comment.