Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9134
b: refs/heads/master
c: ff171d8
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Sep 20, 2005
1 parent c9002f4 commit f47bd6f
Show file tree
Hide file tree
Showing 65 changed files with 1,765 additions and 4,395 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 76abf3e71c5a4d315ec95e23e5aedd15fbfcd6df
refs/heads/master: ff171d8f66a7fe1a000e610e9de11224749f9a22
2 changes: 1 addition & 1 deletion trunk/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 14
EXTRAVERSION =-rc2
EXTRAVERSION =-rc1
NAME=Affluent Albatross

# *DOCUMENTATION*
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc64/kernel/una_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kernel_unaligned_trap_fault:
__do_int_store:
rd %asi, %o4
wr %o3, 0, %asi
ldx [%o2], %g3
mov %o2, %g3
cmp %o1, 2
be,pn %icc, 2f
cmp %o1, 4
Expand Down
64 changes: 57 additions & 7 deletions trunk/arch/sparc64/kernel/unaligned.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,40 @@ extern void do_int_load(unsigned long *dest_reg, int size,
unsigned long *saddr, int is_signed, int asi);

extern void __do_int_store(unsigned long *dst_addr, int size,
unsigned long *src_val, int asi);
unsigned long src_val, int asi);

static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr,
struct pt_regs *regs, int asi)
struct pt_regs *regs, int asi, int orig_asi)
{
unsigned long zero = 0;
unsigned long *src_val = &zero;
unsigned long *src_val_p = &zero;
unsigned long src_val;

if (size == 16) {
size = 8;
zero = (((long)(reg_num ?
(unsigned)fetch_reg(reg_num, regs) : 0)) << 32) |
(unsigned)fetch_reg(reg_num + 1, regs);
} else if (reg_num) {
src_val = fetch_reg_addr(reg_num, regs);
src_val_p = fetch_reg_addr(reg_num, regs);
}
src_val = *src_val_p;
if (unlikely(asi != orig_asi)) {
switch (size) {
case 2:
src_val = swab16(src_val);
break;
case 4:
src_val = swab32(src_val);
break;
case 8:
src_val = swab64(src_val);
break;
case 16:
default:
BUG();
break;
};
}
__do_int_store(dst_addr, size, src_val, asi);
}
Expand Down Expand Up @@ -276,6 +295,7 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u
kernel_mna_trap_fault();
} else {
unsigned long addr;
int orig_asi, asi;

addr = compute_effective_address(regs, insn,
((insn >> 25) & 0x1f));
Expand All @@ -285,18 +305,48 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u
regs->tpc, dirstrings[dir], addr, size,
regs->u_regs[UREG_RETPC]);
#endif
orig_asi = asi = decode_asi(insn, regs);
switch (asi) {
case ASI_NL:
case ASI_AIUPL:
case ASI_AIUSL:
case ASI_PL:
case ASI_SL:
case ASI_PNFL:
case ASI_SNFL:
asi &= ~0x08;
break;
};
switch (dir) {
case load:
do_int_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
size, (unsigned long *) addr,
decode_signedness(insn),
decode_asi(insn, regs));
decode_signedness(insn), asi);
if (unlikely(asi != orig_asi)) {
unsigned long val_in = *(unsigned long *) addr;
switch (size) {
case 2:
val_in = swab16(val_in);
break;
case 4:
val_in = swab32(val_in);
break;
case 8:
val_in = swab64(val_in);
break;
case 16:
default:
BUG();
break;
};
*(unsigned long *) addr = val_in;
}
break;

case store:
do_int_store(((insn>>25)&0x1f), size,
(unsigned long *) addr, regs,
decode_asi(insn, regs));
asi, orig_asi);
break;

default:
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/infiniband/core/user_mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,10 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf,
ret = -EINVAL;
goto err_ah;
}

