#ifdef SUPPORT_SPINLOCK_ISR
static inline void
-spin_lock_isr_setint(
+spin_lock_setint(
IN spinlock_t* const l,
IN PKINTERRUPT p_int_obj )
{
l->p_int_obj = p_int_obj;
}
-static inline void spin_lock_isr_init(
+static inline void spin_lock_irq_init(
IN spinlock_t* const l,
IN PKINTERRUPT int_obj
)
}
static inline unsigned long
-spin_lock_isr(
+spin_lock_irq(
IN spinlock_t* const l)
{
MT_ASSERT( l );
}
static inline void
-spin_unlock_isr(
+spin_unlock_irq(
IN spinlock_t* const p_spinlock )
{
MT_ASSERT( p_spinlock );
break;
case MTHCA_OPCODE_ATOMIC_CS:
entry->wc_type = IB_WC_COMPARE_SWAP;
- entry->length = cl_ntoh32(cqe->byte_cnt);
+ entry->length = MTHCA_BYTES_PER_ATOMIC_COMPL;
break;
case MTHCA_OPCODE_ATOMIC_FA:
entry->wc_type = IB_WC_FETCH_ADD;
- entry->length = cl_ntoh32(cqe->byte_cnt);
+ entry->length = MTHCA_BYTES_PER_ATOMIC_COMPL;
break;
case MTHCA_OPCODE_BIND_MW:
entry->wc_type = IB_WC_MW_BIND;
MTHCA_NUM_EQ
};
+enum {
+ MTHCA_BYTES_PER_ATOMIC_COMPL = 8
+};
+
enum mthca_wr_opcode{
MTHCA_OPCODE_NOP = 0x00,
MTHCA_OPCODE_RDMA_WRITE = 0x08,
if (mdev->mthca_flags & MTHCA_FLAG_SRQ)
profile.num_srq = dev_lim.max_srqs;
+ RtlZeroMemory( &init_hca, sizeof(init_hca));
icm_size = mthca_make_profile(mdev, &profile, &dev_lim, &init_hca);
if ((int) icm_size < 0) {
err = (int)icm_size;
qp->rq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_RQ,
qp->qpn, &qp->rq.db);
if (qp->rq.db_index < 0)
- return ret;
+ return qp->rq.db_index;
qp->sq.db_index = mthca_alloc_db(dev, MTHCA_DB_TYPE_SQ,
qp->qpn, &qp->sq.db);
- if (qp->sq.db_index < 0)
+ if (qp->sq.db_index < 0){
mthca_free_db(dev, MTHCA_DB_TYPE_RQ, qp->rq.db_index);
+ return qp->sq.db_index;
+ }
+
}
return ret;
int i;
/* allocate context */
- context = cl_malloc(sizeof *context);
+ context = cl_zalloc(sizeof *context);
if (!context)
return NULL;
};
enum {
- MTHCA_CQ_ENTRY_SIZE = 0x20
+ MTHCA_CQ_ENTRY_SIZE = 0x20,
+ MTHCA_BYTES_PER_ATOMIC_COMPL = 0x8
};
enum {
break;
case MTHCA_OPCODE_ATOMIC_CS:
entry->wc_type = IB_WC_COMPARE_SWAP;
- entry->length = cl_ntoh32(cqe->byte_cnt);
+ entry->length = MTHCA_BYTES_PER_ATOMIC_COMPL;
break;
case MTHCA_OPCODE_ATOMIC_FA:
entry->wc_type = IB_WC_FETCH_ADD;
- entry->length = cl_ntoh32(cqe->byte_cnt);
+ entry->length = MTHCA_BYTES_PER_ATOMIC_COMPL;
break;
case MTHCA_OPCODE_BIND_MW:
entry->wc_type = IB_WC_MW_BIND;
if (wr->send_opt & IB_SEND_OPT_INLINE) {
if (wr->num_ds) {
struct mthca_inline_seg *seg = (struct mthca_inline_seg *)wqe;
- int s = 0;
+ uint32_t s = 0;
wqe += sizeof *seg;
for (i = 0; i < (int)wr->num_ds; ++i) {
s += sge->length;
- if (s > qp->max_inline_data) {
+ if (s > (uint32_t)qp->max_inline_data) {
ret = -1;
if (bad_wr)
*bad_wr = wr;
if (wr->send_opt & IB_SEND_OPT_INLINE) {
if (wr->num_ds) {
struct mthca_inline_seg *seg = (struct mthca_inline_seg *)wqe;
- int s = 0;
+ uint32_t s = 0;
wqe += sizeof *seg;
for (i = 0; i < (int)wr->num_ds; ++i) {
s += sge->length;
- if (s > qp->max_inline_data) {
+ if (s > (uint32_t)qp->max_inline_data) {
ret = -1;
if (bad_wr)
*bad_wr = wr;
{
struct mthca_pd *pd;
- pd = cl_malloc(sizeof *pd);
+ pd = cl_zalloc(sizeof *pd);
if (!pd)
goto err_malloc;
if (*p_cqe > 131072)
goto exit;
- cq = cl_malloc(sizeof *cq);
+ cq = cl_zalloc(sizeof *cq);
if (!cq)
goto exit;
goto exit;
}
- qp = cl_malloc(sizeof *qp);
+ qp = cl_zalloc(sizeof *qp);
if (!qp) {
UVP_PRINT(TRACE_LEVEL_ERROR ,UVP_DBG_QP ,("cl_malloc failed (%d)\n",ret));
goto err_nomem;