All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the rdma tree with the net-next tree
@ 2015-06-17  3:20 Michael Ellerman
  0 siblings, 0 replies; 26+ messages in thread
From: Michael Ellerman @ 2015-06-17  3:20 UTC (permalink / raw)
  To: Doug Ledford, David S. Miller
  Cc: linux-next, linux-kernel, Ira Weiny, Eran Ben Elisha,
	Hadar Hen Zion, Or Gerlitz

Hi Doug,

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

  drivers/infiniband/hw/mlx4/mad.c

between commit:

  7193a141eb74 "IB/mlx4: Set VF to read from QP counters"

from the net-next tree and commit:

  4cd7c9479aff "IB/mad: Add support for additional MAD info to/from drivers"

from the rdma tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

cheers


diff --cc drivers/infiniband/hw/mlx4/mad.c
index bc09b4e1f57c,3e2dee46caa2..000000000000
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@@ -817,12 -827,14 +819,12 @@@ static void edit_counter(struct mlx4_co
  }
  
  static int iboe_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
- 			struct ib_wc *in_wc, struct ib_grh *in_grh,
- 			struct ib_mad *in_mad, struct ib_mad *out_mad)
+ 			const struct ib_wc *in_wc, const struct ib_grh *in_grh,
+ 			const struct ib_mad *in_mad, struct ib_mad *out_mad)
  {
 -	struct mlx4_cmd_mailbox *mailbox;
 +	struct mlx4_counter counter_stats;
  	struct mlx4_ib_dev *dev = to_mdev(ibdev);
  	int err;
 -	u32 inmod = dev->counters[port_num - 1] & 0xffff;
 -	u8 mode;
  
  	if (in_mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_PERF_MGMT)
  		return -EINVAL;
@@@ -850,15 -868,21 +852,23 @@@
  }
  
  int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
