From: Moni Shoua <[email protected]>

For RoCE, resolution of layer 2 address attributes forces no VLAN if link local
gids are used. This patch enables applications that want to choose VLAN ID for
link local based RoCE gids by setting IB_QP_VID in their QP attribute mask and
prevent the core to override this choice.

Cc: Ursula Braun <[email protected]>
Signed-off-by: Moni Shoua <[email protected]>
Signed-off-by: Or Gerlitz <[email protected]>
---
 drivers/infiniband/core/verbs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index c2b89cc..f93eb8d 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,
                if (rdma_link_local_addr((struct in6_addr 
*)qp_attr->ah_attr.grh.dgid.raw)) {
                        rdma_get_ll_mac((struct in6_addr 
*)qp_attr->ah_attr.grh.dgid.raw, qp_attr->ah_attr.dmac);
                        rdma_get_ll_mac((struct in6_addr *)sgid.raw, 
qp_attr->smac);
-                       qp_attr->vlan_id = rdma_get_vlan_id(&sgid);
+                       if (!(*qp_attr_mask & IB_QP_VID))
+                               qp_attr->vlan_id = rdma_get_vlan_id(&sgid);
                } else {
                        ret = rdma_addr_find_dmac_by_grh(&sgid, 
&qp_attr->ah_attr.grh.dgid,
                                        qp_attr->ah_attr.dmac, 
&qp_attr->vlan_id);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to