*
* @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 );
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,
*
* @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 );
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 );
*
* @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 );
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,
*
* @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 );
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 ) );
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;
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;
*
* @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
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 ) {
*
* @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
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 );
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,
*
* @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
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 );
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,
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 );
*
* @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
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 );
*
* @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
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 );
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,
*
* @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 );
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,
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;
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:
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;
*
* @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;
*
* @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;
/* 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 ) +
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;
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;
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 */
*
* @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;
/* 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 ) +
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;
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;
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 */
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 */
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 );
}
/**
*
* @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;
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 );
}
/* 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;
}
extern int ib_push ( struct ib_device *ibdev, struct io_buffer *iobuf,
struct ib_queue_pair *qp, size_t payload_len,
- const struct ib_address_vector *av );
+ const struct ib_address_vector *dest );
extern int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
struct ib_queue_pair **qp, size_t *payload_len,
- struct ib_address_vector *av );
+ struct ib_address_vector *source );
#endif /* _IPXE_IB_PACKET_H */
*
* @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
*/
void ( * complete_recv ) ( struct ib_device *ibdev,
struct ib_queue_pair *qp,
- struct ib_address_vector *av,
+ struct ib_address_vector *source,
struct io_buffer *iobuf, int rc );
};
*
* @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
*
*/
int ( * 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 );
/** Post receive work queue entry
*
extern struct ib_work_queue * ib_find_wq ( struct ib_completion_queue *cq,
unsigned long qpn, int is_send );
extern int ib_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 );
extern int ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
struct io_buffer *iobuf );
struct io_buffer *iobuf, int rc );
extern void ib_complete_recv ( struct ib_device *ibdev,
struct ib_queue_pair *qp,
- struct ib_address_vector *av,
+ struct ib_address_vector *source,
struct io_buffer *iobuf, int rc );
extern void ib_refill_recv ( struct ib_device *ibdev,
struct ib_queue_pair *qp );
*
* @v ibdev Infiniband device
* @v qp Queue pair
- * @v av New address vector, if applicable
* @ret rc Return status code
*/
int ib_modify_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp ) {
*
* @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
*/
int ib_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 ib_address_vector av_copy;
+ struct ib_address_vector dest_copy;
int rc;
/* Check queue fill level */
}
/* Use default address vector if none specified */
- if ( ! av )
- av = &qp->av;
+ if ( ! dest )
+ dest = &qp->av;
/* Make modifiable copy of address vector */
- memcpy ( &av_copy, av, sizeof ( av_copy ) );
- av = &av_copy;
+ memcpy ( &dest_copy, dest, sizeof ( dest_copy ) );
+ dest = &dest_copy;
/* Fill in optional parameters in address vector */
- if ( ! av->qkey )
- av->qkey = qp->qkey;
- if ( ! av->rate )
- av->rate = IB_RATE_2_5;
+ if ( ! dest->qkey )
+ dest->qkey = qp->qkey;
+ if ( ! dest->rate )
+ dest->rate = IB_RATE_2_5;
/* Post to hardware */
- if ( ( rc = ibdev->op->post_send ( ibdev, qp, av, iobuf ) ) != 0 ) {
+ if ( ( rc = ibdev->op->post_send ( ibdev, qp, dest, iobuf ) ) != 0 ) {
DBGC ( ibdev, "IBDEV %p QPN %#lx could not post send WQE: "
"%s\n", ibdev, qp->qpn, strerror ( rc ) );
return rc;
*
* @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
*/
void ib_complete_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
- struct ib_address_vector *av,
+ struct ib_address_vector *source,
struct io_buffer *iobuf, int rc ) {
if ( qp->recv.cq->op->complete_recv ) {
- qp->recv.cq->op->complete_recv ( ibdev, qp, av, iobuf, rc );
+ qp->recv.cq->op->complete_recv ( ibdev, qp, source, iobuf, rc );
} else {
free_iob ( iobuf );
}
*
* @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 ib_cmrc_complete_recv ( struct ib_device *ibdev __unused,
struct ib_queue_pair *qp,
- struct ib_address_vector *av __unused,
+ struct ib_address_vector *source __unused,
struct io_buffer *iobuf, int rc ) {
struct ib_cmrc_connection *cmrc = ib_qp_get_ownerdata ( qp );
*
* @v ibdev Infiniband device
* @v qp Queue pair
- * @v av Address vector
+ * @v source Address vector
* @v iobuf I/O buffer
* @v rc Completion status code
*/
static void ib_mi_complete_recv ( struct ib_device *ibdev,
struct ib_queue_pair *qp,
- struct ib_address_vector *av,
+ struct ib_address_vector *source,
struct io_buffer *iobuf, int rc ) {
struct ib_mad_interface *mi = ib_qp_get_ownerdata ( qp );
union ib_mad *mad;
DBGC2_HDA ( mi, 0, mad, sizeof ( *mad ) );
/* Handle MAD */
- if ( ( rc = ib_mi_handle ( ibdev, mi, mad, av ) ) != 0 )
+ if ( ( rc = ib_mi_handle ( ibdev, mi, mad, source ) ) != 0 )
goto out;
out:
* @v iobuf I/O buffer to contain headers
* @v qp Queue pair
* @v payload_len Payload length
- * @v av Address vector
+ * @v dest Destination address vector
+ * @ret rc Return status code
*/
int ib_push ( struct ib_device *ibdev, struct io_buffer *iobuf,
struct ib_queue_pair *qp, size_t payload_len,
- const struct ib_address_vector *av ) {
+ const struct ib_address_vector *dest ) {
struct ib_local_route_header *lrh;
struct ib_global_route_header *grh;
struct ib_base_transport_header *bth;
unsigned int lnh;
DBGC2 ( ibdev, "IBDEV %p TX %04x:%08lx => %04x:%08lx (key %08lx)\n",
- ibdev, ibdev->lid, qp->ext_qpn, av->lid, av->qpn, av->qkey );
+ ibdev, ibdev->lid, qp->ext_qpn, dest->lid, dest->qpn,
+ dest->qkey );
/* Calculate packet length */
pad_len = ( (-payload_len) & 0x3 );
deth = iob_push ( iobuf, sizeof ( *deth ) );
bth = iob_push ( iobuf, sizeof ( *bth ) );
grh_len = ( payload_len + iob_len ( iobuf ) - orig_iob_len );
- grh = ( av->gid_present ?
+ grh = ( dest->gid_present ?
iob_push ( iobuf, sizeof ( *grh ) ) : NULL );
lrh = iob_push ( iobuf, sizeof ( *lrh ) );
lrh_len = ( payload_len + iob_len ( iobuf ) - orig_iob_len );
vl = ( ( qp->ext_qpn == IB_QPN_SMI ) ? IB_VL_SMP : IB_VL_DEFAULT );
lrh->vl__lver = ( vl << 4 );
lnh = ( grh ? IB_LNH_GRH : IB_LNH_BTH );
- lrh->sl__lnh = ( ( av->sl << 4 ) | lnh );
- lrh->dlid = htons ( av->lid );
+ lrh->sl__lnh = ( ( dest->sl << 4 ) | lnh );
+ lrh->dlid = htons ( dest->lid );
lrh->length = htons ( lrh_len >> 2 );
lrh->slid = htons ( ibdev->lid );
grh->nxthdr = IB_GRH_NXTHDR_IBA;
grh->hoplmt = 0;
memcpy ( &grh->sgid, &ibdev->gid, sizeof ( grh->sgid ) );
- memcpy ( &grh->dgid, &av->gid, sizeof ( grh->dgid ) );
+ memcpy ( &grh->dgid, &dest->gid, sizeof ( grh->dgid ) );
}
/* Construct BTH */
bth->opcode = BTH_OPCODE_UD_SEND;
bth->se__m__padcnt__tver = ( pad_len << 4 );
bth->pkey = htons ( ibdev->pkey );
- bth->dest_qp = htonl ( av->qpn );
+ bth->dest_qp = htonl ( dest->qpn );
bth->ack__psn = htonl ( ( qp->send.psn++ ) & 0xffffffUL );
/* Construct DETH */
- deth->qkey = htonl ( av->qkey );
+ deth->qkey = htonl ( dest->qkey );
deth->src_qp = htonl ( qp->ext_qpn );
DBGCP_HDA ( ibdev, 0, iobuf->data,
* @v iobuf I/O buffer containing headers
* @v qp Queue pair to fill in, or NULL
* @v payload_len Payload length to fill in, or NULL
- * @v av Address vector to fill in
+ * @v source Source address vector to fill in
+ * @ret rc Return status code
*/
int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
struct ib_queue_pair **qp, size_t *payload_len,
- struct ib_address_vector *av ) {
+ struct ib_address_vector *source ) {
struct ib_local_route_header *lrh;
struct ib_global_route_header *grh;
struct ib_base_transport_header *bth;
*qp = NULL;
if ( payload_len )
*payload_len = 0;
- memset ( av, 0, sizeof ( *av ) );
+ memset ( source, 0, sizeof ( *source ) );
/* Extract LRH */
if ( iob_len ( iobuf ) < sizeof ( *lrh ) ) {
}
lrh = iobuf->data;
iob_pull ( iobuf, sizeof ( *lrh ) );
- av->lid = ntohs ( lrh->slid );
- av->sl = ( lrh->sl__lnh >> 4 );
+ source->lid = ntohs ( lrh->slid );
+ source->sl = ( lrh->sl__lnh >> 4 );
lnh = ( lrh->sl__lnh & 0x3 );
lid = ntohs ( lrh->dlid );
}
grh = iobuf->data;
iob_pull ( iobuf, sizeof ( *grh ) );
- av->gid_present = 1;
- memcpy ( &av->gid, &grh->sgid, sizeof ( av->gid ) );
+ source->gid_present = 1;
+ memcpy ( &source->gid, &grh->sgid, sizeof ( source->gid ) );
} else {
grh = NULL;
}
}
deth = iobuf->data;
iob_pull ( iobuf, sizeof ( *deth ) );
- av->qpn = ntohl ( deth->src_qp );
- av->qkey = ntohl ( deth->qkey );
+ source->qpn = ntohl ( deth->src_qp );
+ source->qkey = ntohl ( deth->qkey );
/* Calculate payload length, if applicable */
if ( payload_len ) {
DBGC2 ( ibdev, "IBDEV %p RX %04x:%08lx <= %04x:%08lx (key %08x)\n",
ibdev, lid, ( IB_LID_MULTICAST( lid ) ?
( qp ? (*qp)->ext_qpn : -1UL ) : qpn ),
- av->lid, av->qpn, ntohl ( deth->qkey ) );
+ source->lid, source->qpn, ntohl ( deth->qkey ) );
DBGCP_HDA ( ibdev, 0,
( iobuf->data - ( orig_iob_len - iob_len ( iobuf ) ) ),
( orig_iob_len - iob_len ( iobuf ) ) );