2018-03-16 00:58:42

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the net-next tree with the rdma-fixes tree

Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

drivers/infiniband/hw/mlx5/main.c

between commit:

42cea83f9524 ("IB/mlx5: Fix cleanup order on unload")

from the rdma-fixes tree and commit:

b5ca15ad7e61 ("IB/mlx5: Add proper representors support")

from the net-next tree.

I fixed it up (see below and the merge fix patch as well) 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.

From: Stephen Rothwell <[email protected]>
Date: Fri, 16 Mar 2018 11:54:01 +1100
Subject: [PATCH] IB/mlx5: merge fix for "Fix cleanup order on unload"

Signed-off-by: Stephen Rothwell <[email protected]>
---
drivers/infiniband/hw/mlx5/ib_rep.c | 6 +++---
drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 +--
2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c
index 61cc3d7db257..7fb997dadd80 100644
--- a/drivers/infiniband/hw/mlx5/ib_rep.c
+++ b/drivers/infiniband/hw/mlx5/ib_rep.c
@@ -33,9 +33,9 @@ static const struct mlx5_ib_profile rep_profile = {
STAGE_CREATE(MLX5_IB_STAGE_IB_REG,
mlx5_ib_stage_ib_reg_init,
mlx5_ib_stage_ib_reg_cleanup),
- STAGE_CREATE(MLX5_IB_STAGE_UMR_RESOURCES,
- mlx5_ib_stage_umr_res_init,
- mlx5_ib_stage_umr_res_cleanup),
+ STAGE_CREATE(MLX5_IB_STAGE_POST_IB_REG_UMR,
+ mlx5_ib_stage_post_ib_reg_umr_init,
+ NULL),
STAGE_CREATE(MLX5_IB_STAGE_CLASS_ATTR,
mlx5_ib_stage_class_attr_init,
NULL),
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index 7ec753ec7962..c45a7abdbe3e 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -1071,8 +1071,7 @@ int mlx5_ib_stage_bfrag_init(struct mlx5_ib_dev *dev);
void mlx5_ib_stage_bfrag_cleanup(struct mlx5_ib_dev *dev);
int mlx5_ib_stage_ib_reg_init(struct mlx5_ib_dev *dev);
void mlx5_ib_stage_ib_reg_cleanup(struct mlx5_ib_dev *dev);
-int mlx5_ib_stage_umr_res_init(struct mlx5_ib_dev *dev);
-void mlx5_ib_stage_umr_res_cleanup(struct mlx5_ib_dev *dev);
+int mlx5_ib_stage_post_ib_reg_umr_init(struct mlx5_ib_dev *dev);
int mlx5_ib_stage_class_attr_init(struct mlx5_ib_dev *dev);
void __mlx5_ib_remove(struct mlx5_ib_dev *dev,
const struct mlx5_ib_profile *profile,
--
2.16.1

--
Cheers,
Stephen Rothwell

diff --cc drivers/infiniband/hw/mlx5/main.c
index da091de4e69d,d9474b95d8e5..000000000000
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@@ -4860,19 -4999,19 +4996,19 @@@ int mlx5_ib_stage_ib_reg_init(struct ml
return ib_register_device(&dev->ib_dev, NULL);
}

-void mlx5_ib_stage_ib_reg_cleanup(struct mlx5_ib_dev *dev)
+static void mlx5_ib_stage_pre_ib_reg_umr_cleanup(struct mlx5_ib_dev *dev)
{
- ib_unregister_device(&dev->ib_dev);
+ destroy_umrc_res(dev);
}

- static void mlx5_ib_stage_ib_reg_cleanup(struct mlx5_ib_dev *dev)
-int mlx5_ib_stage_umr_res_init(struct mlx5_ib_dev *dev)
++void mlx5_ib_stage_ib_reg_cleanup(struct mlx5_ib_dev *dev)
{
- return create_umr_res(dev);
+ ib_unregister_device(&dev->ib_dev);
}

- static int mlx5_ib_stage_post_ib_reg_umr_init(struct mlx5_ib_dev *dev)
-void mlx5_ib_stage_umr_res_cleanup(struct mlx5_ib_dev *dev)
++int mlx5_ib_stage_post_ib_reg_umr_init(struct mlx5_ib_dev *dev)
{
- destroy_umrc_res(dev);
+ return create_umr_res(dev);
}

static int mlx5_ib_stage_delay_drop_init(struct mlx5_ib_dev *dev)
@@@ -4999,6 -5144,48 +5144,48 @@@ static const struct mlx5_ib_profile pf_
NULL),
};

