diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-08-15 16:52:58 -0600 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-08-16 14:03:34 -0600 |
commit | 92f4e77c85918eab5e5803d7e28ab89a7e6bd3a2 (patch) | |
tree | 70ce3b5c8152fc5e92043e6c0d2ef4bc00678408 /net/smc/smc_ib.c | |
parent | 89982f7ccee2fcd8fea7936b81eec6defbf0f131 (diff) | |
download | linux-92f4e77c85918eab5e5803d7e28ab89a7e6bd3a2.tar.gz linux-92f4e77c85918eab5e5803d7e28ab89a7e6bd3a2.tar.bz2 linux-92f4e77c85918eab5e5803d7e28ab89a7e6bd3a2.zip |
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 <jgg@mellanox.com>
Diffstat (limited to 'net/smc/smc_ib.c')
-rw-r--r-- | net/smc/smc_ib.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c index 74f29f814ec1..117b05f1a494 100644 --- a/net/smc/smc_ib.c +++ b/net/smc/smc_ib.c @@ -373,21 +373,17 @@ void smc_ib_buf_unmap_sg(struct smc_ib_device *smcibdev, static int smc_ib_fill_gid_and_mac(struct smc_ib_device *smcibdev, u8 ibport) { - const struct ib_gid_attr *gattr; - int rc = 0; + struct ib_gid_attr gattr; + int rc; - gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, 0); - if (IS_ERR(gattr)) - return PTR_ERR(gattr); - if (!gattr->ndev) { - rc = -ENODEV; - goto done; - } - smcibdev->gid[ibport - 1] = gattr->gid; - memcpy(smcibdev->mac[ibport - 1], gattr->ndev->dev_addr, ETH_ALEN); -done: - rdma_put_gid_attr(gattr); - return rc; + rc = ib_query_gid(smcibdev->ibdev, ibport, 0, + &smcibdev->gid[ibport - 1], &gattr); + if (rc || !gattr.ndev) + return -ENODEV; + + memcpy(smcibdev->mac[ibport - 1], gattr.ndev->dev_addr, ETH_ALEN); + dev_put(gattr.ndev); + return 0; } /* Create an identifier unique for this instance of SMC-R. |