From owner-svn-src-stable-11@freebsd.org Thu Aug 2 08:24:46 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E891D105DD4F; Thu, 2 Aug 2018 08:24:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DE417B1A3; Thu, 2 Aug 2018 08:24:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FA33728C; Thu, 2 Aug 2018 08:24:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w728OjiJ044805; Thu, 2 Aug 2018 08:24:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w728OjGH044804; Thu, 2 Aug 2018 08:24:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201808020824.w728OjGH044804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 2 Aug 2018 08:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r337087 - stable/11/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 337087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Aug 2018 08:24:46 -0000 Author: hselasky Date: Thu Aug 2 08:24:45 2018 New Revision: 337087 URL: https://svnweb.freebsd.org/changeset/base/337087 Log: MFC r336382: Depend on IPv6 stack to resolve link local address for RoCEv2 in ibcore. RoCEv1 does not use the IPv6 stack to resolve the link local DGID since it uses GID address. It forms the DMAC directly from the DGID. Linux commit: 56d0a7d9a0f045ee27a001762deac28c7d28e2e4 Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_verbs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_verbs.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/ib_verbs.c Thu Aug 2 08:23:54 2018 (r337086) +++ stable/11/sys/ofed/drivers/infiniband/core/ib_verbs.c Thu Aug 2 08:24:45 2018 (r337087) @@ -1160,7 +1160,10 @@ EXPORT_SYMBOL(ib_modify_qp_is_ok); int ib_resolve_eth_dmac(struct ib_device *device, struct ib_ah_attr *ah_attr) { - int ret = 0; + struct ib_gid_attr sgid_attr; + union ib_gid sgid; + int hop_limit; + int ret; if (ah_attr->port_num < rdma_start_port(device) || ah_attr->port_num > rdma_end_port(device)) @@ -1169,35 +1172,22 @@ int ib_resolve_eth_dmac(struct ib_device *device, if (!rdma_cap_eth_ah(device, ah_attr->port_num)) return 0; - if (rdma_link_local_addr((struct in6_addr *)ah_attr->grh.dgid.raw)) { - rdma_get_ll_mac((struct in6_addr *)ah_attr->grh.dgid.raw, - ah_attr->dmac); - } else { - union ib_gid sgid; - struct ib_gid_attr sgid_attr; - int hop_limit; + ret = ib_query_gid(device, + ah_attr->port_num, + ah_attr->grh.sgid_index, + &sgid, &sgid_attr); + if (ret != 0) + return (ret); + if (!sgid_attr.ndev) + return -ENXIO; - ret = ib_query_gid(device, - ah_attr->port_num, - ah_attr->grh.sgid_index, - &sgid, &sgid_attr); + ret = rdma_addr_find_l2_eth_by_grh(&sgid, + &ah_attr->grh.dgid, + ah_attr->dmac, + sgid_attr.ndev, &hop_limit); + dev_put(sgid_attr.ndev); - if (ret || !sgid_attr.ndev) { - if (!ret) - ret = -ENXIO; - goto out; - } - - ret = rdma_addr_find_l2_eth_by_grh(&sgid, - &ah_attr->grh.dgid, - ah_attr->dmac, - sgid_attr.ndev, &hop_limit); - - dev_put(sgid_attr.ndev); - - ah_attr->grh.hop_limit = hop_limit; - } -out: + ah_attr->grh.hop_limit = hop_limit; return ret; } EXPORT_SYMBOL(ib_resolve_eth_dmac);