|
@@ -398,6 +398,9 @@ static int arbel_create_cq ( struct ib_device *ibdev,
|
398
|
398
|
goto err_sw2hw_cq;
|
399
|
399
|
}
|
400
|
400
|
|
|
401
|
+ DBGC ( arbel, "Arbel %p CQN %#lx ring at [%p,%p)\n",
|
|
402
|
+ arbel, cq->cqn, arbel_cq->cqe,
|
|
403
|
+ ( ( ( void * ) arbel_cq->cqe ) + arbel_cq->cqe_size ) );
|
401
|
404
|
cq->dev_priv = arbel_cq;
|
402
|
405
|
return 0;
|
403
|
406
|
|
|
@@ -650,6 +653,12 @@ static int arbel_create_qp ( struct ib_device *ibdev,
|
650
|
653
|
goto err_rtr2rts_qpee;
|
651
|
654
|
}
|
652
|
655
|
|
|
656
|
+ DBGC ( arbel, "Arbel %p QPN %#lx send ring at [%p,%p)\n",
|
|
657
|
+ arbel, qp->qpn, arbel_qp->send.wqe,
|
|
658
|
+ ( ( (void *) arbel_qp->send.wqe ) + arbel_qp->send.wqe_size ) );
|
|
659
|
+ DBGC ( arbel, "Arbel %p QPN %#lx receive ring at [%p,%p)\n",
|
|
660
|
+ arbel, qp->qpn, arbel_qp->recv.wqe,
|
|
661
|
+ ( ( (void *) arbel_qp->recv.wqe ) + arbel_qp->recv.wqe_size ) );
|
653
|
662
|
qp->dev_priv = arbel_qp;
|
654
|
663
|
return 0;
|
655
|
664
|
|
|
@@ -904,6 +913,7 @@ static int arbel_complete ( struct ib_device *ibdev,
|
904
|
913
|
struct arbel_queue_pair *arbel_qp;
|
905
|
914
|
struct arbel_send_work_queue *arbel_send_wq;
|
906
|
915
|
struct arbel_recv_work_queue *arbel_recv_wq;
|
|
916
|
+ struct arbelprm_recv_wqe *recv_wqe;
|
907
|
917
|
struct io_buffer *iobuf;
|
908
|
918
|
ib_completer_t complete;
|
909
|
919
|
unsigned int opcode;
|
|
@@ -915,7 +925,6 @@ static int arbel_complete ( struct ib_device *ibdev,
|
915
|
925
|
|
916
|
926
|
/* Parse completion */
|
917
|
927
|
memset ( &completion, 0, sizeof ( completion ) );
|
918
|
|
- completion.len = MLX_GET ( &cqe->normal, byte_cnt );
|
919
|
928
|
qpn = MLX_GET ( &cqe->normal, my_qpn );
|
920
|
929
|
is_send = MLX_GET ( &cqe->normal, s );
|
921
|
930
|
wqe_adr = ( MLX_GET ( &cqe->normal, wqe_adr ) << 6 );
|
|
@@ -946,10 +955,12 @@ static int arbel_complete ( struct ib_device *ibdev,
|
946
|
955
|
arbel_send_wq = &arbel_qp->send;
|
947
|
956
|
wqe_idx = ( ( wqe_adr - virt_to_bus ( arbel_send_wq->wqe ) ) /
|
948
|
957
|
sizeof ( arbel_send_wq->wqe[0] ) );
|
|
958
|
+ assert ( wqe_idx < qp->send.num_wqes );
|
949
|
959
|
} else {
|
950
|
960
|
arbel_recv_wq = &arbel_qp->recv;
|
951
|
961
|
wqe_idx = ( ( wqe_adr - virt_to_bus ( arbel_recv_wq->wqe ) ) /
|
952
|
962
|
sizeof ( arbel_recv_wq->wqe[0] ) );
|
|
963
|
+ assert ( wqe_idx < qp->recv.num_wqes );
|
953
|
964
|
}
|
954
|
965
|
|
955
|
966
|
/* Identify I/O buffer */
|
|
@@ -961,6 +972,27 @@ static int arbel_complete ( struct ib_device *ibdev,
|
961
|
972
|
}
|
962
|
973
|
wq->iobufs[wqe_idx] = NULL;
|
963
|
974
|
|
|
975
|
+ /* Fill in length for received packets */
|
|
976
|
+ if ( ! is_send ) {
|
|
977
|
+ completion.len = MLX_GET ( &cqe->normal, byte_cnt );
|
|
978
|
+ recv_wqe = &arbel_recv_wq->wqe[wqe_idx].recv;
|
|
979
|
+ assert ( MLX_GET ( &recv_wqe->data[0], local_address_l ) ==
|
|
980
|
+ virt_to_bus ( iobuf->data ) );
|
|
981
|
+ assert ( MLX_GET ( &recv_wqe->data[0], byte_count ) ==
|
|
982
|
+ iob_tailroom ( iobuf ) );
|
|
983
|
+ DBG ( "CPQ %lx QPN %lx WQE %x\n", cq->cqn, qp->qpn, wqe_idx );
|
|
984
|
+ // DBG_HD ( iobuf, sizeof ( *iobuf ) );
|
|
985
|
+ MLX_FILL_1 ( &recv_wqe->data[0], 0, byte_count, 0 );
|
|
986
|
+ MLX_FILL_1 ( &recv_wqe->data[0], 1,
|
|
987
|
+ l_key, ARBEL_INVALID_LKEY );
|
|
988
|
+ if ( completion.len > iob_tailroom ( iobuf ) ) {
|
|
989
|
+ DBGC ( arbel, "Arbel %p CQN %lx QPN %lx IDX %x "
|
|
990
|
+ "overlength received packet length %zd\n",
|
|
991
|
+ arbel, cq->cqn, qpn, wqe_idx, completion.len );
|
|
992
|
+ return -EIO;
|
|
993
|
+ }
|
|
994
|
+ }
|
|
995
|
+
|
964
|
996
|
/* Pass off to caller's completion handler */
|
965
|
997
|
complete = ( is_send ? complete_send : complete_recv );
|
966
|
998
|
complete ( ibdev, qp, &completion, iobuf );
|
|
@@ -1252,7 +1284,7 @@ static int arbel_get_sm_lid ( struct arbel *arbel,
|
1252
|
1284
|
return 0;
|
1253
|
1285
|
}
|
1254
|
1286
|
|
1255
|
|
-static int arbel_get_pkey ( struct arbel *arbel, unsigned long *pkey ) {
|
|
1287
|
+static int arbel_get_pkey ( struct arbel *arbel, unsigned int *pkey ) {
|
1256
|
1288
|
struct ib_mad_pkey_table pkey_table;
|
1257
|
1289
|
int rc;
|
1258
|
1290
|
|