diff mbox series

[rdma-core,3/3] rxe: Resolve destination MAC address when creating AH

Message ID 20190206093205.7667-4-kamalheib1@gmail.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series librxe: Resolve dmac when creating AH | expand

Commit Message

Kamal Heib Feb. 6, 2019, 9:32 a.m. UTC
Add support for resolving the destination MAC address when creating the AH.
The dmac will be used by the driver to mark loopback packets if the
dmac and the smac are equal.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
 providers/rxe/rxe.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/providers/rxe/rxe.c b/providers/rxe/rxe.c
index 857ea0981321..4c21a4a44451 100644
--- a/providers/rxe/rxe.c
+++ b/providers/rxe/rxe.c
@@ -802,6 +802,10 @@  static struct ibv_ah *rxe_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr)
 
 	rdma_gid2ip(&av->sgid_addr, &sgid);
 	rdma_gid2ip(&av->dgid_addr, &attr->grh.dgid);
+	if (ibv_resolve_eth_l2_from_gid(pd->context, attr, av->dmac, NULL)) {
+		free(ah);
+		return NULL;
+	}
 
 	memset(&resp, 0, sizeof(resp));
 	if (ibv_cmd_create_ah(pd, &ah->ibv_ah, attr, &resp, sizeof(resp))) {