From 92f4e77c85918eab5e5803d7e28ab89a7e6bd3a2 Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Wed, 15 Aug 2018 16:52:58 -0600 Subject: Revert "net/smc: Replace ib_query_gid with rdma_get_gid_attr" This reverts commit ddb457c6993babbcdd41fca638b870d2a2fc3941. The include rdma/ib_cache.h is kept, and we have to add a memset to the compat wrapper to avoid compiler warnings in gcc-7 This revert is done to avoid extensive merge conflicts with SMC changes in netdev during the 4.19 merge window. Signed-off-by: Jason Gunthorpe --- net/smc/smc_core.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'net/smc/smc_core.c') diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index d99a75f75e42..15bad268f37d 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -451,7 +451,8 @@ out: static int smc_link_determine_gid(struct smc_link_group *lgr) { struct smc_link *lnk = &lgr->lnk[SMC_SINGLE_LINK]; - const struct ib_gid_attr *gattr; + struct ib_gid_attr gattr; + union ib_gid gid; int i; if (!lgr->vlan_id) { @@ -461,18 +462,18 @@ static int smc_link_determine_gid(struct smc_link_group *lgr) for (i = 0; i < lnk->smcibdev->pattr[lnk->ibport - 1].gid_tbl_len; i++) { - gattr = rdma_get_gid_attr(lnk->smcibdev->ibdev, lnk->ibport, i); - if (IS_ERR(gattr)) + if (ib_query_gid(lnk->smcibdev->ibdev, lnk->ibport, i, &gid, + &gattr)) continue; - if (gattr->ndev) { - if (is_vlan_dev(gattr->ndev) && - vlan_dev_vlan_id(gattr->ndev) == lgr->vlan_id) { - lnk->gid = gattr->gid; - rdma_put_gid_attr(gattr); + if (gattr.ndev) { + if (is_vlan_dev(gattr.ndev) && + vlan_dev_vlan_id(gattr.ndev) == lgr->vlan_id) { + lnk->gid = gid; + dev_put(gattr.ndev); return 0; } + dev_put(gattr.ndev); } - rdma_put_gid_attr(gattr); } return -ENODEV; } -- cgit v1.2.3