From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: David Miller <davem@davemloft.net>,
Networking <netdev@vger.kernel.org>,
Doug Ledford <dledford@redhat.com>,
Linux-Next Mailing List <linux-next@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Parav Pandit <parav@mellanox.com>,
Ursula Braun <ubraun@linux.ibm.com>,
Leon Romanovsky <leonro@mellanox.com>,
linux-rdma@vger.kernel.org
Subject: Re: linux-next: manual merge of the net-next tree with the rdma tree
Date: Fri, 27 Jul 2018 13:28:47 +1000 [thread overview]
Message-ID: <20180727132847.2be8563b@canb.auug.org.au> (raw)
In-Reply-To: <20180727024832.GA30023@mellanox.com>
[-- Attachment #1: Type: text/plain, Size: 3940 bytes --]
Hi Jason,
On Thu, 26 Jul 2018 20:48:32 -0600 Jason Gunthorpe <jgg@mellanox.com> wrote:
>
> On Fri, Jul 27, 2018 at 12:33:01PM +1000, Stephen Rothwell wrote:
>
> > I fixed it up (I wasn't sure how to fix this up as so much has changed
> > in the net-next tree and both modified functions had been (re)moved,
> > so I effectively reverted the rdma tree commit) and can carry the fix
> > as necessary. Please come to some arrangement about this.
>
> How does that still compile? We removed ib_query_gid() from the rdma
> tree and replaced it with rdma_get_gid_attr()..
Yeah, it doesn't :-(
> I think the merge resolution is going to be a bit nasty to absorb
> that much changing..
>
> Perhaps we should add a compatability ib_query_gid back to the RDMA
> tree and then send DaveM a commit to fix SMC and remove it during the
> next cycle? Linus can resolve smc_ib.c by using the net version
>
> Does someone else have a better idea?
I applied this merge fix patch:
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 27 Jul 2018 13:19:31 +1000
Subject: [PATCH] net/smc: fixups for ip_query_gid API removal
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
net/smc/smc_ib.c | 47 +++++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 22 deletions(-)
diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c
index 2cc64bc8ae20..debc6e44f738 100644
--- a/net/smc/smc_ib.c
+++ b/net/smc/smc_ib.c
@@ -16,6 +16,7 @@
#include <linux/workqueue.h>
#include <linux/scatterlist.h>
#include <rdma/ib_verbs.h>
+#include <rdma/ib_cache.h>
#include "smc_pnet.h"
#include "smc_ib.h"
@@ -144,17 +145,21 @@ int smc_ib_ready_link(struct smc_link *lnk)
static int smc_ib_fill_mac(struct smc_ib_device *smcibdev, u8 ibport)
{
- struct ib_gid_attr gattr;
- union ib_gid gid;
- int rc;
+ const struct ib_gid_attr *gattr;
+ int rc = 0;
- rc = ib_query_gid(smcibdev->ibdev, ibport, 0, &gid, &gattr);
- if (rc || !gattr.ndev)
- return -ENODEV;
+ gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, 0);
+ if (IS_ERR(gattr))
+ return PTR_ERR(gattr);
+ if (!gattr->ndev) {
+ rc = -ENODEV;
+ goto done;
+ }
- memcpy(smcibdev->mac[ibport - 1], gattr.ndev->dev_addr, ETH_ALEN);
- dev_put(gattr.ndev);
- return 0;
+ memcpy(smcibdev->mac[ibport - 1], gattr->ndev->dev_addr, ETH_ALEN);
+done:
+ rdma_put_gid_attr(gattr);
+ return rc;
}
/* Create an identifier unique for this instance of SMC-R.
@@ -179,29 +184,27 @@ bool smc_ib_port_active(struct smc_ib_device *smcibdev, u8 ibport)
int smc_ib_determine_gid(struct smc_ib_device *smcibdev, u8 ibport,
unsigned short vlan_id, u8 gid[], u8 *sgid_index)
{
- struct ib_gid_attr gattr;
- union ib_gid _gid;
+ const struct ib_gid_attr *gattr;
int i;
for (i = 0; i < smcibdev->pattr[ibport - 1].gid_tbl_len; i++) {
- memset(&_gid, 0, SMC_GID_SIZE);
- memset(&gattr, 0, sizeof(gattr));
- if (ib_query_gid(smcibdev->ibdev, ibport, i, &_gid, &gattr))
+ gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, i);
+ if (IS_ERR(gattr))
continue;
- if (!gattr.ndev)
+ if (!gattr->ndev)
continue;
- if (((!vlan_id && !is_vlan_dev(gattr.ndev)) ||
- (vlan_id && is_vlan_dev(gattr.ndev) &&
- vlan_dev_vlan_id(gattr.ndev) == vlan_id)) &&
- gattr.gid_type == IB_GID_TYPE_IB) {
+ if (((!vlan_id && !is_vlan_dev(gattr->ndev)) ||
+ (vlan_id && is_vlan_dev(gattr->ndev) &&
+ vlan_dev_vlan_id(gattr->ndev) == vlan_id)) &&
+ gattr->gid_type == IB_GID_TYPE_IB) {
if (gid)
- memcpy(gid, &_gid, SMC_GID_SIZE);
+ memcpy(gid, &gattr->gid, SMC_GID_SIZE);
if (sgid_index)
*sgid_index = i;
- dev_put(gattr.ndev);
+ rdma_put_gid_attr(gattr);
return 0;
}
- dev_put(gattr.ndev);
+ rdma_put_gid_attr(gattr);
}
return -ENODEV;
}
--
2.18.0
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2018-07-27 3:28 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-27 2:33 linux-next: manual merge of the net-next tree with the rdma tree Stephen Rothwell
2018-07-27 2:48 ` Jason Gunthorpe
2018-07-27 3:28 ` Stephen Rothwell [this message]
2018-07-27 3:45 ` Stephen Rothwell
2018-07-27 5:03 ` Parav Pandit
2018-07-27 4:57 ` Parav Pandit
2018-07-27 5:09 ` Stephen Rothwell
2018-07-31 21:12 ` Parav Pandit
2018-08-01 5:33 ` Stephen Rothwell
2018-08-01 17:13 ` Jason Gunthorpe
2018-08-01 18:30 ` Parav Pandit
-- strict thread matches above, loose matches on Subject: below --
2021-10-28 0:56 Stephen Rothwell
2021-10-28 7:48 ` Saeed Mahameed
2021-10-19 23:34 Stephen Rothwell
2020-05-08 3:18 Stephen Rothwell
2020-05-08 12:35 ` Jason Gunthorpe
2020-05-09 7:49 ` Saeed Mahameed
2020-05-09 7:40 ` Saeed Mahameed
2019-06-20 2:15 Stephen Rothwell
2019-02-27 0:25 Stephen Rothwell
2019-02-27 16:24 ` Doug Ledford
2019-02-28 9:05 ` Leon Romanovsky
2019-02-18 0:05 Stephen Rothwell
2019-02-18 10:48 ` Leon Romanovsky
2018-08-02 2:05 Stephen Rothwell
2018-08-15 23:45 ` Stephen Rothwell
2018-07-02 0:21 Stephen Rothwell
2018-08-15 23:41 ` Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180727132847.2be8563b@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=davem@davemloft.net \
--cc=dledford@redhat.com \
--cc=jgg@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=parav@mellanox.com \
--cc=ubraun@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).