+ static const struct mlx5_ib_profile nic_rep_profile = {
+ STAGE_CREATE(MLX5_IB_STAGE_INIT,
+ mlx5_ib_stage_init_init,
+ mlx5_ib_stage_init_cleanup),
+ STAGE_CREATE(MLX5_IB_STAGE_FLOW_DB,
+ mlx5_ib_stage_flow_db_init,
+ mlx5_ib_stage_flow_db_cleanup),
+ STAGE_CREATE(MLX5_IB_STAGE_CAPS,
+ mlx5_ib_stage_caps_init,
+ NULL),
+ STAGE_CREATE(MLX5_IB_STAGE_NON_DEFAULT_CB,
+ mlx5_ib_stage_rep_non_default_cb,
+ NULL),
+ STAGE_CREATE(MLX5_IB_STAGE_ROCE,
+ mlx5_ib_stage_rep_roce_init,
+ mlx5_ib_stage_rep_roce_cleanup),
+ STAGE_CREATE(MLX5_IB_STAGE_DEVICE_RESOURCES,
+ mlx5_ib_stage_dev_res_init,
+ mlx5_ib_stage_dev_res_cleanup),
+ STAGE_CREATE(MLX5_IB_STAGE_COUNTERS,
+ mlx5_ib_stage_counters_init,
+ mlx5_ib_stage_counters_cleanup),
+ STAGE_CREATE(MLX5_IB_STAGE_UAR,
+ mlx5_ib_stage_uar_init,
+ mlx5_ib_stage_uar_cleanup),
+ STAGE_CREATE(MLX5_IB_STAGE_BFREG,
+ mlx5_ib_stage_bfrag_init,
+ mlx5_ib_stage_bfrag_cleanup),
+ STAGE_CREATE(MLX5_IB_STAGE_IB_REG,
+ mlx5_ib_stage_ib_reg_init,
+ mlx5_ib_stage_ib_reg_cleanup),
- STAGE_CREATE(MLX5_IB_STAGE_UMR_RESOURCES,
- mlx5_ib_stage_umr_res_init,
- mlx5_ib_stage_umr_res_cleanup),
++ STAGE_CREATE(MLX5_IB_STAGE_POST_IB_REG_UMR,
++ mlx5_ib_stage_post_ib_reg_umr_init,
++ NULL),
+ STAGE_CREATE(MLX5_IB_STAGE_CLASS_ATTR,
+ mlx5_ib_stage_class_attr_init,
+ NULL),
+ STAGE_CREATE(MLX5_IB_STAGE_REP_REG,
+ mlx5_ib_stage_rep_reg_init,
+ mlx5_ib_stage_rep_reg_cleanup),
+ };
+
static void *mlx5_ib_add_slave_port(struct mlx5_core_dev *mdev, u8 port_num)
{
struct mlx5_ib_multiport_info *mpi;


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2018-03-16 01:32:53

by Doug Ledford

[permalink] [raw]
Subject: Re: linux-next: manual merge of the net-next tree with the rdma-fixes tree

On Fri, 2018-03-16 at 11:56 +1100, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
> drivers/infiniband/hw/mlx5/main.c
>
> between commit:
>
> 42cea83f9524 ("IB/mlx5: Fix cleanup order on unload")
>
> from the rdma-fixes tree and commit:
>
> b5ca15ad7e61 ("IB/mlx5: Add proper representors support")
>
> from the net-next tree.

We are aware of the merge conflict. This is a result of the fact that
code had been submitted to the for-next area (the representors support)
and after that an issue was found by the syzkaller bot that deserved rc
fix status and which conflicted. The fixup you list below is
insufficient to fix the merge conflict. The full fixup can be found in
the rdma tree from where I merged the for-rc branch into the for-next
branch and created a complete fixup of the merge conflict. The problem
is that one patch change the device init stage flow, while the other
patch duplicates the normal device init stage flow to the representor
device stage flow. To resolve the fix, you not only have to resolve the
contextual diffs, but you have to duplicate the changes to the normal
device stage flow into the representor device stage flow. It is very
far from a trivial merge. We were planning on talking to Dave about
this issue tomorrow, but you beat us to raising the issue ;-).

Here's the commit (from the rdma git repo) with the proper merge fix
(although it also has other minor merge stuff that needs to be ignored):

2d873449a202 (Merge branch 'k.o/wip/dl-for-rc' into k.o/wip/dl-for-next)

