diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2011-12-11 16:44:13 +0200 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-03-23 14:44:09 -0700 |
commit | 39d3d19b4f0f01f3fe173c0f777e7a078f5c3dc6 (patch) | |
tree | 8fd4b5ea619a11148737d5db42876726856a1f3d | |
parent | 8145c59c81b8d829e26f98dcc007431a7590ba71 (diff) | |
download | libmlx4-39d3d19b4f0f01f3fe173c0f777e7a078f5c3dc6.tar.gz |
Add link_layer field to mlx4 QPs
The link layer field is to be used in few flows, including some
fast-path operations such as CQ polling.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r-- | src/mlx4.h | 2 | ||||
-rw-r--r-- | src/verbs.c | 8 |
2 files changed, 10 insertions, 0 deletions
@@ -223,6 +223,8 @@ struct mlx4_qp { uint32_t *db; struct mlx4_wq rq; + + uint8_t link_layer; }; struct mlx4_av { diff --git a/src/verbs.c b/src/verbs.c index 199d107..f5f870d 100644 --- a/src/verbs.c +++ b/src/verbs.c @@ -521,8 +521,16 @@ int mlx4_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, int attr_mask) { struct ibv_modify_qp cmd; + struct ibv_port_attr port_attr; + struct mlx4_qp *mqp = to_mqp(qp); int ret; + if (attr_mask & IBV_QP_PORT) { + if (ibv_query_port(qp->pd->context, attr->port_num, &port_attr)) + return -1; + mqp->link_layer = port_attr.link_layer; + } + if (qp->state == IBV_QPS_RESET && attr_mask & IBV_QP_STATE && attr->qp_state == IBV_QPS_INIT) { |