/* Validate that the management class can support RMPP */
/* Validate that management class can support RMPP */
if (rmpp_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_ADM) {
hdr_len = offsetof(struct ib_sa_mad, data);
data_len = length - hdr_len;
data_len = length;
} else if ((rmpp_mad->mad_hdr.mgmt_class >= IB_MGMT_CLASS_VENDOR_RANGE2_START) &&
(rmpp_mad->mad_hdr.mgmt_class <= IB_MGMT_CLASS_VENDOR_RANGE2_END)) {
hdr_len = offsetof(struct ib_vendor_mad, data);
Expand Down
16 changes: 11 additions & 5 deletions trunk/drivers/infiniband/hw/mthca/mthca_eq.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,12 @@ static int __devinit mthca_create_eq(struct mthca_dev *dev,
int i;
u8 status;

eq->dev = dev;
eq->nent = roundup_pow_of_two(max(nent, 2));
/* Make sure EQ size is aligned to a power of 2 size. */
for (i = 1; i < nent; i <<= 1)
; /* nothing */
nent = i;

eq->dev = dev;

eq->page_list = kmalloc(npages * sizeof *eq->page_list,
GFP_KERNEL);
Expand Down Expand Up @@ -508,7 +512,7 @@ static int __devinit mthca_create_eq(struct mthca_dev *dev,
memset(eq->page_list[i].buf, 0, PAGE_SIZE);
}

for (i = 0; i < eq->nent; ++i)
for (i = 0; i < nent; ++i)
set_eqe_hw(get_eqe(eq, i));

eq->eqn = mthca_alloc(&dev->eq_table.alloc);
Expand All @@ -524,6 +528,8 @@ static int __devinit mthca_create_eq(struct mthca_dev *dev,
if (err)
goto err_out_free_eq;

eq->nent = nent;

memset(eq_context, 0, sizeof *eq_context);
eq_context->flags = cpu_to_be32(MTHCA_EQ_STATUS_OK |
MTHCA_EQ_OWNER_HW |
Expand All @@ -532,7 +538,7 @@ static int __devinit mthca_create_eq(struct mthca_dev *dev,
if (mthca_is_memfree(dev))
eq_context->flags |= cpu_to_be32(MTHCA_EQ_STATE_ARBEL);

eq_context->logsize_usrpage = cpu_to_be32((ffs(eq->nent) - 1) << 24);
eq_context->logsize_usrpage = cpu_to_be32((ffs(nent) - 1) << 24);
if (mthca_is_memfree(dev)) {
eq_context->arbel_pd = cpu_to_be32(dev->driver_pd.pd_num);
} else {
Expand Down Expand Up @@ -563,7 +569,7 @@ static int __devinit mthca_create_eq(struct mthca_dev *dev,
dev->eq_table.arm_mask |= eq->eqn_mask;

mthca_dbg(dev, "Allocated EQ %d with %d entries\n",
eq->eqn, eq->nent);
eq->eqn, nent);

return err;

Expand Down
51 changes: 27 additions & 24 deletions trunk/drivers/infiniband/hw/mthca/mthca_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ static void mthca_wq_init(struct mthca_wq *wq)
wq->last_comp = wq->max - 1;
wq->head = 0;
wq->tail = 0;
wq->last = NULL;
}

void mthca_qp_event(struct mthca_dev *dev, u32 qpn,
Expand Down Expand Up @@ -686,7 +687,7 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
}

if (attr_mask & IB_QP_TIMEOUT) {
qp_context->pri_path.ackto = attr->timeout << 3;
qp_context->pri_path.ackto = attr->timeout;
qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_ACK_TIMEOUT);
}

Expand Down Expand Up @@ -1102,9 +1103,6 @@ static int mthca_alloc_qp_common(struct mthca_dev *dev,
}
}

qp->sq.last = get_send_wqe(qp, qp->sq.max - 1);
qp->rq.last = get_recv_wqe(qp, qp->rq.max - 1);

return 0;
}

Expand Down Expand Up @@ -1585,13 +1583,15 @@ int mthca_tavor_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
goto out;
}

((struct mthca_next_seg *) prev_wqe)->nda_op =
cpu_to_be32(((ind << qp->sq.wqe_shift) +
qp->send_wqe_offset) |
mthca_opcode[wr->opcode]);
wmb();
((struct mthca_next_seg *) prev_wqe)->ee_nds =
cpu_to_be32((size0 ? 0 : MTHCA_NEXT_DBD) | size);
if (prev_wqe) {
((struct mthca_next_seg *) prev_wqe)->nda_op =
cpu_to_be32(((ind << qp->sq.wqe_shift) +
qp->send_wqe_offset) |
mthca_opcode[wr->opcode]);
wmb();
((struct mthca_next_seg *) prev_wqe)->ee_nds =
cpu_to_be32((size0 ? 0 : MTHCA_NEXT_DBD) | size);
}

if (!size0) {
size0 = size;
Expand Down Expand Up @@ -1688,11 +1688,13 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr,

qp->wrid[ind] = wr->wr_id;

((struct mthca_next_seg *) prev_wqe)->nda_op =
cpu_to_be32((ind << qp->rq.wqe_shift) | 1);
wmb();
((struct mthca_next_seg *) prev_wqe)->ee_nds =
cpu_to_be32(MTHCA_NEXT_DBD | size);
if (likely(prev_wqe)) {
((struct mthca_next_seg *) prev_wqe)->nda_op =
cpu_to_be32((ind << qp->rq.wqe_shift) | 1);
wmb();
((struct mthca_next_seg *) prev_wqe)->ee_nds =
cpu_to_be32(MTHCA_NEXT_DBD | size);
}

if (!size0)
size0 = size;
Expand Down Expand Up @@ -1903,13 +1905,15 @@ int mthca_arbel_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
goto out;
}

((struct mthca_next_seg *) prev_wqe)->nda_op =
cpu_to_be32(((ind << qp->sq.wqe_shift) +
qp->send_wqe_offset) |
mthca_opcode[wr->opcode]);
wmb();
((struct mthca_next_seg *) prev_wqe)->ee_nds =
cpu_to_be32(MTHCA_NEXT_DBD | size);
if (likely(prev_wqe)) {
((struct mthca_next_seg *) prev_wqe)->nda_op =
cpu_to_be32(((ind << qp->sq.wqe_shift) +
qp->send_wqe_offset) |
mthca_opcode[wr->opcode]);
wmb();
((struct mthca_next_seg *) prev_wqe)->ee_nds =
cpu_to_be32(MTHCA_NEXT_DBD | size);
}

if (!size0) {
size0 = size;
Expand Down Expand Up @@ -2123,6 +2127,5 @@ void __devexit mthca_cleanup_qp_table(struct mthca_dev *dev)
for (i = 0; i < 2; ++i)
mthca_CONF_SPECIAL_QP(dev, i, 0, &status);

mthca_array_cleanup(&dev->qp_table.qp, dev->limits.num_qps);
mthca_alloc_cleanup(&dev->qp_table.alloc);
}
25 changes: 14 additions & 11 deletions trunk/drivers/infiniband/hw/mthca/mthca_srq.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ static int mthca_alloc_srq_buf(struct mthca_dev *dev, struct mthca_pd *pd,
scatter->lkey = cpu_to_be32(MTHCA_INVAL_LKEY);
}

srq->last = get_wqe(srq, srq->max - 1);

return 0;
}