> I fixed it up (see below and the merge fix patch as well) 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.
>
> From: Stephen Rothwell <[email protected]>
> Date: Fri, 16 Mar 2018 11:54:01 +1100
> Subject: [PATCH] IB/mlx5: merge fix for "Fix cleanup order on unload"
>
> Signed-off-by: Stephen Rothwell <[email protected]>
> ---
> drivers/infiniband/hw/mlx5/ib_rep.c | 6 +++---
> drivers/infiniband/hw/mlx5/mlx5_ib.h | 3 +--
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c
> index 61cc3d7db257..7fb997dadd80 100644
> --- a/drivers/infiniband/hw/mlx5/ib_rep.c
> +++ b/drivers/infiniband/hw/mlx5/ib_rep.c
> @@ -33,9 +33,9 @@ static const struct mlx5_ib_profile rep_profile = {
> STAGE_CREATE(MLX5_IB_STAGE_IB_REG,
> mlx5_ib_stage_ib_reg_init,
> mlx5_ib_stage_ib_reg_cleanup),
> - STAGE_CREATE(MLX5_IB_STAGE_UMR_RESOURCES,
> - mlx5_ib_stage_umr_res_init,
> - mlx5_ib_stage_umr_res_cleanup),
> + STAGE_CREATE(MLX5_IB_STAGE_POST_IB_REG_UMR,
> + mlx5_ib_stage_post_ib_reg_umr_init,
> + NULL),
> STAGE_CREATE(MLX5_IB_STAGE_CLASS_ATTR,
> mlx5_ib_stage_class_attr_init,
> NULL),
> diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> index 7ec753ec7962..c45a7abdbe3e 100644
> --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
> +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> @@ -1071,8 +1071,7 @@ int mlx5_ib_stage_bfrag_init(struct mlx5_ib_dev *dev);
> void mlx5_ib_stage_bfrag_cleanup(struct mlx5_ib_dev *dev);
> int mlx5_ib_stage_ib_reg_init(struct mlx5_ib_dev *dev);
> void mlx5_ib_stage_ib_reg_cleanup(struct mlx5_ib_dev *dev);
> -int mlx5_ib_stage_umr_res_init(struct mlx5_ib_dev *dev);
> -void mlx5_ib_stage_umr_res_cleanup(struct mlx5_ib_dev *dev);
> +int mlx5_ib_stage_post_ib_reg_umr_init(struct mlx5_ib_dev *dev);
> int mlx5_ib_stage_class_attr_init(struct mlx5_ib_dev *dev);
> void __mlx5_ib_remove(struct mlx5_ib_dev *dev,
> const struct mlx5_ib_profile *profile,
> --
> 2.16.1
>

--
Doug Ledford <[email protected]>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD


Attachments:
signature.asc (849.00 B)
This is a digitally signed message part

2018-03-16 02:07:00

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: linux-next: manual merge of the net-next tree with the rdma-fixes tree

On Thu, Mar 15, 2018 at 09:18:02PM -0400, Doug Ledford wrote:

> Here's the commit (from the rdma git repo) with the proper merge fix
> (although it also has other minor merge stuff that needs to be ignored):
>
> 2d873449a202 (Merge branch 'k.o/wip/dl-for-rc' into k.o/wip/dl-for-next)

Stephen,

If you merge the branches in the order:
rdma for-next, rdma for-rc, then net-next
you should not see a merge conflict as rdma for-next already has the
correct resolution.

Jason

2018-03-16 06:55:20

by Saeed Mahameed

[permalink] [raw]
Subject: Re: linux-next: manual merge of the net-next tree with the rdma-fixes tree

On Thu, 2018-03-15 at 21:18 -0400, Doug Ledford wrote:
> On Fri, 2018-03-16 at 11:56 +1100, Stephen Rothwell wrote:
> > Hi all,
> >
> > Today's linux-next merge of the net-next tree got a conflict in:
> >
> > drivers/infiniband/hw/mlx5/main.c
> >
> > between commit:
> >
> > 42cea83f9524 ("IB/mlx5: Fix cleanup order on unload")
> >
> > from the rdma-fixes tree and commit:
> >
> > b5ca15ad7e61 ("IB/mlx5: Add proper representors support")
> >
> > from the net-next tree.
>
> We are aware of the merge conflict. This is a result of the fact
> that
> code had been submitted to the for-next area (the representors
> support)
> and after that an issue was found by the syzkaller bot that deserved
> rc
> fix status and which conflicted. The fixup you list below is
> insufficient to fix the merge conflict. The full fixup can be found
> in
> the rdma tree from where I merged the for-rc branch into the for-next
> branch and created a complete fixup of the merge conflict. The
> problem
> is that one patch change the device init stage flow, while the other
> patch duplicates the normal device init stage flow to the representor
> device stage flow. To resolve the fix, you not only have to resolve
> the
> contextual diffs, but you have to duplicate the changes to the normal
> device stage flow into the representor device stage flow. It is very
> far from a trivial merge. We were planning on talking to Dave about
> this issue tomorrow, but you beat us to raising the issue ;-).
>
> Here's the commit (from the rdma git repo) with the proper merge fix
> (although it also has other minor merge stuff that needs to be
> ignored):
>
> 2d873449a202 (Merge branch 'k.o/wip/dl-for-rc' into k.o/wip/dl-for-
> next)
>

Dave, Will you be able to take care of this? you will see this once the
rdma fix gets submitted to linus and you back merge rc into net-next.
after that we need to verify that net-next merges cleanly with rdma-
next (from mlx5 point of view) to make sure we won't run into trouble
in the next merge window.

I would like also to avoid such conflicts in the future, since now
rdma-rc is active we are more likely to run into such issues, to solve
this maybe the right way to go is to avoid touching rdma/netdev from
mlx5 shared code pull requests and keep mlx5 core stuff clean, the idea
is to run a pure mlx5 core incremental branch in parallel to netdev and
rdma, this branch will include all pure updates to mlx5 core, mlx5
netdev or rdma patches will be sent to netdev and rdma branches
separately they can be based on latest mlx5 core branch or not.

This way you don't need to pull in rdma stuff from shared code and
Doug/Jason won't need to pull in netdev stuff. it is more work for me,
but for you and rdma, you will see only clean mlx5 core stuff from
shared code, the stack part (netdev or rdma) will go only to the
specific maintainer respectively.

What do you think ? I can do a sample run in one of my next pull
requests and see how it goes.

Thanks,
Saeed.

2018-03-23 04:22:11

by David Miller

[permalink] [raw]
Subject: Re: linux-next: manual merge of the net-next tree with the rdma-fixes tree

From: Doug Ledford <[email protected]>
Date: Thu, 15 Mar 2018 21:18:02 -0400

> Here's the commit (from the rdma git repo) with the proper merge fix
> (although it also has other minor merge stuff that needs to be ignored):
>
> 2d873449a202 (Merge branch 'k.o/wip/dl-for-rc' into k.o/wip/dl-for-next)

Really?

[davem@localhost GIT]$ git clone --reference linux/.git git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git
Cloning into 'rdma'...
remote: Counting objects: 32, done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 32 (delta 0), reused 32 (delta 0)
Receiving objects: 100% (32/32), 186.52 KiB | 3.01 MiB/s, done.
Checking connectivity: 5706198, done.
Checking out files: 100% (61622/61622), done.
[davem@localhost GIT]$ cd rdma
[davem@localhost rdma]$ git show 2d873449a202
fatal: ambiguous argument '2d873449a202': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
[davem@localhost rdma]$

2018-03-23 04:36:45

by Jason Gunthorpe

[permalink] [raw]
Subject: Re: linux-next: manual merge of the net-next tree with the rdma-fixes tree

On Fri, Mar 23, 2018 at 12:19:00AM -0400, David Miller wrote:
> From: Doug Ledford <[email protected]>
> Date: Thu, 15 Mar 2018 21:18:02 -0400
>
> > Here's the commit (from the rdma git repo) with the proper merge fix
> > (although it also has other minor merge stuff that needs to be ignored):
> >
> > 2d873449a202 (Merge branch 'k.o/wip/dl-for-rc' into k.o/wip/dl-for-next)
>
> Really?
>
> [davem@localhost GIT]$ git clone --reference linux/.git git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git
> Cloning into 'rdma'...

Doug and I moved to a shared repo location when we started maintain it
as a team:

git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git

The commit is here:

https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=for-next&id=2d873449a202d02e0c4d90009fb2beb7013ac575

Jason

2018-03-23 14:23:52

by David Miller

[permalink] [raw]
Subject: Re: linux-next: manual merge of the net-next tree with the rdma-fixes tree

From: Jason Gunthorpe <[email protected]>
Date: Thu, 22 Mar 2018 22:33:15 -0600

> Doug and I moved to a shared repo location when we started maintain it
> as a team:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git
>
> The commit is here:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=for-next&id=2d873449a202d02e0c4d90009fb2beb7013ac575

Thanks a lot.