public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Doug Ledford <dledford@redhat•com>, Jason Gunthorpe <jgg@mellanox•com>
Cc: David Miller <davem@davemloft•net>,
	Networking <netdev@vger•kernel.org>,
	Linux-Next Mailing List <linux-next@vger•kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Parav Pandit <parav@mellanox•com>
Subject: Re: linux-next: manual merge of the net-next tree with the rdma tree
Date: Thu, 16 Aug 2018 09:41:22 +1000	[thread overview]
Message-ID: <20180816094122.5db6dc79@canb.auug.org.au> (raw)
In-Reply-To: <20180702102106.4ac2bd17@canb.auug.org.au>

[-- Attachment #1: Type: text/plain, Size: 3698 bytes --]

Hi all,

On Mon, 2 Jul 2018 10:21:06 +1000 Stephen Rothwell <sfr@canb•auug.org.au> wrote:
>
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   net/smc/smc_ib.c
> 
> between commit:
> 
>   ddb457c6993b ("net/smc: Replace ib_query_gid with rdma_get_gid_attr")
> 
> from the rdma tree and commit:
> 
>   be6a3f38ff2a ("net/smc: determine port attributes independent from pnet table")
> 
> from the net-next tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc net/smc/smc_ib.c
> index 74f29f814ec1,36de2fd76170..000000000000
> --- a/net/smc/smc_ib.c
> +++ b/net/smc/smc_ib.c
> @@@ -144,6 -143,62 +144,66 @@@ out
>   	return rc;
>   }
>   
> + static int smc_ib_fill_gid_and_mac(struct smc_ib_device *smcibdev, u8 ibport)
> + {
>  -	struct ib_gid_attr gattr;
>  -	int rc;
>  -
>  -	rc = ib_query_gid(smcibdev->ibdev, ibport, 0,
>  -			  &smcibdev->gid[ibport - 1], &gattr);
>  -	if (rc || !gattr.ndev)
>  -		return -ENODEV;
> ++	const struct ib_gid_attr *gattr;
> ++	int rc = 0;
> + 
>  -	memcpy(smcibdev->mac[ibport - 1], gattr.ndev->dev_addr, ETH_ALEN);
>  -	dev_put(gattr.ndev);
>  -	return 0;
> ++	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;
> + }
> + 
> + /* Create an identifier unique for this instance of SMC-R.
> +  * The MAC-address of the first active registered IB device
> +  * plus a random 2-byte number is used to create this identifier.
> +  * This name is delivered to the peer during connection initialization.
> +  */
> + static inline void smc_ib_define_local_systemid(struct smc_ib_device *smcibdev,
> + 						u8 ibport)
> + {
> + 	memcpy(&local_systemid[2], &smcibdev->mac[ibport - 1],
> + 	       sizeof(smcibdev->mac[ibport - 1]));
> + 	get_random_bytes(&local_systemid[0], 2);
> + }
> + 
> + bool smc_ib_port_active(struct smc_ib_device *smcibdev, u8 ibport)
> + {
> + 	return smcibdev->pattr[ibport - 1].state == IB_PORT_ACTIVE;
> + }
> + 
> + static int smc_ib_remember_port_attr(struct smc_ib_device *smcibdev, u8 ibport)
> + {
> + 	int rc;
> + 
> + 	memset(&smcibdev->pattr[ibport - 1], 0,
> + 	       sizeof(smcibdev->pattr[ibport - 1]));
> + 	rc = ib_query_port(smcibdev->ibdev, ibport,
> + 			   &smcibdev->pattr[ibport - 1]);
> + 	if (rc)
> + 		goto out;
> + 	/* the SMC protocol requires specification of the RoCE MAC address */
> + 	rc = smc_ib_fill_gid_and_mac(smcibdev, ibport);
> + 	if (rc)
> + 		goto out;
> + 	if (!strncmp(local_systemid, SMC_LOCAL_SYSTEMID_RESET,
> + 		     sizeof(local_systemid)) &&
> + 	    smc_ib_port_active(smcibdev, ibport))
> + 		/* create unique system identifier */
> + 		smc_ib_define_local_systemid(smcibdev, ibport);
> + out:
> + 	return rc;
> + }
> + 
>   /* process context wrapper for might_sleep smc_ib_remember_port_attr */
>   static void smc_ib_port_event_work(struct work_struct *work)
>   {

This is now a conflict between Linus' tree and the rdma tree.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-08-15 23:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02  0:21 linux-next: manual merge of the net-next tree with the rdma tree Stephen Rothwell
2018-08-15 23:41 ` Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-07-27  2:33 Stephen Rothwell
2018-07-27  2:48 ` Jason Gunthorpe
2018-07-27  3:28   ` Stephen Rothwell
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
2018-08-02  2:05 Stephen Rothwell
2018-08-15 23:45 ` Stephen Rothwell
2019-02-18  0:05 Stephen Rothwell
2019-02-18 10:48 ` Leon Romanovsky
2019-02-27  0:25 Stephen Rothwell
2019-02-27 16:24 ` Doug Ledford
2019-02-28  9:05   ` Leon Romanovsky
2019-06-20  2:15 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
2021-10-19 23:34 Stephen Rothwell
2021-10-28  0:56 Stephen Rothwell
2021-10-28  7:48 ` Saeed Mahameed
2025-09-11  2:26 Stephen Rothwell
2025-09-19 12:45 Mark Brown
2026-03-30 15:02 Mark Brown

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=20180816094122.5db6dc79@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=davem@davemloft$(echo .)net \
    --cc=dledford@redhat$(echo .)com \
    --cc=jgg@mellanox$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=parav@mellanox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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