Expand All @@ -191,6 +189,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd,

srq->max = attr->max_wr;
srq->max_gs = attr->max_sge;
srq->last = NULL;
srq->counter = 0;

if (mthca_is_memfree(dev))
Expand Down Expand Up @@ -410,7 +409,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
mthca_err(dev, "SRQ %06x full\n", srq->srqn);
err = -ENOMEM;
*bad_wr = wr;
break;
return nreq;
}

wqe = get_wqe(srq, ind);
Expand All @@ -428,7 +427,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
err = -EINVAL;
*bad_wr = wr;
srq->last = prev_wqe;
break;
return nreq;
}

for (i = 0; i < wr->num_sge; ++i) {
Expand All @@ -447,16 +446,20 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
((struct mthca_data_seg *) wqe)->addr = 0;
}

((struct mthca_next_seg *) prev_wqe)->nda_op =
cpu_to_be32((ind << srq->wqe_shift) | 1);
wmb();
((struct mthca_next_seg *) prev_wqe)->ee_nds =
cpu_to_be32(MTHCA_NEXT_DBD);
if (likely(prev_wqe)) {
((struct mthca_next_seg *) prev_wqe)->nda_op =
cpu_to_be32((ind << srq->wqe_shift) | 1);
wmb();
((struct mthca_next_seg *) prev_wqe)->ee_nds =
cpu_to_be32(MTHCA_NEXT_DBD);
}

srq->wrid[ind] = wr->wr_id;
srq->first_free = next_ind;
}

return nreq;

if (likely(nreq)) {
__be32 doorbell[2];

Expand Down Expand Up @@ -500,7 +503,7 @@ int mthca_arbel_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
mthca_err(dev, "SRQ %06x full\n", srq->srqn);
err = -ENOMEM;
*bad_wr = wr;
break;
return nreq;
}

wqe = get_wqe(srq, ind);
Expand All @@ -516,7 +519,7 @@ int mthca_arbel_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr,
if (unlikely(wr->num_sge > srq->max_gs)) {
err = -EINVAL;
*bad_wr = wr;
break;
return nreq;
}

for (i = 0; i < wr->num_sge; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/ulp/ipoib/ipoib.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void ipoib_mcast_send(struct net_device *dev, union ib_gid *mgid,

void ipoib_mcast_restart_task(void *dev_ptr);
int ipoib_mcast_start_thread(struct net_device *dev);
int ipoib_mcast_stop_thread(struct net_device *dev, int flush);
int ipoib_mcast_stop_thread(struct net_device *dev);

void ipoib_mcast_dev_down(struct net_device *dev);
void ipoib_mcast_dev_flush(struct net_device *dev);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ int ipoib_ib_dev_down(struct net_device *dev)
flush_workqueue(ipoib_workqueue);
}

ipoib_mcast_stop_thread(dev, 1);
ipoib_mcast_stop_thread(dev);

/*
* Flush the multicast groups first so we stop any multicast joins. The
Expand Down Expand Up @@ -599,7 +599,7 @@ void ipoib_ib_dev_cleanup(struct net_device *dev)

ipoib_dbg(priv, "cleaning up ib_dev\n");

ipoib_mcast_stop_thread(dev, 1);
ipoib_mcast_stop_thread(dev);

/* Delete the broadcast address and the local address */
ipoib_mcast_dev_down(dev);
Expand Down
Loading

0 comments on commit f47bd6f

Please sign in to comment.