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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 providers/rxe/rxe.c | 4 ++++
 1 file changed, 4 insertions(+)

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))) {
-- 
2.20.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux