Skip to contentSkip to conversation

vmw_pvrdma: Add L2 MAC resolution for UD QPs

PATCH Applied Adit Ranadive 3 participants 3 messages Aug 10, 2017 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vmw_pvrdma: Add L2 MAC resolution for UD QPs

From: Bryan Tan <[email protected]>

From: Bryan Tan <[email protected]>

Use a libibverbs function to resolve the destination MAC address for a non-default GID in UD QPs.

---
 providers/vmw_pvrdma/verbs.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
providers/vmw_pvrdma/verbs.c +9 -1
index 1bb1634..852aced 100644
@@ -186,6 +186,7 @@ struct ibv_ah *pvrdma_create_ah(struct ibv_pd *pd,
 	struct pvrdma_ah *ah;
 	struct pvrdma_av *av;
 	struct ibv_port_attr port_attr;
+	uint16_t vlan_id;
 
 	if (!attr->is_global)
 		return NULL;
@@ -216,7 +217,14 @@ struct ibv_ah *pvrdma_create_ah(struct ibv_pd *pd,
 	av->sl_tclass_flowlabel = (attr->grh.traffic_class << 20) |
 				   attr->grh.flow_label;
 	memcpy(av->dgid, attr->grh.dgid.raw, 16);
-	set_mac_from_gid(&attr->grh.dgid, av->dmac);
+
+	if (ibv_resolve_eth_l2_from_gid(pd->context, attr,
+					av->dmac, &vlan_id)) {
+		free(ah);
+		return NULL;
+	} else {
+		set_mac_from_gid(&attr->grh.dgid, av->dmac);
+	}
 
 	return &ah->ibv_ah;
 }
Signature · 6 lines
2.7.4

--
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

A message that is not in the archive (sent off-list or not yet received): 1502345099-6534-1-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org

#3 lore raw
In reply to a message not in the archive
Quoted 5 lines · Adit Ranadive

From: Bryan Tan <[email protected]>

From: Bryan Tan <[email protected]>

Use a libibverbs function to resolve the destination MAC address

s/libibverbs/ibverbs

Quoted 43 lines

for a non-default GID in UD QPs.

---
 providers/vmw_pvrdma/verbs.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
providers/vmw_pvrdma/verbs.c +9 -1
index 1bb1634..852aced 100644
@@ -186,6 +186,7 @@ struct ibv_ah *pvrdma_create_ah(struct ibv_pd *pd,
 	struct pvrdma_ah *ah;
 	struct pvrdma_av *av;
 	struct ibv_port_attr port_attr;
+	uint16_t vlan_id;
 
 	if (!attr->is_global)
 		return NULL;
@@ -216,7 +217,14 @@ struct ibv_ah *pvrdma_create_ah(struct ibv_pd *pd,
 	av->sl_tclass_flowlabel = (attr->grh.traffic_class << 20) |
 				   attr->grh.flow_label;
 	memcpy(av->dgid, attr->grh.dgid.raw, 16);
-	set_mac_from_gid(&attr->grh.dgid, av->dmac);
+
+	if (ibv_resolve_eth_l2_from_gid(pd->context, attr,
+					av->dmac, &vlan_id)) {
+		free(ah);
+		return NULL;
+	} else {
+		set_mac_from_gid(&attr->grh.dgid, av->dmac);
+	}
 
 	return &ah->ibv_ah;
 }
Signature · 6 lines
2.7.4

--
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

--
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