From patchwork Wed Feb 6 09:32:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10798915 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A48113B4 for ; Wed, 6 Feb 2019 09:32:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 193352ABDC for ; Wed, 6 Feb 2019 09:32:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0DAE02ABDF; Wed, 6 Feb 2019 09:32:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3EEA2ABDC for ; Wed, 6 Feb 2019 09:32:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728654AbfBFJc2 (ORCPT ); Wed, 6 Feb 2019 04:32:28 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40282 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726715AbfBFJc1 (ORCPT ); Wed, 6 Feb 2019 04:32:27 -0500 Received: by mail-wr1-f68.google.com with SMTP id p4so6709558wrt.7 for ; Wed, 06 Feb 2019 01:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d2qOwEz4utoafjPvr9slPu2GU20vkfVj6TzDnHiGhJw=; b=JvTbxnrleYTcU5pmGXCAOMd/GWOOp9Li+foYfMZ7H+YAU8laLPpyF2TEB3Peh+LLPV tkyP4VvwX9U38CzFpaupJrUHOyaCfuiFPSnDdaHqfu9gMKEMNO0F1IqbBYaEm5cWe0I5 xU3Bs4TpTE/n0eKd4PfFwcX+WDz8AVjGwqGnzYX8ms05IZPLXQ+HqnjYNGAn2L+vphji PWPbTRafguqeo6RUZuPv11GhK5NDCQwxhDGsMYPxSokVS8bgW6+hxBpTKa/IAP4ihiB1 NbU2KgpnopMJI9rRukYvycYueWM2TYG1Dhb747WciZ/WryxK8PQEcrboLiZjYw7Jf4vv TYAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d2qOwEz4utoafjPvr9slPu2GU20vkfVj6TzDnHiGhJw=; b=OPF8UcqBo/+IjcVYyoVG0e+OylN+fxpHnYKdRQzPxD0YYoxTCbvzRUPD+QGKbm9aYz 7uScHyLPMVrw4nr5AXcge7I39rogbi4lHVc/2ucg4GNcx96A9viEesOOzBcC0Hc2IlP2 faKTeIJ2Q7HORMVDQ8BEfhEJLdRLbjG1KU8NojLWBHLXTEh/qGyE1LAT6F3LZ+6gusoA k3d9nlpHzEuHu2bvzc85ycaM5+ianhq9XZqlfLWKM1+suNwWGGc6i1JmrQB/toZs5aTR D5/MyDcFQogcVEDpawSl06x/zpFN91hdb41a4KPCIn8Hni0e4VdHmnv6MZREBfyT8JxK dTHw== X-Gm-Message-State: AHQUAua2FNwsQVwvSMgdZzvJiGQXicS06SYUF7V9vccjj8PabDCDPwKl xcwzrNh38gWgzhnQ8pXzvsHhFo/c X-Google-Smtp-Source: AHgI3IaezjcLimXahnzqt/TqEq5Zt9xOUtwQchxYo1omqK5x+osbWxsCTJ6KOpNS4UGXQzK0DB0jPA== X-Received: by 2002:a5d:614c:: with SMTP id y12mr4571130wrt.106.1549445545692; Wed, 06 Feb 2019 01:32:25 -0800 (PST) Received: from kheib-workstation.redhat.com ([192.116.94.216]) by smtp.gmail.com with ESMTPSA id z5sm1783556wmi.15.2019.02.06.01.32.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Feb 2019 01:32:25 -0800 (PST) From: Kamal Heib To: linux-rdma@vger.kernel.org Cc: Yuval Shaia , Marcel Apfelbaum , Kamal Heib Subject: [PATCH rdma-core 3/3] rxe: Resolve destination MAC address when creating AH Date: Wed, 6 Feb 2019 11:32:05 +0200 Message-Id: <20190206093205.7667-4-kamalheib1@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206093205.7667-1-kamalheib1@gmail.com> References: <20190206093205.7667-1-kamalheib1@gmail.com> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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))) {