summaryrefslogtreecommitdiffstats
path: root/src/drivers/infiniband/hermon.c
diff options
context:
space:
mode:
authorMichael Brown2012-08-31 01:47:37 +0200
committerMichael Brown2012-08-31 22:22:58 +0200
commitcbe41cb31be10edc234e96cf4291245c21272a57 (patch)
tree726646b6d2002dd10a3577ee120f8d27b5726484 /src/drivers/infiniband/hermon.c
parent[infiniband] Allow queue pairs to have a custom allocator for receive iobufs (diff)
downloadipxe-cbe41cb31be10edc234e96cf4291245c21272a57.tar.gz
ipxe-cbe41cb31be10edc234e96cf4291245c21272a57.tar.xz
ipxe-cbe41cb31be10edc234e96cf4291245c21272a57.zip
[infiniband] Use explicit "source" and "dest" address vector parameter names
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/infiniband/hermon.c')
-rw-r--r--src/drivers/infiniband/hermon.c85
1 files changed, 43 insertions, 42 deletions
diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c
index ff95e95f4..7849b1433 100644
--- a/src/drivers/infiniband/hermon.c
+++ b/src/drivers/infiniband/hermon.c
@@ -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;