mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 12:00:19 +03:00
[infiniband] Use explicit "source" and "dest" address vector parameter names
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -1250,14 +1250,14 @@ static const union ib_gid arbel_no_gid = {
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @v wqe Send work queue entry
|
||||
* @ret nds Work queue entry size
|
||||
*/
|
||||
static size_t arbel_fill_ud_send_wqe ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp __unused,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *dest,
|
||||
struct io_buffer *iobuf,
|
||||
union arbel_send_wqe *wqe ) {
|
||||
struct arbel *arbel = ib_get_drvdata ( ibdev );
|
||||
@@ -1269,16 +1269,16 @@ static size_t arbel_fill_ud_send_wqe ( struct ib_device *ibdev,
|
||||
ud_address_vector.pd, ARBEL_GLOBAL_PD,
|
||||
ud_address_vector.port_number, ibdev->port );
|
||||
MLX_FILL_2 ( &wqe->ud.ud, 1,
|
||||
ud_address_vector.rlid, av->lid,
|
||||
ud_address_vector.g, av->gid_present );
|
||||
ud_address_vector.rlid, dest->lid,
|
||||
ud_address_vector.g, dest->gid_present );
|
||||
MLX_FILL_2 ( &wqe->ud.ud, 2,
|
||||
ud_address_vector.max_stat_rate, arbel_rate ( av ),
|
||||
ud_address_vector.max_stat_rate, arbel_rate ( dest ),
|
||||
ud_address_vector.msg, 3 );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 3, ud_address_vector.sl, av->sl );
|
||||
gid = ( av->gid_present ? &av->gid : &arbel_no_gid );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 3, ud_address_vector.sl, dest->sl );
|
||||
gid = ( dest->gid_present ? &dest->gid : &arbel_no_gid );
|
||||
memcpy ( &wqe->ud.ud.u.dwords[4], gid, sizeof ( *gid ) );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 8, destination_qp, av->qpn );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 9, q_key, av->qkey );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 8, destination_qp, dest->qpn );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 9, q_key, dest->qkey );
|
||||
MLX_FILL_1 ( &wqe->ud.data[0], 0, byte_count, iob_len ( iobuf ) );
|
||||
MLX_FILL_1 ( &wqe->ud.data[0], 1, l_key, arbel->lkey );
|
||||
MLX_FILL_H ( &wqe->ud.data[0], 2,
|
||||
@@ -1294,15 +1294,14 @@ static size_t arbel_fill_ud_send_wqe ( struct ib_device *ibdev,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @v wqe Send work queue entry
|
||||
* @v next Previous work queue entry's "next" field
|
||||
* @ret nds Work queue entry size
|
||||
*/
|
||||
static size_t arbel_fill_mlx_send_wqe ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *dest,
|
||||
struct io_buffer *iobuf,
|
||||
union arbel_send_wqe *wqe ) {
|
||||
struct arbel *arbel = ib_get_drvdata ( ibdev );
|
||||
@@ -1312,16 +1311,16 @@ static size_t arbel_fill_mlx_send_wqe ( struct ib_device *ibdev,
|
||||
iob_populate ( &headers, &wqe->mlx.headers, 0,
|
||||
sizeof ( wqe->mlx.headers ) );
|
||||
iob_reserve ( &headers, sizeof ( wqe->mlx.headers ) );
|
||||
ib_push ( ibdev, &headers, qp, iob_len ( iobuf ), av );
|
||||
ib_push ( ibdev, &headers, qp, iob_len ( iobuf ), dest );
|
||||
|
||||
/* Construct this work queue entry */
|
||||
MLX_FILL_5 ( &wqe->mlx.ctrl, 0,
|
||||
c, 1 /* generate completion */,
|
||||
icrc, 0 /* generate ICRC */,
|
||||
max_statrate, arbel_rate ( av ),
|
||||
max_statrate, arbel_rate ( dest ),
|
||||
slr, 0,
|
||||
v15, ( ( qp->ext_qpn == IB_QPN_SMI ) ? 1 : 0 ) );
|
||||
MLX_FILL_1 ( &wqe->mlx.ctrl, 1, rlid, av->lid );
|
||||
MLX_FILL_1 ( &wqe->mlx.ctrl, 1, rlid, dest->lid );
|
||||
MLX_FILL_1 ( &wqe->mlx.data[0], 0,
|
||||
byte_count, iob_len ( &headers ) );
|
||||
MLX_FILL_1 ( &wqe->mlx.data[0], 1, l_key, arbel->lkey );
|
||||
@@ -1345,15 +1344,14 @@ static size_t arbel_fill_mlx_send_wqe ( struct ib_device *ibdev,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @v wqe Send work queue entry
|
||||
* @v next Previous work queue entry's "next" field
|
||||
* @ret nds Work queue entry size
|
||||
*/
|
||||
static size_t arbel_fill_rc_send_wqe ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp __unused,
|
||||
struct ib_address_vector *av __unused,
|
||||
struct ib_address_vector *dest __unused,
|
||||
struct io_buffer *iobuf,
|
||||
union arbel_send_wqe *wqe ) {
|
||||
struct arbel *arbel = ib_get_drvdata ( ibdev );
|
||||
@@ -1374,7 +1372,7 @@ static size_t arbel_fill_rc_send_wqe ( struct ib_device *ibdev,
|
||||
static size_t
|
||||
( * arbel_fill_send_wqe[] ) ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *dest,
|
||||
struct io_buffer *iobuf,
|
||||
union arbel_send_wqe *wqe ) = {
|
||||
[IB_QPT_SMI] = arbel_fill_mlx_send_wqe,
|
||||
@@ -1388,13 +1386,13 @@ static size_t
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int arbel_post_send ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *dest,
|
||||
struct io_buffer *iobuf ) {
|
||||
struct arbel *arbel = ib_get_drvdata ( ibdev );
|
||||
struct arbel_queue_pair *arbel_qp = ib_qp_get_drvdata ( qp );
|
||||
@@ -1424,7 +1422,7 @@ static int arbel_post_send ( struct ib_device *ibdev,
|
||||
assert ( qp->type < ( sizeof ( arbel_fill_send_wqe ) /
|
||||
sizeof ( arbel_fill_send_wqe[0] ) ) );
|
||||
assert ( arbel_fill_send_wqe[qp->type] != NULL );
|
||||
nds = arbel_fill_send_wqe[qp->type] ( ibdev, qp, av, iobuf, wqe );
|
||||
nds = arbel_fill_send_wqe[qp->type] ( ibdev, qp, dest, iobuf, wqe );
|
||||
DBGCP ( arbel, "Arbel %p QPN %#lx posting send WQE %#lx:\n",
|
||||
arbel, qp->qpn, ( wq->next_idx & wqe_idx_mask ) );
|
||||
DBGCP_HDA ( arbel, virt_to_phys ( wqe ), wqe, sizeof ( *wqe ) );
|
||||
@@ -1527,9 +1525,9 @@ static int arbel_complete ( struct ib_device *ibdev,
|
||||
struct arbel_recv_work_queue *arbel_recv_wq;
|
||||
struct arbelprm_recv_wqe *recv_wqe;
|
||||
struct io_buffer *iobuf;
|
||||
struct ib_address_vector recv_av;
|
||||
struct ib_address_vector recv_source;
|
||||
struct ib_global_route_header *grh;
|
||||
struct ib_address_vector *av;
|
||||
struct ib_address_vector *source;
|
||||
unsigned int opcode;
|
||||
unsigned long qpn;
|
||||
int is_send;
|
||||
@@ -1618,23 +1616,24 @@ static int arbel_complete ( struct ib_device *ibdev,
|
||||
grh = iobuf->data;
|
||||
iob_pull ( iobuf, sizeof ( *grh ) );
|
||||
/* Construct address vector */
|
||||
av = &recv_av;
|
||||
memset ( av, 0, sizeof ( *av ) );
|
||||
av->qpn = MLX_GET ( &cqe->normal, rqpn );
|
||||
av->lid = MLX_GET ( &cqe->normal, rlid );
|
||||
av->sl = MLX_GET ( &cqe->normal, sl );
|
||||
av->gid_present = MLX_GET ( &cqe->normal, g );
|
||||
memcpy ( &av->gid, &grh->sgid, sizeof ( av->gid ) );
|
||||
source = &recv_source;
|
||||
memset ( source, 0, sizeof ( *source ) );
|
||||
source->qpn = MLX_GET ( &cqe->normal, rqpn );
|
||||
source->lid = MLX_GET ( &cqe->normal, rlid );
|
||||
source->sl = MLX_GET ( &cqe->normal, sl );
|
||||
source->gid_present = MLX_GET ( &cqe->normal, g );
|
||||
memcpy ( &source->gid, &grh->sgid,
|
||||
sizeof ( source->gid ) );
|
||||
break;
|
||||
case IB_QPT_RC:
|
||||
av = &qp->av;
|
||||
source = &qp->av;
|
||||
break;
|
||||
default:
|
||||
assert ( 0 );
|
||||
return -EINVAL;
|
||||
}
|
||||
/* Hand off to completion handler */
|
||||
ib_complete_recv ( ibdev, qp, av, iobuf, rc );
|
||||
ib_complete_recv ( ibdev, qp, source, iobuf, rc );
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
||||
@@ -1364,7 +1364,7 @@ static void hermon_destroy_qp ( struct ib_device *ibdev,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @v wqe Send work queue entry
|
||||
* @ret opcode Control opcode
|
||||
@@ -1372,7 +1372,7 @@ static void hermon_destroy_qp ( struct ib_device *ibdev,
|
||||
static __attribute__ (( unused )) unsigned int
|
||||
hermon_fill_nop_send_wqe ( struct ib_device *ibdev __unused,
|
||||
struct ib_queue_pair *qp __unused,
|
||||
struct ib_address_vector *av __unused,
|
||||
struct ib_address_vector *dest __unused,
|
||||
struct io_buffer *iobuf __unused,
|
||||
union hermon_send_wqe *wqe ) {
|
||||
|
||||
@@ -1386,7 +1386,7 @@ hermon_fill_nop_send_wqe ( struct ib_device *ibdev __unused,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @v wqe Send work queue entry
|
||||
* @ret opcode Control opcode
|
||||
@@ -1394,7 +1394,7 @@ hermon_fill_nop_send_wqe ( struct ib_device *ibdev __unused,
|
||||
static unsigned int
|
||||
hermon_fill_ud_send_wqe ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp __unused,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *dest,
|
||||
struct io_buffer *iobuf,
|
||||
union hermon_send_wqe *wqe ) {
|
||||
struct hermon *hermon = ib_get_drvdata ( ibdev );
|
||||
@@ -1406,14 +1406,14 @@ hermon_fill_ud_send_wqe ( struct ib_device *ibdev,
|
||||
ud_address_vector.pd, HERMON_GLOBAL_PD,
|
||||
ud_address_vector.port_number, ibdev->port );
|
||||
MLX_FILL_2 ( &wqe->ud.ud, 1,
|
||||
ud_address_vector.rlid, av->lid,
|
||||
ud_address_vector.g, av->gid_present );
|
||||
ud_address_vector.rlid, dest->lid,
|
||||
ud_address_vector.g, dest->gid_present );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 2,
|
||||
ud_address_vector.max_stat_rate, hermon_rate ( av ) );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 3, ud_address_vector.sl, av->sl );
|
||||
memcpy ( &wqe->ud.ud.u.dwords[4], &av->gid, sizeof ( av->gid ) );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 8, destination_qp, av->qpn );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 9, q_key, av->qkey );
|
||||
ud_address_vector.max_stat_rate, hermon_rate ( dest ) );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 3, ud_address_vector.sl, dest->sl );
|
||||
memcpy ( &wqe->ud.ud.u.dwords[4], &dest->gid, sizeof ( dest->gid ) );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 8, destination_qp, dest->qpn );
|
||||
MLX_FILL_1 ( &wqe->ud.ud, 9, q_key, dest->qkey );
|
||||
MLX_FILL_1 ( &wqe->ud.data[0], 0, byte_count, iob_len ( iobuf ) );
|
||||
MLX_FILL_1 ( &wqe->ud.data[0], 1, l_key, hermon->lkey );
|
||||
MLX_FILL_H ( &wqe->ud.data[0], 2,
|
||||
@@ -1428,7 +1428,7 @@ hermon_fill_ud_send_wqe ( struct ib_device *ibdev,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @v wqe Send work queue entry
|
||||
* @ret opcode Control opcode
|
||||
@@ -1436,7 +1436,7 @@ hermon_fill_ud_send_wqe ( struct ib_device *ibdev,
|
||||
static unsigned int
|
||||
hermon_fill_mlx_send_wqe ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *dest,
|
||||
struct io_buffer *iobuf,
|
||||
union hermon_send_wqe *wqe ) {
|
||||
struct hermon *hermon = ib_get_drvdata ( ibdev );
|
||||
@@ -1446,7 +1446,7 @@ hermon_fill_mlx_send_wqe ( struct ib_device *ibdev,
|
||||
iob_populate ( &headers, &wqe->mlx.headers, 0,
|
||||
sizeof ( wqe->mlx.headers ) );
|
||||
iob_reserve ( &headers, sizeof ( wqe->mlx.headers ) );
|
||||
ib_push ( ibdev, &headers, qp, iob_len ( iobuf ), av );
|
||||
ib_push ( ibdev, &headers, qp, iob_len ( iobuf ), dest );
|
||||
|
||||
/* Fill work queue entry */
|
||||
MLX_FILL_1 ( &wqe->mlx.ctrl, 1, ds,
|
||||
@@ -1454,10 +1454,10 @@ hermon_fill_mlx_send_wqe ( struct ib_device *ibdev,
|
||||
MLX_FILL_5 ( &wqe->mlx.ctrl, 2,
|
||||
c, 0x03 /* generate completion */,
|
||||
icrc, 0 /* generate ICRC */,
|
||||
max_statrate, hermon_rate ( av ),
|
||||
max_statrate, hermon_rate ( dest ),
|
||||
slr, 0,
|
||||
v15, ( ( qp->ext_qpn == IB_QPN_SMI ) ? 1 : 0 ) );
|
||||
MLX_FILL_1 ( &wqe->mlx.ctrl, 3, rlid, av->lid );
|
||||
MLX_FILL_1 ( &wqe->mlx.ctrl, 3, rlid, dest->lid );
|
||||
MLX_FILL_1 ( &wqe->mlx.data[0], 0,
|
||||
byte_count, iob_len ( &headers ) );
|
||||
MLX_FILL_1 ( &wqe->mlx.data[0], 1, l_key, hermon->lkey );
|
||||
@@ -1480,7 +1480,7 @@ hermon_fill_mlx_send_wqe ( struct ib_device *ibdev,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @v wqe Send work queue entry
|
||||
* @ret opcode Control opcode
|
||||
@@ -1488,7 +1488,7 @@ hermon_fill_mlx_send_wqe ( struct ib_device *ibdev,
|
||||
static unsigned int
|
||||
hermon_fill_rc_send_wqe ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp __unused,
|
||||
struct ib_address_vector *av __unused,
|
||||
struct ib_address_vector *dest __unused,
|
||||
struct io_buffer *iobuf,
|
||||
union hermon_send_wqe *wqe ) {
|
||||
struct hermon *hermon = ib_get_drvdata ( ibdev );
|
||||
@@ -1510,7 +1510,7 @@ hermon_fill_rc_send_wqe ( struct ib_device *ibdev,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @v wqe Send work queue entry
|
||||
* @ret opcode Control opcode
|
||||
@@ -1518,7 +1518,7 @@ hermon_fill_rc_send_wqe ( struct ib_device *ibdev,
|
||||
static unsigned int
|
||||
hermon_fill_eth_send_wqe ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp __unused,
|
||||
struct ib_address_vector *av __unused,
|
||||
struct ib_address_vector *dest __unused,
|
||||
struct io_buffer *iobuf,
|
||||
union hermon_send_wqe *wqe ) {
|
||||
struct hermon *hermon = ib_get_drvdata ( ibdev );
|
||||
@@ -1543,7 +1543,7 @@ hermon_fill_eth_send_wqe ( struct ib_device *ibdev,
|
||||
static unsigned int
|
||||
( * hermon_fill_send_wqe[] ) ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *dest,
|
||||
struct io_buffer *iobuf,
|
||||
union hermon_send_wqe *wqe ) = {
|
||||
[IB_QPT_SMI] = hermon_fill_mlx_send_wqe,
|
||||
@@ -1558,13 +1558,13 @@ static unsigned int
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int hermon_post_send ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *dest,
|
||||
struct io_buffer *iobuf ) {
|
||||
struct hermon *hermon = ib_get_drvdata ( ibdev );
|
||||
struct hermon_queue_pair *hermon_qp = ib_qp_get_drvdata ( qp );
|
||||
@@ -1595,7 +1595,7 @@ static int hermon_post_send ( struct ib_device *ibdev,
|
||||
assert ( qp->type < ( sizeof ( hermon_fill_send_wqe ) /
|
||||
sizeof ( hermon_fill_send_wqe[0] ) ) );
|
||||
assert ( hermon_fill_send_wqe[qp->type] != NULL );
|
||||
opcode = hermon_fill_send_wqe[qp->type] ( ibdev, qp, av, iobuf, wqe );
|
||||
opcode = hermon_fill_send_wqe[qp->type] ( ibdev, qp, dest, iobuf, wqe );
|
||||
barrier();
|
||||
MLX_FILL_2 ( &wqe->ctrl, 0,
|
||||
opcode, opcode,
|
||||
@@ -1677,9 +1677,9 @@ static int hermon_complete ( struct ib_device *ibdev,
|
||||
struct ib_work_queue *wq;
|
||||
struct ib_queue_pair *qp;
|
||||
struct io_buffer *iobuf;
|
||||
struct ib_address_vector recv_av;
|
||||
struct ib_address_vector recv_source;
|
||||
struct ib_global_route_header *grh;
|
||||
struct ib_address_vector *av;
|
||||
struct ib_address_vector *source;
|
||||
unsigned int opcode;
|
||||
unsigned long qpn;
|
||||
int is_send;
|
||||
@@ -1737,7 +1737,7 @@ static int hermon_complete ( struct ib_device *ibdev,
|
||||
len = MLX_GET ( &cqe->normal, byte_cnt );
|
||||
assert ( len <= iob_tailroom ( iobuf ) );
|
||||
iob_put ( iobuf, len );
|
||||
memset ( &recv_av, 0, sizeof ( recv_av ) );
|
||||
memset ( &recv_source, 0, sizeof ( recv_source ) );
|
||||
switch ( qp->type ) {
|
||||
case IB_QPT_SMI:
|
||||
case IB_QPT_GSI:
|
||||
@@ -1746,28 +1746,29 @@ static int hermon_complete ( struct ib_device *ibdev,
|
||||
grh = iobuf->data;
|
||||
iob_pull ( iobuf, sizeof ( *grh ) );
|
||||
/* Construct address vector */
|
||||
av = &recv_av;
|
||||
av->qpn = MLX_GET ( &cqe->normal, srq_rqpn );
|
||||
av->lid = MLX_GET ( &cqe->normal, slid_smac47_32 );
|
||||
av->sl = MLX_GET ( &cqe->normal, sl );
|
||||
av->gid_present = MLX_GET ( &cqe->normal, g );
|
||||
memcpy ( &av->gid, &grh->sgid, sizeof ( av->gid ) );
|
||||
source = &recv_source;
|
||||
source->qpn = MLX_GET ( &cqe->normal, srq_rqpn );
|
||||
source->lid = MLX_GET ( &cqe->normal, slid_smac47_32 );
|
||||
source->sl = MLX_GET ( &cqe->normal, sl );
|
||||
source->gid_present = MLX_GET ( &cqe->normal, g );
|
||||
memcpy ( &source->gid, &grh->sgid,
|
||||
sizeof ( source->gid ) );
|
||||
break;
|
||||
case IB_QPT_RC:
|
||||
av = &qp->av;
|
||||
source = &qp->av;
|
||||
break;
|
||||
case IB_QPT_ETH:
|
||||
/* Construct address vector */
|
||||
av = &recv_av;
|
||||
av->vlan_present = MLX_GET ( &cqe->normal, vlan );
|
||||
av->vlan = MLX_GET ( &cqe->normal, vid );
|
||||
source = &recv_source;
|
||||
source->vlan_present = MLX_GET ( &cqe->normal, vlan );
|
||||
source->vlan = MLX_GET ( &cqe->normal, vid );
|
||||
break;
|
||||
default:
|
||||
assert ( 0 );
|
||||
return -EINVAL;
|
||||
}
|
||||
/* Hand off to completion handler */
|
||||
ib_complete_recv ( ibdev, qp, av, iobuf, rc );
|
||||
ib_complete_recv ( ibdev, qp, source, iobuf, rc );
|
||||
}
|
||||
|
||||
return rc;
|
||||
@@ -3154,20 +3155,20 @@ static void hermon_eth_complete_send ( struct ib_device *ibdev __unused,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector, or NULL
|
||||
* @v source Source address vector, or NULL
|
||||
* @v iobuf I/O buffer
|
||||
* @v rc Completion status code
|
||||
*/
|
||||
static void hermon_eth_complete_recv ( struct ib_device *ibdev __unused,
|
||||
struct ib_queue_pair *qp,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *source,
|
||||
struct io_buffer *iobuf, int rc ) {
|
||||
struct net_device *netdev = ib_qp_get_ownerdata ( qp );
|
||||
struct net_device *vlan;
|
||||
|
||||
/* Find VLAN device, if applicable */
|
||||
if ( av->vlan_present ) {
|
||||
if ( ( vlan = vlan_find ( netdev, av->vlan ) ) != NULL ) {
|
||||
if ( source->vlan_present ) {
|
||||
if ( ( vlan = vlan_find ( netdev, source->vlan ) ) != NULL ) {
|
||||
netdev = vlan;
|
||||
} else if ( rc == 0 ) {
|
||||
rc = -ENODEV;
|
||||
|
||||
@@ -936,13 +936,13 @@ static void linda_destroy_qp ( struct ib_device *ibdev,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int linda_post_send ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *dest,
|
||||
struct io_buffer *iobuf ) {
|
||||
struct linda *linda = ib_get_drvdata ( ibdev );
|
||||
struct ib_work_queue *wq = &qp->send;
|
||||
@@ -969,7 +969,7 @@ static int linda_post_send ( struct ib_device *ibdev,
|
||||
/* Construct headers */
|
||||
iob_populate ( &headers, header_buf, 0, sizeof ( header_buf ) );
|
||||
iob_reserve ( &headers, sizeof ( header_buf ) );
|
||||
ib_push ( ibdev, &headers, qp, iob_len ( iobuf ), av );
|
||||
ib_push ( ibdev, &headers, qp, iob_len ( iobuf ), dest );
|
||||
|
||||
/* Calculate packet length */
|
||||
len = ( ( sizeof ( sendpbc ) + iob_len ( &headers ) +
|
||||
@@ -1170,7 +1170,7 @@ static void linda_complete_recv ( struct ib_device *ibdev,
|
||||
struct io_buffer headers;
|
||||
struct io_buffer *iobuf;
|
||||
struct ib_queue_pair *intended_qp;
|
||||
struct ib_address_vector av;
|
||||
struct ib_address_vector source;
|
||||
unsigned int rcvtype;
|
||||
unsigned int pktlen;
|
||||
unsigned int egrindex;
|
||||
@@ -1238,7 +1238,7 @@ static void linda_complete_recv ( struct ib_device *ibdev,
|
||||
qp0 = ( qp->qpn == 0 );
|
||||
intended_qp = NULL;
|
||||
if ( ( rc = ib_pull ( ibdev, &headers, ( qp0 ? &intended_qp : NULL ),
|
||||
&payload_len, &av ) ) != 0 ) {
|
||||
&payload_len, &source ) ) != 0 ) {
|
||||
DBGC ( linda, "Linda %p could not parse headers: %s\n",
|
||||
linda, strerror ( rc ) );
|
||||
err = 1;
|
||||
@@ -1295,10 +1295,12 @@ static void linda_complete_recv ( struct ib_device *ibdev,
|
||||
qp->recv.fill--;
|
||||
intended_qp->recv.fill++;
|
||||
}
|
||||
ib_complete_recv ( ibdev, intended_qp, &av, iobuf, rc);
|
||||
ib_complete_recv ( ibdev, intended_qp, &source,
|
||||
iobuf, rc);
|
||||
} else {
|
||||
/* Completing on a skipped-over eager buffer */
|
||||
ib_complete_recv ( ibdev, qp, &av, iobuf, -ECANCELED );
|
||||
ib_complete_recv ( ibdev, qp, &source, iobuf,
|
||||
-ECANCELED );
|
||||
}
|
||||
|
||||
/* Clear eager buffer */
|
||||
|
||||
@@ -1173,13 +1173,13 @@ static void qib7322_destroy_qp ( struct ib_device *ibdev,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector
|
||||
* @v dest Destination address vector
|
||||
* @v iobuf I/O buffer
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int qib7322_post_send ( struct ib_device *ibdev,
|
||||
struct ib_queue_pair *qp,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *dest,
|
||||
struct io_buffer *iobuf ) {
|
||||
struct qib7322 *qib7322 = ib_get_drvdata ( ibdev );
|
||||
struct ib_work_queue *wq = &qp->send;
|
||||
@@ -1211,7 +1211,7 @@ static int qib7322_post_send ( struct ib_device *ibdev,
|
||||
/* Construct headers */
|
||||
iob_populate ( &headers, header_buf, 0, sizeof ( header_buf ) );
|
||||
iob_reserve ( &headers, sizeof ( header_buf ) );
|
||||
ib_push ( ibdev, &headers, qp, iob_len ( iobuf ), av );
|
||||
ib_push ( ibdev, &headers, qp, iob_len ( iobuf ), dest );
|
||||
|
||||
/* Calculate packet length */
|
||||
len = ( ( sizeof ( sendpbc ) + iob_len ( &headers ) +
|
||||
@@ -1413,7 +1413,7 @@ static void qib7322_complete_recv ( struct ib_device *ibdev,
|
||||
struct io_buffer headers;
|
||||
struct io_buffer *iobuf;
|
||||
struct ib_queue_pair *intended_qp;
|
||||
struct ib_address_vector av;
|
||||
struct ib_address_vector source;
|
||||
unsigned int rcvtype;
|
||||
unsigned int pktlen;
|
||||
unsigned int egrindex;
|
||||
@@ -1474,7 +1474,7 @@ static void qib7322_complete_recv ( struct ib_device *ibdev,
|
||||
qp0 = ( qp->qpn == 0 );
|
||||
intended_qp = NULL;
|
||||
if ( ( rc = ib_pull ( ibdev, &headers, ( qp0 ? &intended_qp : NULL ),
|
||||
&payload_len, &av ) ) != 0 ) {
|
||||
&payload_len, &source ) ) != 0 ) {
|
||||
DBGC ( qib7322, "QIB7322 %p could not parse headers: %s\n",
|
||||
qib7322, strerror ( rc ) );
|
||||
err = 1;
|
||||
@@ -1531,10 +1531,12 @@ static void qib7322_complete_recv ( struct ib_device *ibdev,
|
||||
qp->recv.fill--;
|
||||
intended_qp->recv.fill++;
|
||||
}
|
||||
ib_complete_recv ( ibdev, intended_qp, &av, iobuf, rc);
|
||||
ib_complete_recv ( ibdev, intended_qp, &source,
|
||||
iobuf, rc);
|
||||
} else {
|
||||
/* Completing on a skipped-over eager buffer */
|
||||
ib_complete_recv ( ibdev, qp, &av, iobuf, -ECANCELED );
|
||||
ib_complete_recv ( ibdev, qp, &source, iobuf,
|
||||
-ECANCELED );
|
||||
}
|
||||
|
||||
/* Clear eager buffer */
|
||||
|
||||
@@ -423,8 +423,8 @@ static int ipoib_transmit ( struct net_device *netdev,
|
||||
struct ipoib_device *ipoib = netdev->priv;
|
||||
struct ib_device *ibdev = ipoib->ibdev;
|
||||
struct ipoib_hdr *ipoib_hdr;
|
||||
struct ipoib_peer *dest;
|
||||
struct ib_address_vector av;
|
||||
struct ipoib_peer *peer;
|
||||
struct ib_address_vector dest;
|
||||
int rc;
|
||||
|
||||
/* Sanity check */
|
||||
@@ -441,22 +441,22 @@ static int ipoib_transmit ( struct net_device *netdev,
|
||||
return -ENETUNREACH;
|
||||
|
||||
/* Identify destination address */
|
||||
dest = ipoib_lookup_peer_by_key ( ipoib_hdr->u.peer.dest );
|
||||
if ( ! dest )
|
||||
peer = ipoib_lookup_peer_by_key ( ipoib_hdr->u.peer.dest );
|
||||
if ( ! peer )
|
||||
return -ENXIO;
|
||||
ipoib_hdr->u.reserved = 0;
|
||||
|
||||
/* Construct address vector */
|
||||
memset ( &av, 0, sizeof ( av ) );
|
||||
av.qpn = ( ntohl ( dest->mac.flags__qpn ) & IB_QPN_MASK );
|
||||
av.gid_present = 1;
|
||||
memcpy ( &av.gid, &dest->mac.gid, sizeof ( av.gid ) );
|
||||
if ( ( rc = ib_resolve_path ( ibdev, &av ) ) != 0 ) {
|
||||
memset ( &dest, 0, sizeof ( dest ) );
|
||||
dest.qpn = ( ntohl ( peer->mac.flags__qpn ) & IB_QPN_MASK );
|
||||
dest.gid_present = 1;
|
||||
memcpy ( &dest.gid, &peer->mac.gid, sizeof ( dest.gid ) );
|
||||
if ( ( rc = ib_resolve_path ( ibdev, &dest ) ) != 0 ) {
|
||||
/* Path not resolved yet */
|
||||
return rc;
|
||||
}
|
||||
|
||||
return ib_post_send ( ibdev, ipoib->qp, &av, iobuf );
|
||||
return ib_post_send ( ibdev, ipoib->qp, &dest, iobuf );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,13 +480,13 @@ static void ipoib_complete_send ( struct ib_device *ibdev __unused,
|
||||
*
|
||||
* @v ibdev Infiniband device
|
||||
* @v qp Queue pair
|
||||
* @v av Address vector, or NULL
|
||||
* @v source Source address vector, or NULL
|
||||
* @v iobuf I/O buffer
|
||||
* @v rc Completion status code
|
||||
*/
|
||||
static void ipoib_complete_recv ( struct ib_device *ibdev __unused,
|
||||
struct ib_queue_pair *qp,
|
||||
struct ib_address_vector *av,
|
||||
struct ib_address_vector *source,
|
||||
struct io_buffer *iobuf, int rc ) {
|
||||
struct ipoib_device *ipoib = ib_qp_get_ownerdata ( qp );
|
||||
struct net_device *netdev = ipoib->netdev;
|
||||
@@ -509,7 +509,7 @@ static void ipoib_complete_recv ( struct ib_device *ibdev __unused,
|
||||
return;
|
||||
}
|
||||
ipoib_hdr = iobuf->data;
|
||||
if ( ! av ) {
|
||||
if ( ! source ) {
|
||||
DBGC ( ipoib, "IPoIB %p received packet without address "
|
||||
"vector\n", ipoib );
|
||||
netdev_rx_err ( netdev, iobuf, -ENOTTY );
|
||||
@@ -517,9 +517,9 @@ static void ipoib_complete_recv ( struct ib_device *ibdev __unused,
|
||||
}
|
||||
|
||||
/* Parse source address */
|
||||
if ( av->gid_present ) {
|
||||
ll_src.flags__qpn = htonl ( av->qpn );
|
||||
memcpy ( &ll_src.gid, &av->gid, sizeof ( ll_src.gid ) );
|
||||
if ( source->gid_present ) {
|
||||
ll_src.flags__qpn = htonl ( source->qpn );
|
||||
memcpy ( &ll_src.gid, &source->gid, sizeof ( ll_src.gid ) );
|
||||
src = ipoib_cache_peer ( &ll_src );
|
||||
ipoib_hdr->u.peer.src = src->key;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user