aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2014-11-19 04:28:18 -0500
committerRoland Dreier <roland@purestorage.com>2014-12-15 21:10:12 -0500
commitc1bd6cde8efda081af9d4f1fa4105e114b9b5cf5 (patch)
tree3374711c724285b21df1c912d8d63b8cbd2730c5
parent70e71ca0af244f48a5dcf56dc435243792e3a495 (diff)
IB/core: Do not resolve VLAN if already resolved
For RoCE, resolution of layer 2 address attributes forces no VLAN if link-local GIDs are used. This patch allows applications to choose the VLAN ID for link-local based RoCE GIDs by setting IB_QP_VID in their QP attribute mask, and prevents the core from overriding this choice. Cc: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/core/verbs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index c2b89cc5dbca..f93eb8da7b5a 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -879,7 +879,8 @@ int ib_resolve_eth_l2_attrs(struct ib_qp *qp,
879 if (rdma_link_local_addr((struct in6_addr *)qp_attr->ah_attr.grh.dgid.raw)) { 879 if (rdma_link_local_addr((struct in6_addr *)qp_attr->ah_attr.grh.dgid.raw)) {
880 rdma_get_ll_mac((struct in6_addr *)qp_attr->ah_attr.grh.dgid.raw, qp_attr->ah_attr.dmac); 880 rdma_get_ll_mac((struct in6_addr *)qp_attr->ah_attr.grh.dgid.raw, qp_attr->ah_attr.dmac);
881 rdma_get_ll_mac((struct in6_addr *)sgid.raw, qp_attr->smac); 881 rdma_get_ll_mac((struct in6_addr *)sgid.raw, qp_attr->smac);
882 qp_attr->vlan_id = rdma_get_vlan_id(&sgid); 882 if (!(*qp_attr_mask & IB_QP_VID))
883 qp_attr->vlan_id = rdma_get_vlan_id(&sgid);
883 } else { 884 } else {
884 ret = rdma_addr_find_dmac_by_grh(&sgid, &qp_attr->ah_attr.grh.dgid, 885 ret = rdma_addr_find_dmac_by_grh(&sgid, &qp_attr->ah_attr.grh.dgid,
885 qp_attr->ah_attr.dmac, &qp_attr->vlan_id); 886 qp_attr->ah_attr.dmac, &qp_attr->vlan_id);