- 			struct ib_wc *in_wc, struct ib_grh *in_grh,
- 			struct ib_mad *in_mad, struct ib_mad *out_mad)
+ 			const struct ib_wc *in_wc, const struct ib_grh *in_grh,
+ 			const struct ib_mad_hdr *in, size_t in_mad_size,
+ 			struct ib_mad_hdr *out, size_t *out_mad_size,
+ 			u16 *out_mad_pkey_index)
  {
 +	struct mlx4_ib_dev *dev = to_mdev(ibdev);
+ 	const struct ib_mad *in_mad = (const struct ib_mad *)in;
+ 	struct ib_mad *out_mad = (struct ib_mad *)out;
+ 
+ 	BUG_ON(in_mad_size != sizeof(*in_mad) ||
+ 	       *out_mad_size != sizeof(*out_mad));
+ 
  	switch (rdma_port_get_link_layer(ibdev, port_num)) {
  	case IB_LINK_LAYER_INFINIBAND:
 -		return ib_process_mad(ibdev, mad_flags, port_num, in_wc,
 -				      in_grh, in_mad, out_mad);
 +		if (!mlx4_is_slave(dev->dev))
 +			return ib_process_mad(ibdev, mad_flags, port_num, in_wc,
 +					      in_grh, in_mad, out_mad);
  	case IB_LINK_LAYER_ETHERNET:
  		return iboe_process_mad(ibdev, mad_flags, port_num, in_wc,
  					  in_grh, in_mad, out_mad);




^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-03-23 23:04       ` Or Gerlitz
@ 2016-03-23 23:23         ` Linus Torvalds
  0 siblings, 0 replies; 26+ messages in thread
From: Linus Torvalds @ 2016-03-23 23:23 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: Doug Ledford, Stephen Rothwell, David Miller,
	Network Development, linux-next, Linux Kernel Mailing List

On Wed, Mar 23, 2016 at 4:04 PM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
>
> I know there's history here, and in the 4.5 cycle things were much
> worse, but I still wanted to put things in their more precise place,
> if you don't mind.

We'll see how things shape up in the future. Once bitten, twice shy,
as they say.

Please make sure that Mellanox will not be a pain going forward, and
everything will be forgiven/forgotten.

            Linus

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-03-16 17:44     ` Linus Torvalds
@ 2016-03-23 23:04       ` Or Gerlitz
  2016-03-23 23:23         ` Linus Torvalds
  0 siblings, 1 reply; 26+ messages in thread
From: Or Gerlitz @ 2016-03-23 23:04 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Doug Ledford, Stephen Rothwell, David Miller,
	Network Development, linux-next, Linux Kernel Mailing List

On Wed, Mar 16, 2016 at 7:44 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Wed, Mar 16, 2016 at 10:35 AM, Doug Ledford <dledford@redhat.com> wrote:
>> On 3/16/2016 1:18 PM, Linus Torvalds wrote:
>>> On Tue, Mar 15, 2016 at 5:58 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:

>>>> I fixed it up (see below) and can carry the fix as necessary (no action
>>>> is required).

>>> Side note: can you change this wording for your manual merge script?
>>> Last merge window (or was it the one before it?) we had confusion with
>>> people who thought that "no action is required" means "you can just
>>> ignore this entirely".

>> I certainly didn't take it that way regardless of the wording.

> It was Or Gerlitz. You were cc'd, since it was the whole rdma Mellanox
> mess. I quote from that thread:
>
>  "> However, the fact that it got resolved in linux-next is purely
>   > informational. It doesn't "fix" the conflict - it just means that both
>   > sides should have gotten informed about it. That doesn't mean that the
>   > conflict goes away or becomes better.
>
>   That's news to me. When such things happen and caught by Stephen, we
>   are getting an email saying something like
>
>   "Today's linux-next merge of the infiniband tree got a conflict
>   between commit X from net-next tree and commit Y from the infiniband
>   tree. I fixed it up (see below) and can carry the fix as necessary (no
>   action is required)."
>
>   Also asked around a bit and got to learn on Stephen using git rerere,
>   so all (no action needed note + seeing git rerere in action...) that
>   leaded me to think that indeed no action is required from our side,
>   but after reading your email (twice, so far), I realized that this was
>   wrong conclusion."

> So that whole "no action is required" wording very much has caused
> confusion before in the rdma camp.

> Let's fix the wording. I'm indeed hopeful that the rdma camp is now
> keenly aware of the issues, but that doesn't change the fact that the
> wording has been problematic.

>> "[...] The Mellanox people are on my xxit-list until they show that they can
>> actually act like responsible people [...]"

Linus,

As I wrote you in that other thread you were quoting from there,
following to the happenings mentioned there, we took responsibility
and made bunch of corrective actions within Mellanox which got us to a
point where there was only one rdma/netdev-next conflict for the 4.6
merge window.

I know there's history here, and in the 4.5 cycle things were much
worse, but I still wanted to put things in their more precise place,
if you don't mind.

Or.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-03-16 21:15     ` Andrew Lunn
@ 2016-03-16 22:35       ` Stephen Rothwell
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Rothwell @ 2016-03-16 22:35 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Linus Torvalds, Doug Ledford, David Miller, Network Development,
	linux-next, Linux Kernel Mailing List, Amir Vadai, Maor Gottlieb

Hi Andrew,

On Wed, 16 Mar 2016 22:15:03 +0100 Andrew Lunn <andrew@lunn.ch> wrote:
>
> > How about "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 want also want to  
> 
> Only the second want is required.
> 
> > consider cooperate with the maintainer of the conflicting tree to  
> 
> cooperating

Thanks.  Breakfast is not the best time to compose prose :-)

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-03-16 20:52   ` Stephen Rothwell
  2016-03-16 21:01     ` Linus Torvalds
@ 2016-03-16 21:15     ` Andrew Lunn
  2016-03-16 22:35       ` Stephen Rothwell
  1 sibling, 1 reply; 26+ messages in thread
From: Andrew Lunn @ 2016-03-16 21:15 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Linus Torvalds, Doug Ledford, David Miller, Network Development,
	linux-next, Linux Kernel Mailing List, Amir Vadai, Maor Gottlieb

Hi Stephen

> How about "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 want also want to

Only the second want is required.

> consider cooperate with the maintainer of the conflicting tree to

cooperating

	Andrew

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-03-16 20:52   ` Stephen Rothwell
@ 2016-03-16 21:01     ` Linus Torvalds
  2016-03-16 21:15     ` Andrew Lunn
  1 sibling, 0 replies; 26+ messages in thread
From: Linus Torvalds @ 2016-03-16 21:01 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Doug Ledford, David Miller, Network Development, linux-next,
	Linux Kernel Mailing List, Amir Vadai, Maor Gottlieb

On Wed, Mar 16, 2016 at 1:52 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> How about "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 want also want to
> consider cooperate with the maintainer of the conflicting tree to
> minimise any particularly complex conflicts."

Yup, sounds fine.

Maybe you could even say "don't merge this to hide the problem",
because that has been another reaction in the past, but the above
already sounds pretty good.

                Linus

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-03-16 17:18 ` Linus Torvalds
  2016-03-16 17:35   ` Doug Ledford
@ 2016-03-16 20:52   ` Stephen Rothwell
  2016-03-16 21:01     ` Linus Torvalds
  2016-03-16 21:15     ` Andrew Lunn
  1 sibling, 2 replies; 26+ messages in thread
From: Stephen Rothwell @ 2016-03-16 20:52 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Doug Ledford, David Miller, Network Development, linux-next,
	Linux Kernel Mailing List, Amir Vadai, Maor Gottlieb

Hi Linus,

On Wed, 16 Mar 2016 10:18:33 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> On Tue, Mar 15, 2016 at 5:58 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > I fixed it up (see below) and can carry the fix as necessary (no action
> > is required).  
> 
> Side note: can you change this wording for your manual merge script?
> Last merge window (or was it the one before it?) we had confusion with
> people who thought that "no action is required" means "you can just
> ignore this entirely".
> 
> I want people who have known merge issues to at the very least
> *mention* them to me when they send the pull request, and I also think
> that trees that have merge conflicts that aren't just totally trivial
> should also make sure that they have communicated with each other
> about why the problem happened.
> 
> This is *particularly* true for the complete effing disaster that is
> mellanox and rdma-vs-networking.
> 
> So please don't say "no action is required". Please make it clear that
> there may not be any further action needed for linux-next itself, but
> that other action may certainly be required.

Yeah, I can see your point.  The "no action required" was a reaction to
people going off and rebasing their tree or dropping patches at any
sign of a conflict at all.

How about "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 want also want to
consider cooperate with the maintainer of the conflicting tree to
minimise any particularly complex conflicts."

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-03-16 17:35   ` Doug Ledford
@ 2016-03-16 17:44     ` Linus Torvalds
  2016-03-23 23:04       ` Or Gerlitz
  0 siblings, 1 reply; 26+ messages in thread
From: Linus Torvalds @ 2016-03-16 17:44 UTC (permalink / raw)
  To: Doug Ledford
  Cc: Stephen Rothwell, David Miller, Network Development, linux-next,
	Linux Kernel Mailing List, Amir Vadai, Maor Gottlieb

On Wed, Mar 16, 2016 at 10:35 AM, Doug Ledford <dledford@redhat.com> wrote:
> On 3/16/2016 1:18 PM, Linus Torvalds wrote:
>> On Tue, Mar 15, 2016 at 5:58 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>>
>>> I fixed it up (see below) and can carry the fix as necessary (no action
>>> is required).
>>
>> Side note: can you change this wording for your manual merge script?
>> Last merge window (or was it the one before it?) we had confusion with
>> people who thought that "no action is required" means "you can just
>> ignore this entirely".
>
> I certainly didn't take it that way regardless of the wording.

It was Or Gerlitz. You were cc'd, since it was the whole rdma Mellanox
mess. I quote from that thread:

 "> However, the fact that it got resolved in linux-next is purely
  > informational. It doesn't "fix" the conflict - it just means that both
  > sides should have gotten informed about it. That doesn't mean that the
  > conflict goes away or becomes better.

  That's news to me. When such things happen and caught by Stephen, we
  are getting an email saying something like

  "Today's linux-next merge of the infiniband tree got a conflict
  between commit X from net-next tree and commit Y from the infiniband
  tree. I fixed it up (see below) and can carry the fix as necessary (no
  action is required)."

  Also asked around a bit and got to learn on Stephen using git rerere,
  so all (no action needed note + seeing git rerere in action...) that
  leaded me to think that indeed no action is required from our side,
  but after reading your email (twice, so far), I realized that this was
  wrong conclusion."

So that whole "no action is required" wording very much has caused
confusion before in the rdma camp.

Let's fix the wording. I'm indeed hopeful that the rdma camp is now
keenly aware of the issues, but that doesn't change the fact that the
wording has been problematic.

                  Linus

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-03-16 17:18 ` Linus Torvalds
@ 2016-03-16 17:35   ` Doug Ledford
  2016-03-16 17:44     ` Linus Torvalds
  2016-03-16 20:52   ` Stephen Rothwell
  1 sibling, 1 reply; 26+ messages in thread
From: Doug Ledford @ 2016-03-16 17:35 UTC (permalink / raw)
  To: Linus Torvalds, Stephen Rothwell
  Cc: David Miller, Network Development, linux-next,
	Linux Kernel Mailing List, Amir Vadai, Maor Gottlieb


[-- Attachment #1.1: Type: text/plain, Size: 953 bytes --]

On 3/16/2016 1:18 PM, Linus Torvalds wrote:
> On Tue, Mar 15, 2016 at 5:58 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>
>> I fixed it up (see below) and can carry the fix as necessary (no action
>> is required).
> 
> Side note: can you change this wording for your manual merge script?
> Last merge window (or was it the one before it?) we had confusion with
> people who thought that "no action is required" means "you can just
> ignore this entirely".

I certainly didn't take it that way regardless of the wording.  I'm
keenly aware of the short leash you have Mellanox (and by extension
myself) on.  I reviewed the merge in detail, enough to satisfy myself
that it was easy, correct, and that the code itself made the merge
obvious (such as the comment that flow table entries need to be last in
the lists in order to support priority transitions, which fairly handily
explained what needed to happen in the merge).




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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-03-16  0:58 ` Stephen Rothwell
  (?)
  (?)
@ 2016-03-16 17:18 ` Linus Torvalds
  2016-03-16 17:35   ` Doug Ledford
  2016-03-16 20:52   ` Stephen Rothwell
  -1 siblings, 2 replies; 26+ messages in thread
From: Linus Torvalds @ 2016-03-16 17:18 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Doug Ledford, David Miller, Network Development, linux-next,
	Linux Kernel Mailing List, Amir Vadai, Maor Gottlieb

On Tue, Mar 15, 2016 at 5:58 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).

Side note: can you change this wording for your manual merge script?
Last merge window (or was it the one before it?) we had confusion with
people who thought that "no action is required" means "you can just
ignore this entirely".

I want people who have known merge issues to at the very least
*mention* them to me when they send the pull request, and I also think
that trees that have merge conflicts that aren't just totally trivial
should also make sure that they have communicated with each other
about why the problem happened.

This is *particularly* true for the complete effing disaster that is
mellanox and rdma-vs-networking.

So please don't say "no action is required". Please make it clear that
there may not be any further action needed for linux-next itself, but
that other action may certainly be required.

Because I'm very close to not taking any rdma changes that touch
networking any more. Ever.

The Mellanox people are on my shit-list until they show that they can
actually act like responsible people and not just monkeys throwing
shit at the walls.

"No action required" is simply not true for Mellanox.

                     Linus

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-03-16  0:58 ` Stephen Rothwell
  (?)
@ 2016-03-16 14:27 ` Maor Gottlieb
  -1 siblings, 0 replies; 26+ messages in thread
From: Maor Gottlieb @ 2016-03-16 14:27 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Doug Ledford, David Miller, netdev, linux-next, linux-kernel,
	Amir Vadai, Maor Gottlieb

2016-03-16 2:58 GMT+02:00 Stephen Rothwell <sfr@canb.auug.org.au>:
> Hi all,
>
> Today's linux-next merge of the rdma tree got a conflict in:
>
>   drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
>
> between commit:
>
>   60ab4584f5bf ("net/mlx5_core: Set flow steering dest only for forward rules")
>
> from the net-next tree and commit:
>
>   b3638e1a7664 ("net/mlx5_core: Introduce forward to next priority action")
>
> from the rdma tree.
>
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).
>
> --
> Cheers,
> Stephen Rothwell
>
> diff --cc drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> index e848d708d2b7,bf3446794bd5..000000000000
> --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> @@@ -73,10 -73,13 +73,13 @@@
>   #define BY_PASS_MIN_LEVEL (KENREL_MIN_LEVEL + MLX5_BY_PASS_NUM_PRIOS +\
>                            LEFTOVERS_MAX_FT)
>
>  -#define KERNEL_MAX_FT 2
>  -#define KERNEL_NUM_PRIOS 1
>  +#define KERNEL_MAX_FT 3
>  +#define KERNEL_NUM_PRIOS 2
>   #define KENREL_MIN_LEVEL 2
>
> + #define ANCHOR_MAX_FT 1
> + #define ANCHOR_NUM_PRIOS 1
> + #define ANCHOR_MIN_LEVEL (BY_PASS_MIN_LEVEL + 1)
>   struct node_caps {
>         size_t  arr_sz;
>         long    *caps;
> @@@ -360,8 -367,13 +367,13 @@@ static void del_rule(struct fs_node *no
>         memcpy(match_value, fte->val, sizeof(fte->val));
>         fs_get_obj(ft, fg->node.parent);
>         list_del(&rule->node.list);
> +       if (rule->sw_action == MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO) {
> +               mutex_lock(&rule->dest_attr.ft->lock);
> +               list_del(&rule->next_ft);
> +               mutex_unlock(&rule->dest_attr.ft->lock);
> +       }
>  -      fte->dests_size--;
>  -      if (fte->dests_size) {
>  +      if ((fte->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) &&
>  +          --fte->dests_size) {
>                 err = mlx5_cmd_update_fte(dev, ft,
>                                           fg->id, fte);
>                 if (err)
> @@@ -762,9 -835,9 +835,10 @@@ static struct mlx5_flow_rule *alloc_rul
>         if (!rule)
>                 return NULL;
>
> +       INIT_LIST_HEAD(&rule->next_ft);
>         rule->node.type = FS_TYPE_FLOW_DEST;
>  -      memcpy(&rule->dest_attr, dest, sizeof(*dest));
>  +      if (dest)
>  +              memcpy(&rule->dest_attr, dest, sizeof(*dest));
>
>         return rule;
>   }
> @@@ -783,12 -856,16 +857,17 @@@ static struct mlx5_flow_rule *add_rule_
>                 return ERR_PTR(-ENOMEM);
>
>         fs_get_obj(ft, fg->node.parent);
> -       /* Add dest to dests list- added as first element after the head */
> +       /* Add dest to dests list- we need flow tables to be in the
> +        * end of the list for forward to next prio rules.
> +        */
>         tree_init_node(&rule->node, 1, del_rule);
> -       list_add_tail(&rule->node.list, &fte->node.children);
> +       if (dest && dest->type != MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE)
> +               list_add(&rule->node.list, &fte->node.children);
> +       else
> +               list_add_tail(&rule->node.list, &fte->node.children);
>  -      fte->dests_size++;
>  -      if (fte->dests_size == 1)
>  +      if (dest)
>  +              fte->dests_size++;
>  +      if (fte->dests_size == 1 || !dest)
>                 err = mlx5_cmd_create_fte(get_dev(&ft->node),
>                                           ft, fg->id, fte);
>         else

Hi Stephen,

I reveiwed your merge and it's fine.

Thanks,
Maor

^ permalink raw reply	[flat|nested] 26+ messages in thread

* linux-next: manual merge of the rdma tree with the net-next tree
@ 2016-03-16  0:58 ` Stephen Rothwell
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Rothwell @ 2016-03-16  0:58 UTC (permalink / raw)
  To: Doug Ledford, David Miller, netdev
  Cc: linux-next, linux-kernel, Amir Vadai, Maor Gottlieb

Hi all,

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

  drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

between commit:

  60ab4584f5bf ("net/mlx5_core: Set flow steering dest only for forward rules")

from the net-next tree and commit:

  b3638e1a7664 ("net/mlx5_core: Introduce forward to next priority action")

from the rdma tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index e848d708d2b7,bf3446794bd5..000000000000
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@@ -73,10 -73,13 +73,13 @@@
  #define BY_PASS_MIN_LEVEL (KENREL_MIN_LEVEL + MLX5_BY_PASS_NUM_PRIOS +\
  			   LEFTOVERS_MAX_FT)
  
 -#define KERNEL_MAX_FT 2
 -#define KERNEL_NUM_PRIOS 1
 +#define KERNEL_MAX_FT 3
 +#define KERNEL_NUM_PRIOS 2
  #define KENREL_MIN_LEVEL 2
  
+ #define ANCHOR_MAX_FT 1
+ #define ANCHOR_NUM_PRIOS 1
+ #define ANCHOR_MIN_LEVEL (BY_PASS_MIN_LEVEL + 1)
  struct node_caps {
  	size_t	arr_sz;
  	long	*caps;
@@@ -360,8 -367,13 +367,13 @@@ static void del_rule(struct fs_node *no
  	memcpy(match_value, fte->val, sizeof(fte->val));
  	fs_get_obj(ft, fg->node.parent);
  	list_del(&rule->node.list);
+ 	if (rule->sw_action == MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO) {
+ 		mutex_lock(&rule->dest_attr.ft->lock);
+ 		list_del(&rule->next_ft);
+ 		mutex_unlock(&rule->dest_attr.ft->lock);
+ 	}
 -	fte->dests_size--;
 -	if (fte->dests_size) {
 +	if ((fte->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) &&
 +	    --fte->dests_size) {
  		err = mlx5_cmd_update_fte(dev, ft,
  					  fg->id, fte);
  		if (err)
@@@ -762,9 -835,9 +835,10 @@@ static struct mlx5_flow_rule *alloc_rul
  	if (!rule)
  		return NULL;
  
+ 	INIT_LIST_HEAD(&rule->next_ft);
  	rule->node.type = FS_TYPE_FLOW_DEST;
 -	memcpy(&rule->dest_attr, dest, sizeof(*dest));
 +	if (dest)
 +		memcpy(&rule->dest_attr, dest, sizeof(*dest));
  
  	return rule;
  }
@@@ -783,12 -856,16 +857,17 @@@ static struct mlx5_flow_rule *add_rule_
  		return ERR_PTR(-ENOMEM);
  
  	fs_get_obj(ft, fg->node.parent);
- 	/* Add dest to dests list- added as first element after the head */
+ 	/* Add dest to dests list- we need flow tables to be in the
+ 	 * end of the list for forward to next prio rules.
+ 	 */
  	tree_init_node(&rule->node, 1, del_rule);
- 	list_add_tail(&rule->node.list, &fte->node.children);
+ 	if (dest && dest->type != MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE)
+ 		list_add(&rule->node.list, &fte->node.children);
+ 	else
+ 		list_add_tail(&rule->node.list, &fte->node.children);
 -	fte->dests_size++;
 -	if (fte->dests_size == 1)
 +	if (dest)
 +		fte->dests_size++;
 +	if (fte->dests_size == 1 || !dest)
  		err = mlx5_cmd_create_fte(get_dev(&ft->node),
  					  ft, fg->id, fte);
  	else

^ permalink raw reply	[flat|nested] 26+ messages in thread

* linux-next: manual merge of the rdma tree with the net-next tree
@ 2016-03-16  0:58 ` Stephen Rothwell
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Rothwell @ 2016-03-16  0:58 UTC (permalink / raw)
  To: Doug Ledford, David Miller, netdev
  Cc: linux-next, linux-kernel, Amir Vadai, Maor Gottlieb

Hi all,

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

  drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

between commit:

  60ab4584f5bf ("net/mlx5_core: Set flow steering dest only for forward rules")

from the net-next tree and commit:

  b3638e1a7664 ("net/mlx5_core: Introduce forward to next priority action")

from the rdma tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index e848d708d2b7,bf3446794bd5..000000000000
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@@ -73,10 -73,13 +73,13 @@@
  #define BY_PASS_MIN_LEVEL (KENREL_MIN_LEVEL + MLX5_BY_PASS_NUM_PRIOS +\
  			   LEFTOVERS_MAX_FT)
  
 -#define KERNEL_MAX_FT 2
 -#define KERNEL_NUM_PRIOS 1
 +#define KERNEL_MAX_FT 3
 +#define KERNEL_NUM_PRIOS 2
  #define KENREL_MIN_LEVEL 2
  
+ #define ANCHOR_MAX_FT 1
+ #define ANCHOR_NUM_PRIOS 1
+ #define ANCHOR_MIN_LEVEL (BY_PASS_MIN_LEVEL + 1)
  struct node_caps {
  	size_t	arr_sz;
  	long	*caps;
@@@ -360,8 -367,13 +367,13 @@@ static void del_rule(struct fs_node *no
  	memcpy(match_value, fte->val, sizeof(fte->val));
  	fs_get_obj(ft, fg->node.parent);
  	list_del(&rule->node.list);
+ 	if (rule->sw_action == MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO) {
+ 		mutex_lock(&rule->dest_attr.ft->lock);
+ 		list_del(&rule->next_ft);
+ 		mutex_unlock(&rule->dest_attr.ft->lock);
+ 	}
 -	fte->dests_size--;
 -	if (fte->dests_size) {
 +	if ((fte->action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) &&
 +	    --fte->dests_size) {
  		err = mlx5_cmd_update_fte(dev, ft,
  					  fg->id, fte);
  		if (err)
@@@ -762,9 -835,9 +835,10 @@@ static struct mlx5_flow_rule *alloc_rul
  	if (!rule)
  		return NULL;
  
+ 	INIT_LIST_HEAD(&rule->next_ft);
  	rule->node.type = FS_TYPE_FLOW_DEST;
 -	memcpy(&rule->dest_attr, dest, sizeof(*dest));
 +	if (dest)
 +		memcpy(&rule->dest_attr, dest, sizeof(*dest));
  
  	return rule;
  }
@@@ -783,12 -856,16 +857,17 @@@ static struct mlx5_flow_rule *add_rule_
  		return ERR_PTR(-ENOMEM);
  
  	fs_get_obj(ft, fg->node.parent);
- 	/* Add dest to dests list- added as first element after the head */
+ 	/* Add dest to dests list- we need flow tables to be in the
+ 	 * end of the list for forward to next prio rules.
+ 	 */
  	tree_init_node(&rule->node, 1, del_rule);
- 	list_add_tail(&rule->node.list, &fte->node.children);
+ 	if (dest && dest->type != MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE)
+ 		list_add(&rule->node.list, &fte->node.children);
+ 	else
+ 		list_add_tail(&rule->node.list, &fte->node.children);
 -	fte->dests_size++;
 -	if (fte->dests_size == 1)
 +	if (dest)
 +		fte->dests_size++;
 +	if (fte->dests_size == 1 || !dest)
  		err = mlx5_cmd_create_fte(get_dev(&ft->node),
  					  ft, fg->id, fte);
  	else

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-01-05 17:05   ` Or Gerlitz
@ 2016-01-05 20:51     ` Stephen Rothwell
  -1 siblings, 0 replies; 26+ messages in thread
From: Stephen Rothwell @ 2016-01-05 20:51 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: Doug Ledford, David Miller, netdev, linux-next, linux-kernel,
	Saeed Mahameed, Achiad Shochat, Matan Barak, Leon Romanovsky

Hi Or,

On Tue, 5 Jan 2016 19:05:24 +0200 Or Gerlitz <ogerlitz@mellanox.com> wrote:
>
> On 1/5/2016 3:51 AM, Stephen Rothwell wrote:
> > Hi Doug,
> >
> > Today's linux-next merge of the rdma tree got conflicts in:
> >
> >    drivers/net/ethernet/mellanox/mlx5/core/vport.c
> >    include/linux/mlx5/mlx5_ifc.h
> >    include/linux/mlx5/vport.h
> >
> > between commits:
> >
> >    e1d7d349c69d ("net/mlx5: Update access functions to Query/Modify vport MAC address")
> >    e75465148b7d ("net/mlx5: Introduce access functions to modify/query vport state")
> >
> > from the net-next tree and commit:
> >
> >    e5f6175c5b66 ("net/mlx5_core: Break down the vport mac address query function")
> >
> > from the rdma tree and maybe some others.
> >
> > I have no hope of fixing this stuff up, so I have dropped the rdma tree
> > again for today.  There is similar functionality being introduced in
> > both trees ... please sort this mess out ...  
> 
> Hi Stephen,
> 
> Saeed/Matan and Co are working here on a fix which would solve the 
> conflict.

Wonderful.

> We have the basic patch and people will be testing it later/tomorrow.
> 
> Could you please advice how would it be possible to provide you the
> git rerere output -- the pre-image and post-images files from .git/rr-cache?

Just send me a (private) email (no need to bother the list) with the
pre and post image files attached, thanks.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
@ 2016-01-05 20:51     ` Stephen Rothwell
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Rothwell @ 2016-01-05 20:51 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: Doug Ledford, David Miller, netdev, linux-next, linux-kernel,
	Saeed Mahameed, Achiad Shochat, Matan Barak, Leon Romanovsky

Hi Or,

On Tue, 5 Jan 2016 19:05:24 +0200 Or Gerlitz <ogerlitz@mellanox.com> wrote:
>
> On 1/5/2016 3:51 AM, Stephen Rothwell wrote:
> > Hi Doug,
> >
> > Today's linux-next merge of the rdma tree got conflicts in:
> >
> >    drivers/net/ethernet/mellanox/mlx5/core/vport.c
> >    include/linux/mlx5/mlx5_ifc.h
> >    include/linux/mlx5/vport.h
> >
> > between commits:
> >
> >    e1d7d349c69d ("net/mlx5: Update access functions to Query/Modify vport MAC address")
> >    e75465148b7d ("net/mlx5: Introduce access functions to modify/query vport state")
> >
> > from the net-next tree and commit:
> >
> >    e5f6175c5b66 ("net/mlx5_core: Break down the vport mac address query function")
> >
> > from the rdma tree and maybe some others.
> >
> > I have no hope of fixing this stuff up, so I have dropped the rdma tree
> > again for today.  There is similar functionality being introduced in
> > both trees ... please sort this mess out ...  
> 
> Hi Stephen,
> 
> Saeed/Matan and Co are working here on a fix which would solve the 
> conflict.

Wonderful.

> We have the basic patch and people will be testing it later/tomorrow.
> 
> Could you please advice how would it be possible to provide you the
> git rerere output -- the pre-image and post-images files from .git/rr-cache?

Just send me a (private) email (no need to bother the list) with the
pre and post image files attached, thanks.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2016-01-05  1:51 ` Stephen Rothwell
@ 2016-01-05 17:05   ` Or Gerlitz
  -1 siblings, 0 replies; 26+ messages in thread
From: Or Gerlitz @ 2016-01-05 17:05 UTC (permalink / raw)
  To: Stephen Rothwell, Doug Ledford
  Cc: David Miller, netdev, linux-next, linux-kernel, Saeed Mahameed,
	Achiad Shochat, Matan Barak, Leon Romanovsky

On 1/5/2016 3:51 AM, Stephen Rothwell wrote:
> Hi Doug,
>
> Today's linux-next merge of the rdma tree got conflicts in:
>
>    drivers/net/ethernet/mellanox/mlx5/core/vport.c
>    include/linux/mlx5/mlx5_ifc.h
>    include/linux/mlx5/vport.h
>
> between commits:
>
>    e1d7d349c69d ("net/mlx5: Update access functions to Query/Modify vport MAC address")
>    e75465148b7d ("net/mlx5: Introduce access functions to modify/query vport state")
>
> from the net-next tree and commit:
>
>    e5f6175c5b66 ("net/mlx5_core: Break down the vport mac address query function")
>
> from the rdma tree and maybe some others.
>
> I have no hope of fixing this stuff up, so I have dropped the rdma tree
> again for today.  There is similar functionality being introduced in
> both trees ... please sort this mess out ...

Hi Stephen,

Saeed/Matan and Co are working here on a fix which would solve the 
conflict.

We have the basic patch and people will be testing it later/tomorrow.

Could you please advice how would it be possible to provide you the
git rerere output -- the pre-image and post-images files from .git/rr-cache?

Or.



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
@ 2016-01-05 17:05   ` Or Gerlitz
  0 siblings, 0 replies; 26+ messages in thread
From: Or Gerlitz @ 2016-01-05 17:05 UTC (permalink / raw)
  To: Stephen Rothwell, Doug Ledford
  Cc: David Miller, netdev, linux-next, linux-kernel, Saeed Mahameed,
	Achiad Shochat, Matan Barak, Leon Romanovsky

On 1/5/2016 3:51 AM, Stephen Rothwell wrote:
> Hi Doug,
>
> Today's linux-next merge of the rdma tree got conflicts in:
>
>    drivers/net/ethernet/mellanox/mlx5/core/vport.c
>    include/linux/mlx5/mlx5_ifc.h
>    include/linux/mlx5/vport.h
>
> between commits:
>
>    e1d7d349c69d ("net/mlx5: Update access functions to Query/Modify vport MAC address")
>    e75465148b7d ("net/mlx5: Introduce access functions to modify/query vport state")
>
> from the net-next tree and commit:
>
>    e5f6175c5b66 ("net/mlx5_core: Break down the vport mac address query function")
>
> from the rdma tree and maybe some others.
>
> I have no hope of fixing this stuff up, so I have dropped the rdma tree
> again for today.  There is similar functionality being introduced in
> both trees ... please sort this mess out ...

Hi Stephen,

Saeed/Matan and Co are working here on a fix which would solve the 
conflict.

We have the basic patch and people will be testing it later/tomorrow.

Could you please advice how would it be possible to provide you the
git rerere output -- the pre-image and post-images files from .git/rr-cache?

Or.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* linux-next: manual merge of the rdma tree with the net-next tree
@ 2016-01-05  1:51 ` Stephen Rothwell
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Rothwell @ 2016-01-05  1:51 UTC (permalink / raw)
  To: Doug Ledford, David Miller, netdev
  Cc: linux-next, linux-kernel, Saeed Mahameed, Achiad Shochat, Or Gerlitz

Hi Doug,

Today's linux-next merge of the rdma tree got conflicts in:

  drivers/net/ethernet/mellanox/mlx5/core/vport.c
  include/linux/mlx5/mlx5_ifc.h
  include/linux/mlx5/vport.h

between commits:

  e1d7d349c69d ("net/mlx5: Update access functions to Query/Modify vport MAC address")
  e75465148b7d ("net/mlx5: Introduce access functions to modify/query vport state")

from the net-next tree and commit:

  e5f6175c5b66 ("net/mlx5_core: Break down the vport mac address query function")

from the rdma tree and maybe some others.

I have no hope of fixing this stuff up, so I have dropped the rdma tree
again for today.  There is similar functionality being introduced in
both trees ... please sort this mess out ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

^ permalink raw reply	[flat|nested] 26+ messages in thread

* linux-next: manual merge of the rdma tree with the net-next tree
@ 2016-01-05  1:51 ` Stephen Rothwell
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Rothwell @ 2016-01-05  1:51 UTC (permalink / raw)
  To: Doug Ledford, David Miller, netdev
  Cc: linux-next, linux-kernel, Saeed Mahameed, Achiad Shochat, Or Gerlitz

Hi Doug,

Today's linux-next merge of the rdma tree got conflicts in:

  drivers/net/ethernet/mellanox/mlx5/core/vport.c
  include/linux/mlx5/mlx5_ifc.h
  include/linux/mlx5/vport.h

between commits:

  e1d7d349c69d ("net/mlx5: Update access functions to Query/Modify vport MAC address")
  e75465148b7d ("net/mlx5: Introduce access functions to modify/query vport state")

from the net-next tree and commit:

  e5f6175c5b66 ("net/mlx5_core: Break down the vport mac address query function")

from the rdma tree and maybe some others.

I have no hope of fixing this stuff up, so I have dropped the rdma tree
again for today.  There is similar functionality being introduced in
both trees ... please sort this mess out ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: linux-next: manual merge of the rdma tree with the net-next tree
  2015-08-28  1:26 ` Stephen Rothwell
  (?)
@ 2015-08-28  6:35 ` Jiri Pirko
  -1 siblings, 0 replies; 26+ messages in thread
From: Jiri Pirko @ 2015-08-28  6:35 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Doug Ledford, David Miller, netdev, linux-next, linux-kernel,
	Matan Barak, Jiri Pirko

Fri, Aug 28, 2015 at 03:26:50AM CEST, sfr@canb.auug.org.au wrote:
>Hi Doug,
>
>Today's linux-next merge of the rdma tree got a conflict in:
>
>  net/core/dev.c
>
>between commit:
>
>  0e4ead9d7b36 ("net: introduce change upper device notifier change info")
>
>from the net-next tree and commit:
>
>  133b5b93c734 ("net: Add info for NETDEV_CHANGEUPPER event")
>
>from the rdma tree.
>
>They are doing very similar things, but not identical.
>
>I fixed it up (see bottom of email and the below extra patch) and can
>carry the fix as necessary (no action is required unless something more
>correct is supplied, of course).
>
>From: Stephen Rothwell <sfr@canb.auug.org.au>
>Date: Fri, 28 Aug 2015 11:14:38 +1000
>Subject: [PATCH] net: merge change upper notifier changes
>
>Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
>---

<snip>

>diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>index 0aa7d19ac85e..4ce420487d07 100644
>--- a/include/linux/netdevice.h
>+++ b/include/linux/netdevice.h
>@@ -2115,13 +2115,22 @@ struct netdev_notifier_change_info {
> 	unsigned int flags_changed;
> };
> 
>+enum netdev_changeupper_event {
>+	NETDEV_CHANGEUPPER_LINK,
>+	NETDEV_CHANGEUPPER_UNLINK,
>+};
>+

I have this handled by "bool linking". So this is not needed.


> struct netdev_notifier_changeupper_info {
> 	struct netdev_notifier_info info; /* must be first */
>+	enum netdev_changeupper_event event;

	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



Other than this, looks good. Thanks

> 	struct net_device *upper_dev; /* new upper dev */
> 	bool master; /* is upper dev master */
> 	bool linking; /* is the nofication for link or unlink */
> };
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* linux-next: manual merge of the rdma tree with the net-next tree
@ 2015-08-28  1:26 ` Stephen Rothwell
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Rothwell @ 2015-08-28  1:26 UTC (permalink / raw)
  To: Doug Ledford, David Miller, netdev
  Cc: linux-next, linux-kernel, Matan Barak, Jiri Pirko

Hi Doug,

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

  net/core/dev.c

between commit:

  0e4ead9d7b36 ("net: introduce change upper device notifier change info")

from the net-next tree and commit:

  133b5b93c734 ("net: Add info for NETDEV_CHANGEUPPER event")

from the rdma tree.

They are doing very similar things, but not identical.

I fixed it up (see bottom of email and the below extra patch) and can
carry the fix as necessary (no action is required unless something more
correct is supplied, of course).

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 28 Aug 2015 11:14:38 +1000
Subject: [PATCH] net: merge change upper notifier changes

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/infiniband/core/roce_gid_mgmt.c | 12 ++++++------
 include/linux/netdevice.h               | 23 +++++++++--------------
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/drivers/infiniband/core/roce_gid_mgmt.c b/drivers/infiniband/core/roce_gid_mgmt.c
index 6eecdfbf3aef..69e2ffa35d91 100644
--- a/drivers/infiniband/core/roce_gid_mgmt.c
+++ b/drivers/infiniband/core/roce_gid_mgmt.c
@@ -529,7 +529,7 @@ static const struct netdev_event_work_cmd add_cmd = {
 static const struct netdev_event_work_cmd add_cmd_upper_ips = {
 	.cb = add_netdev_upper_ips, .filter = is_eth_port_of_netdev};
 
-static void netdevice_event_changeupper(struct netdev_changeupper_info *changeupper_info,
+static void netdevice_event_changeupper(struct netdev_notifier_changeupper_info *changeupper_info,
 					struct netdev_event_work_cmd *cmds)
 {
 	static const struct netdev_event_work_cmd upper_ips_del_cmd = {
@@ -540,15 +540,15 @@ static void netdevice_event_changeupper(struct netdev_changeupper_info *changeup
 	if (changeupper_info->event ==
 	    NETDEV_CHANGEUPPER_UNLINK) {
 		cmds[0] = upper_ips_del_cmd;
-		cmds[0].ndev = changeupper_info->upper;
+		cmds[0].ndev = changeupper_info->upper_dev;
 		cmds[1] = add_cmd;
 	} else if (changeupper_info->event ==
 		   NETDEV_CHANGEUPPER_LINK) {
 		cmds[0] = bonding_default_del_cmd;
-		cmds[0].ndev = changeupper_info->upper;
+		cmds[0].ndev = changeupper_info->upper_dev;
 		cmds[1] = add_cmd_upper_ips;
-		cmds[1].ndev = changeupper_info->upper;
-		cmds[1].filter_ndev = changeupper_info->upper;
+		cmds[1].ndev = changeupper_info->upper_dev;
+		cmds[1].filter_ndev = changeupper_info->upper_dev;
 	}
 }
 
@@ -590,7 +590,7 @@ static int netdevice_event(struct notifier_block *this, unsigned long event,
 
 	case NETDEV_CHANGEUPPER:
 		netdevice_event_changeupper(
-			container_of(ptr, struct netdev_changeupper_info, info),
+			container_of(ptr, struct netdev_notifier_changeupper_info, info),
 			cmds);
 		break;
 
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0aa7d19ac85e..4ce420487d07 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2115,13 +2115,22 @@ struct netdev_notifier_change_info {
 	unsigned int flags_changed;
 };
 
+enum netdev_changeupper_event {
+	NETDEV_CHANGEUPPER_LINK,
+	NETDEV_CHANGEUPPER_UNLINK,
+};
+
 struct netdev_notifier_changeupper_info {
 	struct netdev_notifier_info info; /* must be first */
+	enum netdev_changeupper_event event;
 	struct net_device *upper_dev; /* new upper dev */
 	bool master; /* is upper dev master */
 	bool linking; /* is the nofication for link or unlink */
 };
 
+void netdev_changeupper_info_change(struct net_device *dev,
+				    struct netdev_notifier_changeupper_info *info);
+
 static inline void netdev_notifier_info_init(struct netdev_notifier_info *info,
 					     struct net_device *dev)
 {
@@ -3606,20 +3615,6 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
 struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
 				    netdev_features_t features);
 
-enum netdev_changeupper_event {
-	NETDEV_CHANGEUPPER_LINK,
-	NETDEV_CHANGEUPPER_UNLINK,
-};
-
-struct netdev_changeupper_info {
-	struct netdev_notifier_info	info; /* must be first */
-	enum netdev_changeupper_event	event;
-	struct net_device		*upper;
-};
-
-void netdev_changeupper_info_change(struct net_device *dev,
-				    struct netdev_changeupper_info *info);
-
 struct netdev_bonding_info {
 	ifslave	slave;
 	ifbond	master;
-- 
2.5.0



-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc net/core/dev.c
index a8e6cf4298d3,6e6f14e5d44f..000000000000
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@@ -5330,10 -5320,6 +5330,11 @@@ static int __netdev_upper_dev_link(stru
  	if (master && netdev_master_upper_dev_get(dev))
  		return -EBUSY;
  
++	changeupper_info.event = NETDEV_CHANGEUPPER_LINK;
 +	changeupper_info.upper_dev = upper_dev;
 +	changeupper_info.master = master;
 +	changeupper_info.linking = true;
 +
  	ret = __netdev_adjacent_dev_link_neighbour(dev, upper_dev, private,
  						   master);
  	if (ret)
@@@ -5468,14 -5456,10 +5469,15 @@@ EXPORT_SYMBOL(netdev_master_upper_dev_l
  void netdev_upper_dev_unlink(struct net_device *dev,
  			     struct net_device *upper_dev)
  {
 +	struct netdev_notifier_changeupper_info changeupper_info;
  	struct netdev_adjacent *i, *j;
 -	struct netdev_changeupper_info changeupper_info;
  	ASSERT_RTNL();
  
++	changeupper_info.event = NETDEV_CHANGEUPPER_UNLINK;
 +	changeupper_info.upper_dev = upper_dev;
 +	changeupper_info.master = netdev_master_upper_dev_get(dev) == upper_dev;
 +	changeupper_info.linking = false;
 +
  	__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
  
  	/* Here is the tricky part. We must remove all dev's lower

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* linux-next: manual merge of the rdma tree with the net-next tree
@ 2015-08-28  1:26 ` Stephen Rothwell
  0 siblings, 0 replies; 26+ messages in thread
From: Stephen Rothwell @ 2015-08-28  1:26 UTC (permalink / raw)
  To: Doug Ledford, David Miller, netdev
  Cc: linux-next, linux-kernel, Matan Barak, Jiri Pirko

Hi Doug,

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

  net/core/dev.c

between commit:

  0e4ead9d7b36 ("net: introduce change upper device notifier change info")

from the net-next tree and commit:

  133b5b93c734 ("net: Add info for NETDEV_CHANGEUPPER event")

from the rdma tree.

They are doing very similar things, but not identical.

I fixed it up (see bottom of email and the below extra patch) and can
carry the fix as necessary (no action is required unless something more
correct is supplied, of course).

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 28 Aug 2015 11:14:38 +1000
Subject: [PATCH] net: merge change upper notifier changes

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/infiniband/core/roce_gid_mgmt.c | 12 ++++++------
 include/linux/netdevice.h               | 23 +++++++++--------------
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/drivers/infiniband/core/roce_gid_mgmt.c b/drivers/infiniband/core/roce_gid_mgmt.c
index 6eecdfbf3aef..69e2ffa35d91 100644
--- a/drivers/infiniband/core/roce_gid_mgmt.c
+++ b/drivers/infiniband/core/roce_gid_mgmt.c
@@ -529,7 +529,7 @@ static const struct netdev_event_work_cmd add_cmd = {
 static const struct netdev_event_work_cmd add_cmd_upper_ips = {
 	.cb = add_netdev_upper_ips, .filter = is_eth_port_of_netdev};
 
-static void netdevice_event_changeupper(struct netdev_changeupper_info *changeupper_info,
+static void netdevice_event_changeupper(struct netdev_notifier_changeupper_info *changeupper_info,
 					struct netdev_event_work_cmd *cmds)
 {
 	static const struct netdev_event_work_cmd upper_ips_del_cmd = {
@@ -540,15 +540,15 @@ static void netdevice_event_changeupper(struct netdev_changeupper_info *changeup
 	if (changeupper_info->event ==
 	    NETDEV_CHANGEUPPER_UNLINK) {
 		cmds[0] = upper_ips_del_cmd;
-		cmds[0].ndev = changeupper_info->upper;
+		cmds[0].ndev = changeupper_info->upper_dev;
 		cmds[1] = add_cmd;
 	} else if (changeupper_info->event ==
 		   NETDEV_CHANGEUPPER_LINK) {
 		cmds[0] = bonding_default_del_cmd;
-		cmds[0].ndev = changeupper_info->upper;
+		cmds[0].ndev = changeupper_info->upper_dev;
 		cmds[1] = add_cmd_upper_ips;
-		cmds[1].ndev = changeupper_info->upper;
-		cmds[1].filter_ndev = changeupper_info->upper;
+		cmds[1].ndev = changeupper_info->upper_dev;
+		cmds[1].filter_ndev = changeupper_info->upper_dev;
 	}
 }
 
@@ -590,7 +590,7 @@ static int netdevice_event(struct notifier_block *this, unsigned long event,
 
 	case NETDEV_CHANGEUPPER:
 		netdevice_event_changeupper(
-			container_of(ptr, struct netdev_changeupper_info, info),
+			container_of(ptr, struct netdev_notifier_changeupper_info, info),
 			cmds);
 		break;
 
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0aa7d19ac85e..4ce420487d07 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2115,13 +2115,22 @@ struct netdev_notifier_change_info {
 	unsigned int flags_changed;
 };
 
+enum netdev_changeupper_event {
+	NETDEV_CHANGEUPPER_LINK,
+	NETDEV_CHANGEUPPER_UNLINK,
+};
+
 struct netdev_notifier_changeupper_info {
 	struct netdev_notifier_info info; /* must be first */
+	enum netdev_changeupper_event event;
 	struct net_device *upper_dev; /* new upper dev */
 	bool master; /* is upper dev master */
 	bool linking; /* is the nofication for link or unlink */
 };
 
+void netdev_changeupper_info_change(struct net_device *dev,
+				    struct netdev_notifier_changeupper_info *info);
+
 static inline void netdev_notifier_info_init(struct netdev_notifier_info *info,
 					     struct net_device *dev)
 {
@@ -3606,20 +3615,6 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
 struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
 				    netdev_features_t features);
 
-enum netdev_changeupper_event {
-	NETDEV_CHANGEUPPER_LINK,
-	NETDEV_CHANGEUPPER_UNLINK,
-};
-
-struct netdev_changeupper_info {
-	struct netdev_notifier_info	info; /* must be first */
-	enum netdev_changeupper_event	event;
-	struct net_device		*upper;
-};
-
-void netdev_changeupper_info_change(struct net_device *dev,
-				    struct netdev_changeupper_info *info);
-
 struct netdev_bonding_info {
 	ifslave	slave;
 	ifbond	master;
-- 
2.5.0



-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc net/core/dev.c
index a8e6cf4298d3,6e6f14e5d44f..000000000000
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@@ -5330,10 -5320,6 +5330,11 @@@ static int __netdev_upper_dev_link(stru
  	if (master && netdev_master_upper_dev_get(dev))
  		return -EBUSY;
  
++	changeupper_info.event = NETDEV_CHANGEUPPER_LINK;
 +	changeupper_info.upper_dev = upper_dev;
 +	changeupper_info.master = master;
 +	changeupper_info.linking = true;
 +
  	ret = __netdev_adjacent_dev_link_neighbour(dev, upper_dev, private,
  						   master);
  	if (ret)
@@@ -5468,14 -5456,10 +5469,15 @@@ EXPORT_SYMBOL(netdev_master_upper_dev_l
  void netdev_upper_dev_unlink(struct net_device *dev,
  			     struct net_device *upper_dev)
  {
 +	struct netdev_notifier_changeupper_info changeupper_info;
  	struct netdev_adjacent *i, *j;
 -	struct netdev_changeupper_info changeupper_info;
  	ASSERT_RTNL();
  
++	changeupper_info.event = NETDEV_CHANGEUPPER_UNLINK;
 +	changeupper_info.upper_dev = upper_dev;
 +	changeupper_info.master = netdev_master_upper_dev_get(dev) == upper_dev;
 +	changeupper_info.linking = false;
 +
  	__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
  
  	/* Here is the tricky part. We must remove all dev's lower

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* linux-next: manual merge of the rdma tree with the net-next tree
@ 2015-06-15  8:12 ` Michael Ellerman
  0 siblings, 0 replies; 26+ messages in thread
From: Michael Ellerman @ 2015-06-15  8:12 UTC (permalink / raw)
  To: Doug Ledford, David S. Miller
  Cc: linux-next, linux-kernel, Majd Dibbiny, Or Gerlitz, Matan Barak,
	Or Gerlitz

Hi Doug,

Today's linux-next merge of the rdma tree got a conflict in
drivers/infiniband/hw/mlx5/main.c between commit 1b5daf11b015 "IB/mlx5: Avoid
using the MAD_IFC command under ISSI > 0 mode" from the net-next tree and
commit 2528e33e6809 "IB/core: Pass hardware specific data in query_device" from
the rdma tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

cheers


diff --cc drivers/infiniband/hw/mlx5/main.c
index 79dadd627e9c,c6cb26e0c866..000000000000
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@@ -63,168 -62,36 +63,172 @@@ static char mlx5_version[] 
  	DRIVER_NAME ": Mellanox Connect-IB Infiniband driver v"
  	DRIVER_VERSION " (" DRIVER_RELDATE ")\n";
  
 +static enum rdma_link_layer
 +mlx5_ib_port_link_layer(struct ib_device *device)
 +{
 +	struct mlx5_ib_dev *dev = to_mdev(device);
 +
 +	switch (MLX5_CAP_GEN(dev->mdev, port_type)) {
 +	case MLX5_CAP_PORT_TYPE_IB:
 +		return IB_LINK_LAYER_INFINIBAND;
 +	case MLX5_CAP_PORT_TYPE_ETH:
 +		return IB_LINK_LAYER_ETHERNET;
 +	default:
 +		return IB_LINK_LAYER_UNSPECIFIED;
 +	}
 +}
 +
 +static int mlx5_use_mad_ifc(struct mlx5_ib_dev *dev)
 +{
 +	return !dev->mdev->issi;
 +}
 +
 +enum {
 +	MLX5_VPORT_ACCESS_METHOD_MAD,
 +	MLX5_VPORT_ACCESS_METHOD_HCA,
 +	MLX5_VPORT_ACCESS_METHOD_NIC,
 +};
 +
 +static int mlx5_get_vport_access_method(struct ib_device *ibdev)
 +{
 +	if (mlx5_use_mad_ifc(to_mdev(ibdev)))
 +		return MLX5_VPORT_ACCESS_METHOD_MAD;
 +
 +	if (mlx5_ib_port_link_layer(ibdev) ==
 +	    IB_LINK_LAYER_ETHERNET)
 +		return MLX5_VPORT_ACCESS_METHOD_NIC;
 +
 +	return MLX5_VPORT_ACCESS_METHOD_HCA;
 +}
 +
 +static int mlx5_query_system_image_guid(struct ib_device *ibdev,
 +					__be64 *sys_image_guid)
 +{
 +	struct mlx5_ib_dev *dev = to_mdev(ibdev);
 +	struct mlx5_core_dev *mdev = dev->mdev;
 +	u64 tmp;
 +	int err;
 +
 +	switch (mlx5_get_vport_access_method(ibdev)) {
 +	case MLX5_VPORT_ACCESS_METHOD_MAD:
 +		return mlx5_query_mad_ifc_system_image_guid(ibdev,
 +							    sys_image_guid);
 +
 +	case MLX5_VPORT_ACCESS_METHOD_HCA:
 +		err = mlx5_query_hca_vport_system_image_guid(mdev, &tmp);
 +		if (!err)
 +			*sys_image_guid = cpu_to_be64(tmp);
 +		return err;
 +
 +	default:
 +		return -EINVAL;
 +	}
 +}
 +
 +static int mlx5_query_max_pkeys(struct ib_device *ibdev,
 +				u16 *max_pkeys)
 +{
 +	struct mlx5_ib_dev *dev = to_mdev(ibdev);
 +	struct mlx5_core_dev *mdev = dev->mdev;
 +
 +	switch (mlx5_get_vport_access_method(ibdev)) {
 +	case MLX5_VPORT_ACCESS_METHOD_MAD:
 +		return mlx5_query_mad_ifc_max_pkeys(ibdev, max_pkeys);
 +
 +	case MLX5_VPORT_ACCESS_METHOD_HCA:
 +	case MLX5_VPORT_ACCESS_METHOD_NIC:
 +		*max_pkeys = mlx5_to_sw_pkey_sz(MLX5_CAP_GEN(mdev,
 +						pkey_table_size));
 +		return 0;
 +
 +	default:
 +		return -EINVAL;
 +	}
 +}
 +
 +static int mlx5_query_vendor_id(struct ib_device *ibdev,
 +				u32 *vendor_id)
 +{
 +	struct mlx5_ib_dev *dev = to_mdev(ibdev);
 +
 +	switch (mlx5_get_vport_access_method(ibdev)) {
 +	case MLX5_VPORT_ACCESS_METHOD_MAD:
 +		return mlx5_query_mad_ifc_vendor_id(ibdev, vendor_id);
 +
 +	case MLX5_VPORT_ACCESS_METHOD_HCA:
 +	case MLX5_VPORT_ACCESS_METHOD_NIC:
 +		return mlx5_core_query_vendor_id(dev->mdev, vendor_id);
 +
 +	default:
 +		return -EINVAL;
 +	}
 +}
 +
 +static int mlx5_query_node_guid(struct mlx5_ib_dev *dev,
 +				__be64 *node_guid)
 +{
 +	u64 tmp;
 +	int err;
 +
 +	switch (mlx5_get_vport_access_method(&dev->ib_dev)) {
 +	case MLX5_VPORT_ACCESS_METHOD_MAD:
 +		return mlx5_query_mad_ifc_node_guid(dev, node_guid);
 +
 +	case MLX5_VPORT_ACCESS_METHOD_HCA:
 +		err = mlx5_query_hca_vport_node_guid(dev->mdev, &tmp);
 +		if (!err)
 +			*node_guid = cpu_to_be64(tmp);
 +		return err;
 +
 +	default:
 +		return -EINVAL;
 +	}
 +}
 +
 +struct mlx5_reg_node_desc {
 +	u8	desc[64];
 +};
 +
 +static int mlx5_query_node_desc(struct mlx5_ib_dev *dev, char *node_desc)
 +{
 +	struct mlx5_reg_node_desc in;
 +
 +	if (mlx5_use_mad_ifc(dev))
 +		return mlx5_query_mad_ifc_node_desc(dev, node_desc);
 +
 +	memset(&in, 0, sizeof(in));
 +
 +	return mlx5_core_access_reg(dev->mdev, &in, sizeof(in), node_desc,
 +				    sizeof(struct mlx5_reg_node_desc),
 +				    MLX5_REG_NODE_DESC, 0, 0);
 +}
 +
  static int mlx5_ib_query_device(struct ib_device *ibdev,
- 				struct ib_device_attr *props)
+ 				struct ib_device_attr *props,
+ 				struct ib_udata *uhw)
  {
  	struct mlx5_ib_dev *dev = to_mdev(ibdev);
 -	struct ib_smp *in_mad  = NULL;
 -	struct ib_smp *out_mad = NULL;
 -	struct mlx5_general_caps *gen;
 +	struct mlx5_core_dev *mdev = dev->mdev;
  	int err = -ENOMEM;
  	int max_rq_sg;
  	int max_sq_sg;
 -	u64 flags;
  
+ 	if (uhw->inlen || uhw->outlen)
+ 		return -EINVAL;
+ 
 -	gen = &dev->mdev->caps.gen;
 -	in_mad  = kzalloc(sizeof(*in_mad), GFP_KERNEL);
 -	out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL);
 -	if (!in_mad || !out_mad)
 -		goto out;
 -
 -	init_query_mad(in_mad);
 -	in_mad->attr_id = IB_SMP_ATTR_NODE_INFO;
 +	memset(props, 0, sizeof(*props));
 +	err = mlx5_query_system_image_guid(ibdev,
 +					   &props->sys_image_guid);
 +	if (err)
 +		return err;
  
 -	err = mlx5_MAD_IFC(to_mdev(ibdev), 1, 1, 1, NULL, NULL, in_mad, out_mad);
 +	err = mlx5_query_max_pkeys(ibdev, &props->max_pkeys);
  	if (err)
 -		goto out;
 +		return err;
  
 -	memset(props, 0, sizeof(*props));
 +	err = mlx5_query_vendor_id(ibdev, &props->vendor_id);
 +	if (err)
 +		return err;
  
  	props->fw_ver = ((u64)fw_rev_maj(dev->mdev) << 32) |
  		(fw_rev_min(dev->mdev) << 16) |
@@@ -1067,9 -911,12 +1071,10 @@@ static int get_port_caps(struct mlx5_ib
  {
  	struct ib_device_attr *dprops = NULL;
  	struct ib_port_attr *pprops = NULL;
 -	struct mlx5_general_caps *gen;
  	int err = -ENOMEM;
  	int port;
+ 	struct ib_udata uhw = {.inlen = 0, .outlen = 0};
  
 -	gen = &dev->mdev->caps.gen;
  	pprops = kmalloc(sizeof(*pprops), GFP_KERNEL);
  	if (!pprops)
  		goto out;
@@@ -1473,10 -1311,11 +1499,11 @@@ static void *mlx5_ib_add(struct mlx5_co
  	dev->ib_dev.alloc_fast_reg_page_list = mlx5_ib_alloc_fast_reg_page_list;
  	dev->ib_dev.free_fast_reg_page_list  = mlx5_ib_free_fast_reg_page_list;
  	dev->ib_dev.check_mr_status	= mlx5_ib_check_mr_status;
+ 	dev->ib_dev.get_port_immutable  = mlx5_port_immutable;
  
 -	mlx5_ib_internal_query_odp_caps(dev);
 +	mlx5_ib_internal_fill_odp_caps(dev);
  
 -	if (mdev->caps.gen.flags & MLX5_DEV_CAP_FLAG_XRC) {
 +	if (MLX5_CAP_GEN(mdev, xrc)) {
  		dev->ib_dev.alloc_xrcd = mlx5_ib_alloc_xrcd;
  		dev->ib_dev.dealloc_xrcd = mlx5_ib_dealloc_xrcd;
  		dev->ib_dev.uverbs_cmd_mask |=




^ permalink raw reply	[flat|nested] 26+ messages in thread

* linux-next: manual merge of the rdma tree with the net-next tree
@ 2015-06-15  8:12 ` Michael Ellerman
  0 siblings, 0 replies; 26+ messages in thread
From: Michael Ellerman @ 2015-06-15  8:12 UTC (permalink / raw)
  To: Doug Ledford, David S. Miller
  Cc: linux-next, linux-kernel, Majd Dibbiny, Or Gerlitz, Matan Barak

Hi Doug,

Today's linux-next merge of the rdma tree got a conflict in
drivers/infiniband/hw/mlx5/main.c between commit 1b5daf11b015 "IB/mlx5: Avoid
using the MAD_IFC command under ISSI > 0 mode" from the net-next tree and
commit 2528e33e6809 "IB/core: Pass hardware specific data in query_device" from
the rdma tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

cheers


diff --cc drivers/infiniband/hw/mlx5/main.c
index 79dadd627e9c,c6cb26e0c866..000000000000
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@@ -63,168 -62,36 +63,172 @@@ static char mlx5_version[] 
  	DRIVER_NAME ": Mellanox Connect-IB Infiniband driver v"
  	DRIVER_VERSION " (" DRIVER_RELDATE ")\n";
  
 +static enum rdma_link_layer
 +mlx5_ib_port_link_layer(struct ib_device *device)
 +{
 +	struct mlx5_ib_dev *dev = to_mdev(device);
 +
 +	switch (MLX5_CAP_GEN(dev->mdev, port_type)) {
 +	case MLX5_CAP_PORT_TYPE_IB:
 +		return IB_LINK_LAYER_INFINIBAND;
 +	case MLX5_CAP_PORT_TYPE_ETH:
 +		return IB_LINK_LAYER_ETHERNET;
 +	default:
 +		return IB_LINK_LAYER_UNSPECIFIED;
 +	}
 +}
 +
 +static int mlx5_use_mad_ifc(struct mlx5_ib_dev *dev)
 +{
 +	return !dev->mdev->issi;
 +}
 +
 +enum {
 +	MLX5_VPORT_ACCESS_METHOD_MAD,
 +	MLX5_VPORT_ACCESS_METHOD_HCA,
 +	MLX5_VPORT_ACCESS_METHOD_NIC,
 +};
 +
 +static int mlx5_get_vport_access_method(struct ib_device *ibdev)
 +{
 +	if (mlx5_use_mad_ifc(to_mdev(ibdev)))
 +		return MLX5_VPORT_ACCESS_METHOD_MAD;
 +
 +	if (mlx5_ib_port_link_layer(ibdev) ==
 +	    IB_LINK_LAYER_ETHERNET)
 +		return MLX5_VPORT_ACCESS_METHOD_NIC;
 +
 +	return MLX5_VPORT_ACCESS_METHOD_HCA;
 +}
 +
 +static int mlx5_query_system_image_guid(struct ib_device *ibdev,
 +					__be64 *sys_image_guid)
 +{
 +	struct mlx5_ib_dev *dev = to_mdev(ibdev);
 +	struct mlx5_core_dev *mdev = dev->mdev;
 +	u64 tmp;
 +	int err;
 +
 +	switch (mlx5_get_vport_access_method(ibdev)) {
 +	case MLX5_VPORT_ACCESS_METHOD_MAD:
 +		return mlx5_query_mad_ifc_system_image_guid(ibdev,
 +							    sys_image_guid);
 +
 +	case MLX5_VPORT_ACCESS_METHOD_HCA:
 +		err = mlx5_query_hca_vport_system_image_guid(mdev, &tmp);
 +		if (!err)
 +			*sys_image_guid = cpu_to_be64(tmp);
 +		return err;
 +
 +	default:
 +		return -EINVAL;
 +	}
 +}
 +
 +static int mlx5_query_max_pkeys(struct ib_device *ibdev,
 +				u16 *max_pkeys)
 +{
 +	struct mlx5_ib_dev *dev = to_mdev(ibdev);
 +	struct mlx5_core_dev *mdev = dev->mdev;
 +
 +	switch (mlx5_get_vport_access_method(ibdev)) {
 +	case MLX5_VPORT_ACCESS_METHOD_MAD:
 +		return mlx5_query_mad_ifc_max_pkeys(ibdev, max_pkeys);
 +
 +	case MLX5_VPORT_ACCESS_METHOD_HCA:
 +	case MLX5_VPORT_ACCESS_METHOD_NIC:
 +		*max_pkeys = mlx5_to_sw_pkey_sz(MLX5_CAP_GEN(mdev,
 +						pkey_table_size));
 +		return 0;
 +
 +	default:
 +		return -EINVAL;
 +	}
 +}
 +
 +static int mlx5_query_vendor_id(struct ib_device *ibdev,
 +				u32 *vendor_id)
 +{
 +	struct mlx5_ib_dev *dev = to_mdev(ibdev);
 +
 +	switch (mlx5_get_vport_access_method(ibdev)) {
 +	case MLX5_VPORT_ACCESS_METHOD_MAD:
 +		return mlx5_query_mad_ifc_vendor_id(ibdev, vendor_id);
 +
 +	case MLX5_VPORT_ACCESS_METHOD_HCA:
 +	case MLX5_VPORT_ACCESS_METHOD_NIC:
 +		return mlx5_core_query_vendor_id(dev->mdev, vendor_id);
 +
 +	default:
 +		return -EINVAL;
 +	}
 +}
 +
 +static int mlx5_query_node_guid(struct mlx5_ib_dev *dev,
 +				__be64 *node_guid)
 +{
 +	u64 tmp;
 +	int err;
 +
 +	switch (mlx5_get_vport_access_method(&dev->ib_dev)) {
 +	case MLX5_VPORT_ACCESS_METHOD_MAD:
 +		return mlx5_query_mad_ifc_node_guid(dev, node_guid);
 +
 +	case MLX5_VPORT_ACCESS_METHOD_HCA:
 +		err = mlx5_query_hca_vport_node_guid(dev->mdev, &tmp);
 +		if (!err)
 +			*node_guid = cpu_to_be64(tmp);
 +		return err;
 +
 +	default:
 +		return -EINVAL;
 +	}
 +}
 +
 +struct mlx5_reg_node_desc {
 +	u8	desc[64];
 +};
 +
 +static int mlx5_query_node_desc(struct mlx5_ib_dev *dev, char *node_desc)
 +{
 +	struct mlx5_reg_node_desc in;
 +
 +	if (mlx5_use_mad_ifc(dev))
 +		return mlx5_query_mad_ifc_node_desc(dev, node_desc);
 +
 +	memset(&in, 0, sizeof(in));
 +
 +	return mlx5_core_access_reg(dev->mdev, &in, sizeof(in), node_desc,
 +				    sizeof(struct mlx5_reg_node_desc),
 +				    MLX5_REG_NODE_DESC, 0, 0);
 +}
 +
  static int mlx5_ib_query_device(struct ib_device *ibdev,
- 				struct ib_device_attr *props)
+ 				struct ib_device_attr *props,
+ 				struct ib_udata *uhw)
  {
  	struct mlx5_ib_dev *dev = to_mdev(ibdev);
 -	struct ib_smp *in_mad  = NULL;
 -	struct ib_smp *out_mad = NULL;
 -	struct mlx5_general_caps *gen;
 +	struct mlx5_core_dev *mdev = dev->mdev;
  	int err = -ENOMEM;
  	int max_rq_sg;
  	int max_sq_sg;
 -	u64 flags;
  
+ 	if (uhw->inlen || uhw->outlen)
+ 		return -EINVAL;
+ 
 -	gen = &dev->mdev->caps.gen;
 -	in_mad  = kzalloc(sizeof(*in_mad), GFP_KERNEL);
 -	out_mad = kmalloc(sizeof(*out_mad), GFP_KERNEL);
 -	if (!in_mad || !out_mad)
 -		goto out;
 -
 -	init_query_mad(in_mad);
 -	in_mad->attr_id = IB_SMP_ATTR_NODE_INFO;
 +	memset(props, 0, sizeof(*props));
 +	err = mlx5_query_system_image_guid(ibdev,
 +					   &props->sys_image_guid);
 +	if (err)
 +		return err;
  
 -	err = mlx5_MAD_IFC(to_mdev(ibdev), 1, 1, 1, NULL, NULL, in_mad, out_mad);
 +	err = mlx5_query_max_pkeys(ibdev, &props->max_pkeys);
  	if (err)
 -		goto out;
 +		return err;
  
 -	memset(props, 0, sizeof(*props));
 +	err = mlx5_query_vendor_id(ibdev, &props->vendor_id);
 +	if (err)
 +		return err;
  
  	props->fw_ver = ((u64)fw_rev_maj(dev->mdev) << 32) |
  		(fw_rev_min(dev->mdev) << 16) |
@@@ -1067,9 -911,12 +1071,10 @@@ static int get_port_caps(struct mlx5_ib
  {
  	struct ib_device_attr *dprops = NULL;
  	struct ib_port_attr *pprops = NULL;
 -	struct mlx5_general_caps *gen;
  	int err = -ENOMEM;
  	int port;
+ 	struct ib_udata uhw = {.inlen = 0, .outlen = 0};
  
 -	gen = &dev->mdev->caps.gen;
  	pprops = kmalloc(sizeof(*pprops), GFP_KERNEL);
  	if (!pprops)
  		goto out;
@@@ -1473,10 -1311,11 +1499,11 @@@ static void *mlx5_ib_add(struct mlx5_co
  	dev->ib_dev.alloc_fast_reg_page_list = mlx5_ib_alloc_fast_reg_page_list;
  	dev->ib_dev.free_fast_reg_page_list  = mlx5_ib_free_fast_reg_page_list;
  	dev->ib_dev.check_mr_status	= mlx5_ib_check_mr_status;
+ 	dev->ib_dev.get_port_immutable  = mlx5_port_immutable;
  
 -	mlx5_ib_internal_query_odp_caps(dev);
 +	mlx5_ib_internal_fill_odp_caps(dev);
  
 -	if (mdev->caps.gen.flags & MLX5_DEV_CAP_FLAG_XRC) {
 +	if (MLX5_CAP_GEN(mdev, xrc)) {
  		dev->ib_dev.alloc_xrcd = mlx5_ib_alloc_xrcd;
  		dev->ib_dev.dealloc_xrcd = mlx5_ib_dealloc_xrcd;
  		dev->ib_dev.uverbs_cmd_mask |=

^ permalink raw reply	[flat|nested] 26+ messages in thread

* linux-next: manual merge of the rdma tree with the net-next tree
@ 2015-06-15  8:11 ` Michael Ellerman
  0 siblings, 0 replies; 26+ messages in thread
From: Michael Ellerman @ 2015-06-15  8:11 UTC (permalink / raw)
  To: Doug Ledford, David S. Miller
  Cc: linux-next, linux-kernel, Steve Wise, Hariprasad Shenai,
	Hariprasad Shenai

Hi Doug,

Today's linux-next merge of the rdma tree got a conflict in
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c and
drivers/net/ethernet/chelsio/cxgb4/sge.c between commit b26127227677
"cxgb4/cxgb4vf: function and argument name cleanup" from the net-next tree and
commit 66cf188eba52 "cxgb4: Support for user mode bar2 mappings with T4" from
the rdma tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

cheers


diff --cc drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 0e27f2266e6b,a9355593e65e..000000000000
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@@ -2356,8 -2352,8 +2358,8 @@@ static void process_db_drop(struct work
  		unsigned int bar2_qid;
  		int ret;
  
 -		ret = cxgb4_t4_bar2_sge_qregs(adap, qid, T4_BAR2_QTYPE_EGRESS,
 -					      0, &bar2_qoffset, &bar2_qid);
 +		ret = t4_bar2_sge_qregs(adap, qid, T4_BAR2_QTYPE_EGRESS,
- 					&bar2_qoffset, &bar2_qid);
++					0, &bar2_qoffset, &bar2_qid);
  		if (ret)
  			dev_err(adap->pdev_dev, "doorbell drop recovery: "
  				"qid=%d, pidx_inc=%d\n", qid, pidx_inc);
diff --cc drivers/net/ethernet/chelsio/cxgb4/sge.c
index 6b7c37fd0252,1b99aecde736..000000000000
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@@ -2401,8 -2429,8 +2401,8 @@@ static void __iomem *bar2_address(struc
  	u64 bar2_qoffset;
  	int ret;
  
- 	ret = t4_bar2_sge_qregs(adapter, qid, qtype,
 -	ret = cxgb4_t4_bar2_sge_qregs(adapter, qid, qtype, 0,
 -				      &bar2_qoffset, pbar2_qid);
++	ret = t4_bar2_sge_qregs(adapter, qid, qtype, 0,
 +				&bar2_qoffset, pbar2_qid);
  	if (ret)
  		return NULL;
  




^ permalink raw reply	[flat|nested] 26+ messages in thread

* linux-next: manual merge of the rdma tree with the net-next tree
@ 2015-06-15  8:11 ` Michael Ellerman
  0 siblings, 0 replies; 26+ messages in thread
From: Michael Ellerman @ 2015-06-15  8:11 UTC (permalink / raw)
  To: Doug Ledford, David S. Miller
  Cc: linux-next, linux-kernel, Steve Wise, Hariprasad Shenai

Hi Doug,

Today's linux-next merge of the rdma tree got a conflict in
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c and
drivers/net/ethernet/chelsio/cxgb4/sge.c between commit b26127227677
"cxgb4/cxgb4vf: function and argument name cleanup" from the net-next tree and
commit 66cf188eba52 "cxgb4: Support for user mode bar2 mappings with T4" from
the rdma tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

cheers


diff --cc drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 0e27f2266e6b,a9355593e65e..000000000000
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@@ -2356,8 -2352,8 +2358,8 @@@ static void process_db_drop(struct work
  		unsigned int bar2_qid;
  		int ret;
  
 -		ret = cxgb4_t4_bar2_sge_qregs(adap, qid, T4_BAR2_QTYPE_EGRESS,
 -					      0, &bar2_qoffset, &bar2_qid);
 +		ret = t4_bar2_sge_qregs(adap, qid, T4_BAR2_QTYPE_EGRESS,
- 					&bar2_qoffset, &bar2_qid);
++					0, &bar2_qoffset, &bar2_qid);
  		if (ret)
  			dev_err(adap->pdev_dev, "doorbell drop recovery: "
  				"qid=%d, pidx_inc=%d\n", qid, pidx_inc);
diff --cc drivers/net/ethernet/chelsio/cxgb4/sge.c
index 6b7c37fd0252,1b99aecde736..000000000000
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@@ -2401,8 -2429,8 +2401,8 @@@ static void __iomem *bar2_address(struc
  	u64 bar2_qoffset;
  	int ret;
  
- 	ret = t4_bar2_sge_qregs(adapter, qid, qtype,
 -	ret = cxgb4_t4_bar2_sge_qregs(adapter, qid, qtype, 0,
 -				      &bar2_qoffset, pbar2_qid);
++	ret = t4_bar2_sge_qregs(adapter, qid, qtype, 0,
 +				&bar2_qoffset, pbar2_qid);
  	if (ret)
  		return NULL;
  

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2016-03-23 23:23 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17  3:20 linux-next: manual merge of the rdma tree with the net-next tree Michael Ellerman
  -- strict thread matches above, loose matches on Subject: below --
2016-03-16  0:58 Stephen Rothwell
2016-03-16  0:58 ` Stephen Rothwell
2016-03-16 14:27 ` Maor Gottlieb
2016-03-16 17:18 ` Linus Torvalds
2016-03-16 17:35   ` Doug Ledford
2016-03-16 17:44     ` Linus Torvalds
2016-03-23 23:04       ` Or Gerlitz
2016-03-23 23:23         ` Linus Torvalds
2016-03-16 20:52   ` Stephen Rothwell
2016-03-16 21:01     ` Linus Torvalds
2016-03-16 21:15     ` Andrew Lunn
2016-03-16 22:35       ` Stephen Rothwell
2016-01-05  1:51 Stephen Rothwell
2016-01-05  1:51 ` Stephen Rothwell
2016-01-05 17:05 ` Or Gerlitz
2016-01-05 17:05   ` Or Gerlitz
2016-01-05 20:51   ` Stephen Rothwell
2016-01-05 20:51     ` Stephen Rothwell
2015-08-28  1:26 Stephen Rothwell
2015-08-28  1:26 ` Stephen Rothwell
2015-08-28  6:35 ` Jiri Pirko
2015-06-15  8:12 Michael Ellerman
2015-06-15  8:12 ` Michael Ellerman
2015-06-15  8:11 Michael Ellerman
2015-06-15  8:11 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.