linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the net-next tree with the rdma tree
@ 2020-05-08  3:18 Stephen Rothwell
  2020-05-08 12:35 ` Jason Gunthorpe
  2020-05-09  7:40 ` Saeed Mahameed
  0 siblings, 2 replies; 28+ messages in thread
From: Stephen Rothwell @ 2020-05-08  3:18 UTC (permalink / raw)
  To: David Miller, Networking, Doug Ledford, Jason Gunthorpe,
	Leon Romanovsky, Eric Dumazet
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Maor Gottlieb, Saeed Mahameed

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

Hi all,

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

  drivers/net/bonding/bond_main.c

between commits:

  ed7d4f023b1a ("bonding: Rename slave_arr to usable_slaves")
  c071d91d2a89 ("bonding: Add helper function to get the xmit slave based on hash")
  29d5bbccb3a1 ("bonding: Add helper function to get the xmit slave in rr mode")

from the rdma and mlx5-next trees and commit:

  ae46f184bc1f ("bonding: propagate transmit status")

from the net-next tree.

I fixed it up (I think - 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 drivers/net/bonding/bond_main.c
index 39b1ad7edbb4,4f9e7c421f57..000000000000
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@@ -4022,32 -4024,12 +4022,30 @@@ static struct slave *bond_xmit_roundrob
  non_igmp:
  	slave_cnt = READ_ONCE(bond->slave_cnt);
  	if (likely(slave_cnt)) {
 -		slave_id = bond_rr_gen_slave_id(bond);
 -		return bond_xmit_slave_id(bond, skb, slave_id % slave_cnt);
 +		slave_id = bond_rr_gen_slave_id(bond) % slave_cnt;
 +		return bond_get_slave_by_id(bond, slave_id);
  	}
 +	return NULL;
 +}
 +
 +static netdev_tx_t bond_xmit_roundrobin(struct sk_buff *skb,
 +					struct net_device *bond_dev)
 +{
 +	struct bonding *bond = netdev_priv(bond_dev);
 +	struct slave *slave;
 +
 +	slave = bond_xmit_roundrobin_slave_get(bond, skb);
 +	if (slave)
- 		bond_dev_queue_xmit(bond, skb, slave->dev);
- 	else
- 		bond_tx_drop(bond_dev, skb);
- 	return NETDEV_TX_OK;
++		return bond_dev_queue_xmit(bond, skb, slave->dev);
+ 	return bond_tx_drop(bond_dev, skb);
  }
  
 +static struct slave *bond_xmit_activebackup_slave_get(struct bonding *bond,
 +						      struct sk_buff *skb)
 +{
 +	return rcu_dereference(bond->curr_active_slave);
 +}
 +
  /* In active-backup mode, we know that bond->curr_active_slave is always valid if
   * the bond has a usable interface.
   */
@@@ -4057,13 -4039,11 +4055,11 @@@ static netdev_tx_t bond_xmit_activeback
  	struct bonding *bond = netdev_priv(bond_dev);
  	struct slave *slave;
  
 -	slave = rcu_dereference(bond->curr_active_slave);
 +	slave = bond_xmit_activebackup_slave_get(bond, skb);
  	if (slave)
- 		bond_dev_queue_xmit(bond, skb, slave->dev);
- 	else
- 		bond_tx_drop(bond_dev, skb);
+ 		return bond_dev_queue_xmit(bond, skb, slave->dev);
  
- 	return NETDEV_TX_OK;
+ 	return bond_tx_drop(bond_dev, skb);
  }
  
  /* Use this to update slave_array when (a) it's not appropriate to update
@@@ -4254,17 -4178,17 +4250,14 @@@ static netdev_tx_t bond_3ad_xor_xmit(st
  				     struct net_device *dev)
  {
  	struct bonding *bond = netdev_priv(dev);
 -	struct slave *slave;
  	struct bond_up_slave *slaves;
 -	unsigned int count;
 +	struct slave *slave;
  
 -	slaves = rcu_dereference(bond->slave_arr);
 -	count = slaves ? READ_ONCE(slaves->count) : 0;
 -	if (likely(count)) {
 -		slave = slaves->arr[bond_xmit_hash(bond, skb) % count];
 +	slaves = rcu_dereference(bond->usable_slaves);
 +	slave = bond_xmit_3ad_xor_slave_get(bond, skb, slaves);
 +	if (likely(slave))
- 		bond_dev_queue_xmit(bond, skb, slave->dev);
- 	else
- 		bond_tx_drop(dev, skb);
- 
- 	return NETDEV_TX_OK;
+ 		return bond_dev_queue_xmit(bond, skb, slave->dev);
 -	}
+ 	return bond_tx_drop(dev, skb);
  }
  
  /* in broadcast mode, we send everything to all usable interfaces. */

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

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2020-05-08  3:18 linux-next: manual merge of the net-next tree with the rdma tree Stephen Rothwell
@ 2020-05-08 12:35 ` Jason Gunthorpe
  2020-05-09  7:49   ` Saeed Mahameed
  2020-05-09  7:40 ` Saeed Mahameed
  1 sibling, 1 reply; 28+ messages in thread
From: Jason Gunthorpe @ 2020-05-08 12:35 UTC (permalink / raw)
  To: Stephen Rothwell, Saeed Mahameed
  Cc: David Miller, Networking, Doug Ledford, Leon Romanovsky,
	Eric Dumazet, Linux Next Mailing List, Linux Kernel Mailing List,
	Maor Gottlieb

On Fri, May 08, 2020 at 01:18:51PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   drivers/net/bonding/bond_main.c
> 
> between commits:
> 
>   ed7d4f023b1a ("bonding: Rename slave_arr to usable_slaves")
>   c071d91d2a89 ("bonding: Add helper function to get the xmit slave based on hash")
>   29d5bbccb3a1 ("bonding: Add helper function to get the xmit slave in rr mode")
> 
> from the rdma and mlx5-next trees and commit:
> 
>   ae46f184bc1f ("bonding: propagate transmit status")
> 
> from the net-next tree.

Saeed? These patches in the shared branch were supposed to be a PR to
net-net? I see it hasn't happened yet and now we have conflicts?? 

Jason

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2020-05-08  3:18 linux-next: manual merge of the net-next tree with the rdma tree Stephen Rothwell
  2020-05-08 12:35 ` Jason Gunthorpe
@ 2020-05-09  7:40 ` Saeed Mahameed
  1 sibling, 0 replies; 28+ messages in thread
From: Saeed Mahameed @ 2020-05-09  7:40 UTC (permalink / raw)
  To: sfr, Jason Gunthorpe, edumazet, davem, netdev, dledford, leon
  Cc: linux-next, Maor Gottlieb, linux-kernel

On Fri, 2020-05-08 at 13:18 +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   drivers/net/bonding/bond_main.c
> 
> between commits:
> 
>   ed7d4f023b1a ("bonding: Rename slave_arr to usable_slaves")
>   c071d91d2a89 ("bonding: Add helper function to get the xmit slave
> based on hash")
>   29d5bbccb3a1 ("bonding: Add helper function to get the xmit slave
> in rr mode")
> 
> from the rdma and mlx5-next trees and commit:
> 
>   ae46f184bc1f ("bonding: propagate transmit status")
> 
> from the net-next tree.
> 
> I fixed it up (I think - 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.
> 

Hi Stephen and thanks for the report. 

Your fix seems to be ok, i think it is missing some hunks for
bond_get_slave_by_id function and some "likely" directives are missing,
which were added by Maor's or Eric's patches.

Anyway this is already fixed up in my net-next-mlx5 tree and will be
submitted very soon to net-next with the conflict fixup .. 

Thanks,
Saeed.

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2020-05-08 12:35 ` Jason Gunthorpe
@ 2020-05-09  7:49   ` Saeed Mahameed
  0 siblings, 0 replies; 28+ messages in thread
From: Saeed Mahameed @ 2020-05-09  7:49 UTC (permalink / raw)
  To: Jason Gunthorpe, sfr
  Cc: davem, linux-next, Maor Gottlieb, linux-kernel, netdev, dledford,
	leon, edumazet

On Fri, 2020-05-08 at 09:35 -0300, Jason Gunthorpe wrote:
> On Fri, May 08, 2020 at 01:18:51PM +1000, Stephen Rothwell wrote:
> > Hi all,
> > 
> > Today's linux-next merge of the net-next tree got a conflict in:
> > 
> >   drivers/net/bonding/bond_main.c
> > 
> > between commits:
> > 
> >   ed7d4f023b1a ("bonding: Rename slave_arr to usable_slaves")
> >   c071d91d2a89 ("bonding: Add helper function to get the xmit slave
> > based on hash")
> >   29d5bbccb3a1 ("bonding: Add helper function to get the xmit slave
> > in rr mode")
> > 
> > from the rdma and mlx5-next trees and commit:
> > 
> >   ae46f184bc1f ("bonding: propagate transmit status")
> > 
> > from the net-next tree.
> 
> Saeed? These patches in the shared branch were supposed to be a PR to
> net-net? I see it hasn't happened yet and now we have conflicts?? 
> 

Yes, I don't usually send standalone PRs of mlx5-next, and I only do it
with the corresponding (depending on) patches from net-next-mlx5, but I
agree this one was different I should have submitted it .. anyway the
conflict is minor, i already fixed it up and will submit soon..

Thanks,
Saeed.

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2021-10-28  0:56 Stephen Rothwell
@ 2021-10-28  7:48 ` Saeed Mahameed
  0 siblings, 0 replies; 28+ messages in thread
From: Saeed Mahameed @ 2021-10-28  7:48 UTC (permalink / raw)
  To: sfr, Jason Gunthorpe, davem, netdev, dledford
  Cc: Ben Ben Ishay, Leon Romanovsky, Aharon Landau, linux-kernel,
	linux-next, leon

On Thu, 2021-10-28 at 11:56 +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> 
> between commit:
> 
>   83fec3f12a59 ("RDMA/mlx5: Replace struct mlx5_core_mkey by u32 key")
> 
> from the rdma tree and commit:
> 
>   e5ca8fb08ab2 ("net/mlx5e: Add control path for SHAMPO feature")
> 
> 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.
> 


A merge conflict resolution pr was already sent to net-next,
https://lore.kernel.org/netdev/20211028052104.1071670-1-saeed@kernel.org/T/#u


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

* linux-next: manual merge of the net-next tree with the rdma tree
@ 2021-10-28  0:56 Stephen Rothwell
  2021-10-28  7:48 ` Saeed Mahameed
  0 siblings, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2021-10-28  0:56 UTC (permalink / raw)
  To: David Miller, Networking, Doug Ledford, Jason Gunthorpe
  Cc: Aharon Landau, Ben Ben-Ishay, Leon Romanovsky, Leon Romanovsky,
	Linux Kernel Mailing List, Linux Next Mailing List,
	Saeed Mahameed

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

Hi all,

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

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

between commit:

  83fec3f12a59 ("RDMA/mlx5: Replace struct mlx5_core_mkey by u32 key")

from the rdma tree and commit:

  e5ca8fb08ab2 ("net/mlx5e: Add control path for SHAMPO feature")

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 drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 5fce9401ac74,6f398f636f01..000000000000
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@@ -233,9 -272,10 +272,9 @@@ static int mlx5e_rq_alloc_mpwqe_info(st
  	return 0;
  }
  
- static int mlx5e_create_umr_mkey(struct mlx5_core_dev *mdev,
- 				 u64 npages, u8 page_shift, u32 *umr_mkey,
- 				 dma_addr_t filler_addr)
+ static int mlx5e_create_umr_mtt_mkey(struct mlx5_core_dev *mdev,
 -				     u64 npages, u8 page_shift,
 -				     struct mlx5_core_mkey *umr_mkey,
++				     u64 npages, u8 page_shift, u32 *umr_mkey,
+ 				     dma_addr_t filler_addr)
  {
  	struct mlx5_mtt *mtt;
  	int inlen;
@@@ -606,8 -761,9 +760,9 @@@ static void mlx5e_free_rq(struct mlx5e_
  	switch (rq->wq_type) {
  	case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ:
  		kvfree(rq->mpwqe.info);
 -		mlx5_core_destroy_mkey(rq->mdev, &rq->umr_mkey);
 +		mlx5_core_destroy_mkey(rq->mdev, rq->umr_mkey);
  		mlx5e_free_mpwqe_rq_drop_page(rq);
+ 		mlx5e_rq_free_shampo(rq);
  		break;
  	default: /* MLX5_WQ_TYPE_CYCLIC */
  		kvfree(rq->wqe.frags);

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

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

* linux-next: manual merge of the net-next tree with the rdma tree
@ 2021-10-19 23:34 Stephen Rothwell
  0 siblings, 0 replies; 28+ messages in thread
From: Stephen Rothwell @ 2021-10-19 23:34 UTC (permalink / raw)
  To: David Miller, Networking, Doug Ledford, Jason Gunthorpe
  Cc: Aharon Landau, Leon Romanovsky, Leon Romanovsky,
	Linux Kernel Mailing List, Linux Next Mailing List,
	Maor Gottlieb, Mark Zhang, Saeed Mahameed

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

Hi all,

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

  include/linux/mlx5/fs.h

between commit:

  b8dfed636fc6 ("net/mlx5: Add priorities for counters in RDMA namespaces")

from the rdma tree and commit:

  425a563acb1d ("net/mlx5: Introduce port selection namespace")

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 include/linux/mlx5/fs.h
index f2c3da2006d9,7a43fec63a35..000000000000
--- a/include/linux/mlx5/fs.h
+++ b/include/linux/mlx5/fs.h
@@@ -83,8 -83,7 +83,9 @@@ enum mlx5_flow_namespace_type 
  	MLX5_FLOW_NAMESPACE_RDMA_RX,
  	MLX5_FLOW_NAMESPACE_RDMA_RX_KERNEL,
  	MLX5_FLOW_NAMESPACE_RDMA_TX,
 +	MLX5_FLOW_NAMESPACE_RDMA_RX_COUNTERS,
 +	MLX5_FLOW_NAMESPACE_RDMA_TX_COUNTERS,
+ 	MLX5_FLOW_NAMESPACE_PORT_SEL,
  };
  
  enum {

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

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

* linux-next: manual merge of the net-next tree with the rdma tree
@ 2019-06-20  2:15 Stephen Rothwell
  0 siblings, 0 replies; 28+ messages in thread
From: Stephen Rothwell @ 2019-06-20  2:15 UTC (permalink / raw)
  To: David Miller, Networking, Doug Ledford, Jason Gunthorpe
  Cc: Linux Next Mailing List, Linux Kernel Mailing List, Florian Westphal

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

Hi all,

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

  drivers/infiniband/hw/nes/nes.c

between commit:

  2d3c72ed5041 ("rdma: Remove nes")

from the rdma tree and commit:

  2638eb8b50cf ("net: ipv4: provide __rcu annotation for ifa_list")

from the net-next tree.

I fixed it up (I removed the file) 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

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

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2019-02-27 16:24 ` Doug Ledford
@ 2019-02-28  9:05   ` Leon Romanovsky
  0 siblings, 0 replies; 28+ messages in thread
From: Leon Romanovsky @ 2019-02-28  9:05 UTC (permalink / raw)
  To: Doug Ledford
  Cc: Stephen Rothwell, David Miller, Networking, Jason Gunthorpe,
	Linux Next Mailing List, Linux Kernel Mailing List,
	Shamir Rabinovitch, Jakub Kicinski

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

On Wed, Feb 27, 2019 at 11:24:51AM -0500, Doug Ledford wrote:
> On Wed, 2019-02-27 at 11:25 +1100, Stephen Rothwell wrote:
> > Hi all,
> >
> > Today's linux-next merge of the net-next tree got a conflict in:
> >
> >   drivers/infiniband/hw/mlx4/Kconfig
> >
> > between commit:
> >
> >   6fa8f1afd337 ("IB/{core,uverbs}: Move ib_umem_xxx functions from ib_core to ib_uverbs")
> >
> > from the rdma tree and commit:
> >
> >   f4b6bcc7002f ("net: devlink: turn devlink into a built-in")
> >
> > 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.
> >
>
> Thanks Stephen, we'll add it to the (largish this release) list of
> conflicts to bring to Linus' attention.

Thanks

>
> --
> Doug Ledford <dledford@redhat.com>
>     GPG KeyID: B826A3330E572FDD
>     Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2019-02-27  0:25 Stephen Rothwell
@ 2019-02-27 16:24 ` Doug Ledford
  2019-02-28  9:05   ` Leon Romanovsky
  0 siblings, 1 reply; 28+ messages in thread
From: Doug Ledford @ 2019-02-27 16:24 UTC (permalink / raw)
  To: Stephen Rothwell, David Miller, Networking, Jason Gunthorpe
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Shamir Rabinovitch, Jakub Kicinski

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

On Wed, 2019-02-27 at 11:25 +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   drivers/infiniband/hw/mlx4/Kconfig
> 
> between commit:
> 
>   6fa8f1afd337 ("IB/{core,uverbs}: Move ib_umem_xxx functions from ib_core to ib_uverbs")
> 
> from the rdma tree and commit:
> 
>   f4b6bcc7002f ("net: devlink: turn devlink into a built-in")
> 
> 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.
> 

Thanks Stephen, we'll add it to the (largish this release) list of
conflicts to bring to Linus' attention.

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* linux-next: manual merge of the net-next tree with the rdma tree
@ 2019-02-27  0:25 Stephen Rothwell
  2019-02-27 16:24 ` Doug Ledford
  0 siblings, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2019-02-27  0:25 UTC (permalink / raw)
  To: David Miller, Networking, Doug Ledford, Jason Gunthorpe
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Shamir Rabinovitch, Jakub Kicinski

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

Hi all,

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

  drivers/infiniband/hw/mlx4/Kconfig

between commit:

  6fa8f1afd337 ("IB/{core,uverbs}: Move ib_umem_xxx functions from ib_core to ib_uverbs")

from the rdma tree and commit:

  f4b6bcc7002f ("net: devlink: turn devlink into a built-in")

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 drivers/infiniband/hw/mlx4/Kconfig
index db4aa13ebae0,4e9936731867..000000000000
--- a/drivers/infiniband/hw/mlx4/Kconfig
+++ b/drivers/infiniband/hw/mlx4/Kconfig
@@@ -1,7 -1,7 +1,6 @@@
  config MLX4_INFINIBAND
  	tristate "Mellanox ConnectX HCA support"
  	depends on NETDEVICES && ETHERNET && PCI && INET
- 	depends on MAY_USE_DEVLINK
 -	depends on INFINIBAND_USER_ACCESS || !INFINIBAND_USER_ACCESS
  	select NET_VENDOR_MELLANOX
  	select MLX4_CORE
  	---help---

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

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2019-02-18  0:05 Stephen Rothwell
@ 2019-02-18 10:48 ` Leon Romanovsky
  0 siblings, 0 replies; 28+ messages in thread
From: Leon Romanovsky @ 2019-02-18 10:48 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: David Miller, Networking, Doug Ledford, Jason Gunthorpe,
	Linux Next Mailing List, Linux Kernel Mailing List, Mark Bloch,
	Bodong Wang, Saeed Mahameed

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

On Mon, Feb 18, 2019 at 11:05:49AM +1100, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the net-next tree got a conflict in:
>
>   drivers/infiniband/hw/mlx5/ib_rep.c
>
> between commits:
>
>   459cc69fa4c1 ("RDMA: Provide safe ib_alloc_device() function")
>   fc9e4477f924 ("RDMA/mlx5: Fix memory leak in case we fail to add an IB device")
>
> from the rdma tree and commit:
>
>   f0666f1f22b5 ("IB/mlx5: Use unified register/load function for uplink and VF vports")
>
> 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.
>

Thanks a lot for your resolution.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* linux-next: manual merge of the net-next tree with the rdma tree
@ 2019-02-18  0:05 Stephen Rothwell
  2019-02-18 10:48 ` Leon Romanovsky
  0 siblings, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2019-02-18  0:05 UTC (permalink / raw)
  To: David Miller, Networking, Doug Ledford, Jason Gunthorpe
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Leon Romanovsky, Mark Bloch, Bodong Wang, Saeed Mahameed

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

Hi all,

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

  drivers/infiniband/hw/mlx5/ib_rep.c

between commits:

  459cc69fa4c1 ("RDMA: Provide safe ib_alloc_device() function")
  fc9e4477f924 ("RDMA/mlx5: Fix memory leak in case we fail to add an IB device")

from the rdma tree and commit:

  f0666f1f22b5 ("IB/mlx5: Use unified register/load function for uplink and VF vports")

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 drivers/infiniband/hw/mlx5/ib_rep.c
index 95ac97af6166,4700cffb5a00..000000000000
--- a/drivers/infiniband/hw/mlx5/ib_rep.c
+++ b/drivers/infiniband/hw/mlx5/ib_rep.c
@@@ -48,29 -49,15 +49,15 @@@ static const struct mlx5_ib_profile vf_
  static int
  mlx5_ib_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
  {
+ 	const struct mlx5_ib_profile *profile;
  	struct mlx5_ib_dev *ibdev;
  
+ 	if (rep->vport == MLX5_VPORT_UPLINK)
+ 		profile = &uplink_rep_profile;
+ 	else
+ 		profile = &vf_rep_profile;
+ 
 -	ibdev = (struct mlx5_ib_dev *)ib_alloc_device(sizeof(*ibdev));
 +	ibdev = ib_alloc_device(mlx5_ib_dev, ib_dev);
  	if (!ibdev)
  		return -ENOMEM;
  
@@@ -78,10 -65,8 +65,10 @@@
  	ibdev->mdev = dev;
  	ibdev->num_ports = max(MLX5_CAP_GEN(dev, num_ports),
  			       MLX5_CAP_GEN(dev, num_vhca_ports));
- 	if (!__mlx5_ib_add(ibdev, &rep_profile)) {
 -	if (!__mlx5_ib_add(ibdev, profile))
++	if (!__mlx5_ib_add(ibdev, profile)) {
 +		ib_dealloc_device(&ibdev->ib_dev);
  		return -EINVAL;
 +	}
  
  	rep->rep_if[REP_IB].priv = ibdev;
  

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

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2018-08-02  2:05 Stephen Rothwell
@ 2018-08-15 23:45 ` Stephen Rothwell
  0 siblings, 0 replies; 28+ messages in thread
From: Stephen Rothwell @ 2018-08-15 23:45 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: David Miller, Networking, Linux-Next Mailing List,
	Linux Kernel Mailing List, YueHaibing, Bart Van Assche

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

Hi all,

On Thu, 2 Aug 2018 12:05:03 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   net/rds/ib_send.c
> 
> between commit:
> 
>   d34ac5cd3a73 ("RDMA, core and ULPs: Declare ib_post_send() and ib_post_recv() arguments const")
> 
> from the rdma tree and commit:
> 
>   87f70132b08e ("rds: remove redundant variable 'rds_ibdev'")
> 
> 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/rds/ib_send.c
> index 8ac80c1b051e,c8dd3125d398..000000000000
> --- a/net/rds/ib_send.c
> +++ b/net/rds/ib_send.c
> @@@ -758,8 -758,7 +758,7 @@@ int rds_ib_xmit_atomic(struct rds_conne
>   {
>   	struct rds_ib_connection *ic = conn->c_transport_data;
>   	struct rds_ib_send_work *send = NULL;
>  -	struct ib_send_wr *failed_wr;
>  +	const struct ib_send_wr *failed_wr;
> - 	struct rds_ib_device *rds_ibdev;
>   	u32 pos;
>   	u32 work_alloc;
>   	int ret;

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

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2018-07-02  0:21 Stephen Rothwell
@ 2018-08-15 23:41 ` Stephen Rothwell
  0 siblings, 0 replies; 28+ messages in thread
From: Stephen Rothwell @ 2018-08-15 23:41 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: David Miller, Networking, Linux-Next Mailing List,
	Linux Kernel Mailing List, Parav Pandit

[-- 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 --]

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

* linux-next: manual merge of the net-next tree with the rdma tree
@ 2018-08-02  2:05 Stephen Rothwell
  2018-08-15 23:45 ` Stephen Rothwell
  0 siblings, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2018-08-02  2:05 UTC (permalink / raw)
  To: David Miller, Networking, Doug Ledford, Jason Gunthorpe
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, YueHaibing,
	Bart Van Assche

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

Hi all,

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

  net/rds/ib_send.c

between commit:

  d34ac5cd3a73 ("RDMA, core and ULPs: Declare ib_post_send() and ib_post_recv() arguments const")

from the rdma tree and commit:

  87f70132b08e ("rds: remove redundant variable 'rds_ibdev'")

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/rds/ib_send.c
index 8ac80c1b051e,c8dd3125d398..000000000000
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@@ -758,8 -758,7 +758,7 @@@ int rds_ib_xmit_atomic(struct rds_conne
  {
  	struct rds_ib_connection *ic = conn->c_transport_data;
  	struct rds_ib_send_work *send = NULL;
 -	struct ib_send_wr *failed_wr;
 +	const struct ib_send_wr *failed_wr;
- 	struct rds_ib_device *rds_ibdev;
  	u32 pos;
  	u32 work_alloc;
  	int ret;

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

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

* RE: linux-next: manual merge of the net-next tree with the rdma tree
  2018-08-01 17:13             ` Jason Gunthorpe
@ 2018-08-01 18:30               ` Parav Pandit
  0 siblings, 0 replies; 28+ messages in thread
From: Parav Pandit @ 2018-08-01 18:30 UTC (permalink / raw)
  To: Jason Gunthorpe, Stephen Rothwell
  Cc: David Miller, Networking, Doug Ledford, Linux-Next Mailing List,
	Linux Kernel Mailing List, Ursula Braun, Leon Romanovsky,
	linux-rdma



> -----Original Message-----
> From: Jason Gunthorpe <jgg@ziepe.ca>
> Sent: Wednesday, August 1, 2018 12:14 PM
> To: Stephen Rothwell <sfr@canb.auug.org.au>
> Cc: Parav Pandit <parav@mellanox.com>; David Miller
> <davem@davemloft.net>; Networking <netdev@vger.kernel.org>; Doug
> Ledford <dledford@redhat.com>; Linux-Next Mailing List <linux-
> next@vger.kernel.org>; Linux Kernel Mailing List <linux-
> kernel@vger.kernel.org>; Ursula Braun <ubraun@linux.ibm.com>; Leon
> Romanovsky <leonro@mellanox.com>; linux-rdma@vger.kernel.org
> Subject: Re: linux-next: manual merge of the net-next tree with the rdma tree
> 
> On Wed, Aug 01, 2018 at 03:33:45PM +1000, Stephen Rothwell wrote:
> > Hi Parav,
> >
> > On Tue, 31 Jul 2018 21:12:00 +0000 Parav Pandit <parav@mellanox.com>
> wrote:
> > >
> > > You might want to consider this compatibility patch in Linux-rdma
> > > tree to avoid a merge conflict of smc.
> > >
> > > https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit
> > > /?h=for-next&id=7aaa1807e698f73094b78f0ef25b1a37a4409a55
> >
> > Ok, since commit that is now in the rdma tree, my resolution of the
> > original conflicts comes down to dropping all the changes to
> > net/smc/smc_core.c net/smc/smc_ib.c that come from the rdma tree and
> > adding
> >
> > #include <rdma/ib_cache.h>
> >
> > to net/smc/smc_ib.c.
> 
> Oh, that means I put the compat inline in the wrong header? Sigh.
> 
It was in wrong place originally in ib_verbs.h because lately it returned all the entries from the cache.
So ib_cache.h was/is correct place.
But devel happened at pace where we eventually deprecated it.
So from pure compat perspective, yeah, it should be in wrong file i.e. ib_verbs.h but otherwise its correct in ib_cache.h.

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2018-08-01  5:33           ` Stephen Rothwell
@ 2018-08-01 17:13             ` Jason Gunthorpe
  2018-08-01 18:30               ` Parav Pandit
  0 siblings, 1 reply; 28+ messages in thread
From: Jason Gunthorpe @ 2018-08-01 17:13 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Parav Pandit, David Miller, Networking, Doug Ledford,
	Linux-Next Mailing List, Linux Kernel Mailing List, Ursula Braun,
	Leon Romanovsky, linux-rdma

On Wed, Aug 01, 2018 at 03:33:45PM +1000, Stephen Rothwell wrote:
> Hi Parav,
> 
> On Tue, 31 Jul 2018 21:12:00 +0000 Parav Pandit <parav@mellanox.com> wrote:
> >
> > You might want to consider this compatibility patch in Linux-rdma
> > tree to avoid a merge conflict of smc.
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=for-next&id=7aaa1807e698f73094b78f0ef25b1a37a4409a55
> 
> Ok, since commit that is now in the rdma tree, my resolution of the
> original conflicts comes down to dropping all the changes to
> net/smc/smc_core.c net/smc/smc_ib.c that come from the rdma tree and
> adding
> 
> #include <rdma/ib_cache.h>
> 
> to net/smc/smc_ib.c.

Oh, that means I put the compat inline in the wrong header? Sigh.

Jason

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2018-07-31 21:12         ` Parav Pandit
@ 2018-08-01  5:33           ` Stephen Rothwell
  2018-08-01 17:13             ` Jason Gunthorpe
  0 siblings, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2018-08-01  5:33 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Gunthorpe, David Miller, Networking, Doug Ledford,
	Linux-Next Mailing List, Linux Kernel Mailing List, Ursula Braun,
	Leon Romanovsky, linux-rdma

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

Hi Parav,

On Tue, 31 Jul 2018 21:12:00 +0000 Parav Pandit <parav@mellanox.com> wrote:
>
> You might want to consider this compatibility patch in Linux-rdma
> tree to avoid a merge conflict of smc.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?h=for-next&id=7aaa1807e698f73094b78f0ef25b1a37a4409a55

Ok, since commit that is now in the rdma tree, my resolution of the
original conflicts comes down to dropping all the changes to
net/smc/smc_core.c net/smc/smc_ib.c that come from the rdma tree and
adding

#include <rdma/ib_cache.h>

to net/smc/smc_ib.c.

-- 
Cheers,
Stephen Rothwell

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

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

* RE: linux-next: manual merge of the net-next tree with the rdma tree
  2018-07-27  5:09       ` Stephen Rothwell
@ 2018-07-31 21:12         ` Parav Pandit
  2018-08-01  5:33           ` Stephen Rothwell
  0 siblings, 1 reply; 28+ messages in thread
From: Parav Pandit @ 2018-07-31 21:12 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Jason Gunthorpe, David Miller, Networking, Doug Ledford,
	Linux-Next Mailing List, Linux Kernel Mailing List, Ursula Braun,
	Leon Romanovsky, linux-rdma

Hi Stephen,

> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org <linux-rdma-owner@vger.kernel.org>
> On Behalf Of Stephen Rothwell
> Sent: Friday, July 27, 2018 12:09 AM
> To: Parav Pandit <parav@mellanox.com>
> Cc: Jason Gunthorpe <jgg@mellanox.com>; David Miller
> <davem@davemloft.net>; Networking <netdev@vger.kernel.org>; Doug
> Ledford <dledford@redhat.com>; Linux-Next Mailing List <linux-
> next@vger.kernel.org>; Linux Kernel Mailing List <linux-
> kernel@vger.kernel.org>; Ursula Braun <ubraun@linux.ibm.com>; Leon
> Romanovsky <leonro@mellanox.com>; linux-rdma@vger.kernel.org
> Subject: Re: linux-next: manual merge of the net-next tree with the rdma tree
> 
> Hi Parav,
> 
> On Fri, 27 Jul 2018 04:57:41 +0000 Parav Pandit <parav@mellanox.com> wrote:
> >
> > >  	for (i = 0; i < smcibdev->pattr[ibport - 1].gid_tbl_len; i++) {
> > > -		memset(&_gid, 0, SMC_GID_SIZE);
> > > -		memset(&gattr, 0, sizeof(gattr));
> > > -		if (ib_query_gid(smcibdev->ibdev, ibport, i, &_gid, &gattr))
> > > +		gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, i);
> > > +		if (IS_ERR(gattr))
> > >  			continue;
> > > -		if (!gattr.ndev)
> > > +		if (!gattr->ndev)
> > >  			continue;
> > This requires a small fix.
> > If (!gattr->ndev {
> > 	rdma_put_gid_attr(gattr);
> > 	continue;
> > }
> 
> Thanks, I have fixed this up for Monday.
You might want to consider this compatibility patch in Linux-rdma tree to avoid a merge conflict of smc.

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

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2018-07-27  4:57     ` Parav Pandit
@ 2018-07-27  5:09       ` Stephen Rothwell
  2018-07-31 21:12         ` Parav Pandit
  0 siblings, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2018-07-27  5:09 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Jason Gunthorpe, David Miller, Networking, Doug Ledford,
	Linux-Next Mailing List, Linux Kernel Mailing List, Ursula Braun,
	Leon Romanovsky, linux-rdma

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

Hi Parav,

On Fri, 27 Jul 2018 04:57:41 +0000 Parav Pandit <parav@mellanox.com> wrote:
>
> >  	for (i = 0; i < smcibdev->pattr[ibport - 1].gid_tbl_len; i++) {
> > -		memset(&_gid, 0, SMC_GID_SIZE);
> > -		memset(&gattr, 0, sizeof(gattr));
> > -		if (ib_query_gid(smcibdev->ibdev, ibport, i, &_gid, &gattr))
> > +		gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, i);
> > +		if (IS_ERR(gattr))
> >  			continue;
> > -		if (!gattr.ndev)
> > +		if (!gattr->ndev)
> >  			continue;  
> This requires a small fix.
> If (!gattr->ndev {
> 	rdma_put_gid_attr(gattr);
> 	continue;
> }

Thanks, I have fixed this up for Monday.
-- 
Cheers,
Stephen Rothwell

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

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

* RE: linux-next: manual merge of the net-next tree with the rdma tree
  2018-07-27  3:45     ` Stephen Rothwell
@ 2018-07-27  5:03       ` Parav Pandit
  0 siblings, 0 replies; 28+ messages in thread
From: Parav Pandit @ 2018-07-27  5:03 UTC (permalink / raw)
  To: Stephen Rothwell, Jason Gunthorpe
  Cc: David Miller, Networking, Doug Ledford, Linux-Next Mailing List,
	Linux Kernel Mailing List, Ursula Braun, Leon Romanovsky,
	linux-rdma



> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org <linux-rdma-owner@vger.kernel.org>
> On Behalf Of Stephen Rothwell
> Sent: Thursday, July 26, 2018 10:45 PM
> To: Jason Gunthorpe <jgg@mellanox.com>
> Cc: David Miller <davem@davemloft.net>; Networking
> <netdev@vger.kernel.org>; Doug Ledford <dledford@redhat.com>; Linux-Next
> Mailing List <linux-next@vger.kernel.org>; Linux Kernel Mailing List <linux-
> kernel@vger.kernel.org>; Parav Pandit <parav@mellanox.com>; Ursula Braun
> <ubraun@linux.ibm.com>; Leon Romanovsky <leonro@mellanox.com>; linux-
> rdma@vger.kernel.org
> Subject: Re: linux-next: manual merge of the net-next tree with the rdma tree
> 
> Hi all,
> 
> On Fri, 27 Jul 2018 13:28:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au>
> wrote:
> >
> > I applied this merge fix patch:
> 
> The final conflict resolution actually looks like this:
> 
> (the rdma tree changes to net/smc/smc_core.c are dropped)
> 
> c1d4bb2af93573ee4a21538a1a97b568a2344499
> diff --cc net/smc/smc_ib.c
> index 74f29f814ec1,2cc64bc8ae20..debc6e44f738
> --- a/net/smc/smc_ib.c
> +++ b/net/smc/smc_ib.c
> @@@ -144,6 -142,93 +143,95 @@@ out
>   	return rc;
>   }
> 
> + static int smc_ib_fill_mac(struct smc_ib_device *smcibdev, u8 ibport)
> + {
>  -	struct ib_gid_attr gattr;
>  -	union ib_gid gid;
>  -	int rc;
> ++	const struct ib_gid_attr *gattr;
> ++	int rc = 0;
> +
>  -	rc = ib_query_gid(smcibdev->ibdev, ibport, 0, &gid, &gattr);
>  -	if (rc || !gattr.ndev)
>  -		return -ENODEV;
> ++	gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, 0);
> ++	if (IS_ERR(gattr))
> ++		return PTR_ERR(gattr);
> ++	if (!gattr->ndev) {
> ++		rc = -ENODEV;
> ++		goto done;
> ++	}
> +
>  -	memcpy(smcibdev->mac[ibport - 1], gattr.ndev->dev_addr, ETH_ALEN);
>  -	dev_put(gattr.ndev);
>  -	return 0;
> ++	memcpy(smcibdev->mac[ibport - 1], gattr->ndev->dev_addr,
> ETH_ALEN);
> ++done:
> ++	rdma_put_gid_attr(gattr);
> ++	return rc;
> + }
> +
> + /* Create an identifier unique for this instance of SMC-R.
> +  * 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; }
> +
> + /* determine the gid for an ib-device port and vlan id */ int
> + smc_ib_determine_gid(struct smc_ib_device *smcibdev, u8 ibport,
> + 			 unsigned short vlan_id, u8 gid[], u8 *sgid_index) {
>  -	struct ib_gid_attr gattr;
>  -	union ib_gid _gid;
> ++	const struct ib_gid_attr *gattr;
> + 	int i;
> +
> + 	for (i = 0; i < smcibdev->pattr[ibport - 1].gid_tbl_len; i++) {
>  -		memset(&_gid, 0, SMC_GID_SIZE);
>  -		memset(&gattr, 0, sizeof(gattr));
>  -		if (ib_query_gid(smcibdev->ibdev, ibport, i, &_gid, &gattr))
> ++		gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, i);
> ++		if (IS_ERR(gattr))
> + 			continue;
>  -		if (!gattr.ndev)
> ++		if (!gattr->ndev)
> + 			continue;
Seeing this updated patch, so for completeness same reply as the previous email.

If (!gattr->ndev) {
	rdma_put_gid_attr(gattr);
	continue;
}
Rest changes above and below looks fine to me.
Thanks for doing it, I am not part of netdev mailing list so didn't see the compile error until this patch came up.

>  -		if (((!vlan_id && !is_vlan_dev(gattr.ndev)) ||
>  -		     (vlan_id && is_vlan_dev(gattr.ndev) &&
>  -		      vlan_dev_vlan_id(gattr.ndev) == vlan_id)) &&
>  -		    gattr.gid_type == IB_GID_TYPE_IB) {
> ++		if (((!vlan_id && !is_vlan_dev(gattr->ndev)) ||
> ++		     (vlan_id && is_vlan_dev(gattr->ndev) &&
> ++		      vlan_dev_vlan_id(gattr->ndev) == vlan_id)) &&
> ++		    gattr->gid_type == IB_GID_TYPE_IB) {
> + 			if (gid)
>  -				memcpy(gid, &_gid, SMC_GID_SIZE);
> ++				memcpy(gid, &gattr->gid, SMC_GID_SIZE);
> + 			if (sgid_index)
> + 				*sgid_index = i;
>  -			dev_put(gattr.ndev);
> ++			rdma_put_gid_attr(gattr);
> + 			return 0;
> + 		}
>  -		dev_put(gattr.ndev);
> ++		rdma_put_gid_attr(gattr);
> + 	}
> + 	return -ENODEV;
> + }
> +
> + 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_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)
>   {
> 
> --
> Cheers,
> Stephen Rothwell

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

* RE: linux-next: manual merge of the net-next tree with the rdma tree
  2018-07-27  3:28   ` Stephen Rothwell
  2018-07-27  3:45     ` Stephen Rothwell
@ 2018-07-27  4:57     ` Parav Pandit
  2018-07-27  5:09       ` Stephen Rothwell
  1 sibling, 1 reply; 28+ messages in thread
From: Parav Pandit @ 2018-07-27  4:57 UTC (permalink / raw)
  To: Stephen Rothwell, Jason Gunthorpe
  Cc: David Miller, Networking, Doug Ledford, Linux-Next Mailing List,
	Linux Kernel Mailing List, Ursula Braun, Leon Romanovsky,
	linux-rdma



> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org <linux-rdma-owner@vger.kernel.org>
> On Behalf Of Stephen Rothwell
> Sent: Thursday, July 26, 2018 10:29 PM
> To: Jason Gunthorpe <jgg@mellanox.com>
> Cc: David Miller <davem@davemloft.net>; Networking
> <netdev@vger.kernel.org>; Doug Ledford <dledford@redhat.com>; Linux-Next
> Mailing List <linux-next@vger.kernel.org>; Linux Kernel Mailing List <linux-
> kernel@vger.kernel.org>; Parav Pandit <parav@mellanox.com>; Ursula Braun
> <ubraun@linux.ibm.com>; Leon Romanovsky <leonro@mellanox.com>; linux-
> rdma@vger.kernel.org
> Subject: Re: linux-next: manual merge of the net-next tree with the rdma tree
> 
> Hi Jason,
> 
> On Thu, 26 Jul 2018 20:48:32 -0600 Jason Gunthorpe <jgg@mellanox.com>
> wrote:
> >
> > On Fri, Jul 27, 2018 at 12:33:01PM +1000, Stephen Rothwell wrote:
> >
> > > I fixed it up (I wasn't sure how to fix this up as so much has
> > > changed in the net-next tree and both modified functions had been
> > > (re)moved, so I effectively reverted the rdma tree commit) and can
> > > carry the fix as necessary.  Please come to some arrangement about this.
> >
> > How does that still compile? We removed ib_query_gid() from the rdma
> > tree and replaced it with rdma_get_gid_attr()..
> 
> Yeah, it doesn't :-(
> 
> > I think the merge resolution is going to be a bit nasty to absorb that
> > much changing..
> >
> > Perhaps we should add a compatability ib_query_gid back to the RDMA
> > tree and then send DaveM a commit to fix SMC and remove it during the
> > next cycle? Linus can resolve smc_ib.c by using the net version
> >
> > Does someone else have a better idea?
> 
> I applied this merge fix patch:
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Fri, 27 Jul 2018 13:19:31 +1000
> Subject: [PATCH] net/smc: fixups for ip_query_gid API removal
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  net/smc/smc_ib.c | 47 +++++++++++++++++++++++++----------------------
>  1 file changed, 25 insertions(+), 22 deletions(-)
> 
> diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c index
> 2cc64bc8ae20..debc6e44f738 100644
> --- a/net/smc/smc_ib.c
> +++ b/net/smc/smc_ib.c
> @@ -16,6 +16,7 @@
>  #include <linux/workqueue.h>
>  #include <linux/scatterlist.h>
>  #include <rdma/ib_verbs.h>
> +#include <rdma/ib_cache.h>
> 
>  #include "smc_pnet.h"
>  #include "smc_ib.h"
> @@ -144,17 +145,21 @@ int smc_ib_ready_link(struct smc_link *lnk)
> 
>  static int smc_ib_fill_mac(struct smc_ib_device *smcibdev, u8 ibport)  {
> -	struct ib_gid_attr gattr;
> -	union ib_gid gid;
> -	int rc;
> +	const struct ib_gid_attr *gattr;
> +	int rc = 0;
> 
> -	rc = ib_query_gid(smcibdev->ibdev, ibport, 0, &gid, &gattr);
> -	if (rc || !gattr.ndev)
> -		return -ENODEV;
> +	gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, 0);
> +	if (IS_ERR(gattr))
> +		return PTR_ERR(gattr);
> +	if (!gattr->ndev) {
> +		rc = -ENODEV;
> +		goto done;
> +	}
> 
> -	memcpy(smcibdev->mac[ibport - 1], gattr.ndev->dev_addr, ETH_ALEN);
> -	dev_put(gattr.ndev);
> -	return 0;
> +	memcpy(smcibdev->mac[ibport - 1], gattr->ndev->dev_addr,
> ETH_ALEN);
> +done:
> +	rdma_put_gid_attr(gattr);
> +	return rc;
>  }
> 
>  /* Create an identifier unique for this instance of SMC-R.
> @@ -179,29 +184,27 @@ bool smc_ib_port_active(struct smc_ib_device
> *smcibdev, u8 ibport)  int smc_ib_determine_gid(struct smc_ib_device
> *smcibdev, u8 ibport,
>  			 unsigned short vlan_id, u8 gid[], u8 *sgid_index)  {
> -	struct ib_gid_attr gattr;
> -	union ib_gid _gid;
> +	const struct ib_gid_attr *gattr;
>  	int i;
> 
>  	for (i = 0; i < smcibdev->pattr[ibport - 1].gid_tbl_len; i++) {
> -		memset(&_gid, 0, SMC_GID_SIZE);
> -		memset(&gattr, 0, sizeof(gattr));
> -		if (ib_query_gid(smcibdev->ibdev, ibport, i, &_gid, &gattr))
> +		gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, i);
> +		if (IS_ERR(gattr))
>  			continue;
> -		if (!gattr.ndev)
> +		if (!gattr->ndev)
>  			continue;
This requires a small fix.
If (!gattr->ndev {
	rdma_put_gid_attr(gattr);
	continue;
}


> -		if (((!vlan_id && !is_vlan_dev(gattr.ndev)) ||
> -		     (vlan_id && is_vlan_dev(gattr.ndev) &&
> -		      vlan_dev_vlan_id(gattr.ndev) == vlan_id)) &&
> -		    gattr.gid_type == IB_GID_TYPE_IB) {
> +		if (((!vlan_id && !is_vlan_dev(gattr->ndev)) ||
> +		     (vlan_id && is_vlan_dev(gattr->ndev) &&
> +		      vlan_dev_vlan_id(gattr->ndev) == vlan_id)) &&
> +		    gattr->gid_type == IB_GID_TYPE_IB) {
>  			if (gid)
> -				memcpy(gid, &_gid, SMC_GID_SIZE);
> +				memcpy(gid, &gattr->gid, SMC_GID_SIZE);
>  			if (sgid_index)
>  				*sgid_index = i;
> -			dev_put(gattr.ndev);
> +			rdma_put_gid_attr(gattr);
>  			return 0;
>  		}
> -		dev_put(gattr.ndev);
> +		rdma_put_gid_attr(gattr);
>  	}
>  	return -ENODEV;
>  }
> --
> 2.18.0
> 
> --
> Cheers,
> Stephen Rothwell

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  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
  1 sibling, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2018-07-27  3:45 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: David Miller, Networking, Doug Ledford, Linux-Next Mailing List,
	Linux Kernel Mailing List, Parav Pandit, Ursula Braun,
	Leon Romanovsky, linux-rdma

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

Hi all,

On Fri, 27 Jul 2018 13:28:47 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> I applied this merge fix patch:

The final conflict resolution actually looks like this:

(the rdma tree changes to net/smc/smc_core.c are dropped)

c1d4bb2af93573ee4a21538a1a97b568a2344499
diff --cc net/smc/smc_ib.c
index 74f29f814ec1,2cc64bc8ae20..debc6e44f738
--- a/net/smc/smc_ib.c
+++ b/net/smc/smc_ib.c
@@@ -144,6 -142,93 +143,95 @@@ out
  	return rc;
  }
  
+ static int smc_ib_fill_mac(struct smc_ib_device *smcibdev, u8 ibport)
+ {
 -	struct ib_gid_attr gattr;
 -	union ib_gid gid;
 -	int rc;
++	const struct ib_gid_attr *gattr;
++	int rc = 0;
+ 
 -	rc = ib_query_gid(smcibdev->ibdev, ibport, 0, &gid, &gattr);
 -	if (rc || !gattr.ndev)
 -		return -ENODEV;
++	gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, 0);
++	if (IS_ERR(gattr))
++		return PTR_ERR(gattr);
++	if (!gattr->ndev) {
++		rc = -ENODEV;
++		goto done;
++	}
+ 
 -	memcpy(smcibdev->mac[ibport - 1], gattr.ndev->dev_addr, ETH_ALEN);
 -	dev_put(gattr.ndev);
 -	return 0;
++	memcpy(smcibdev->mac[ibport - 1], gattr->ndev->dev_addr, ETH_ALEN);
++done:
++	rdma_put_gid_attr(gattr);
++	return rc;
+ }
+ 
+ /* Create an identifier unique for this instance of SMC-R.
+  * 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;
+ }
+ 
+ /* determine the gid for an ib-device port and vlan id */
+ int smc_ib_determine_gid(struct smc_ib_device *smcibdev, u8 ibport,
+ 			 unsigned short vlan_id, u8 gid[], u8 *sgid_index)
+ {
 -	struct ib_gid_attr gattr;
 -	union ib_gid _gid;
++	const struct ib_gid_attr *gattr;
+ 	int i;
+ 
+ 	for (i = 0; i < smcibdev->pattr[ibport - 1].gid_tbl_len; i++) {
 -		memset(&_gid, 0, SMC_GID_SIZE);
 -		memset(&gattr, 0, sizeof(gattr));
 -		if (ib_query_gid(smcibdev->ibdev, ibport, i, &_gid, &gattr))
++		gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, i);
++		if (IS_ERR(gattr))
+ 			continue;
 -		if (!gattr.ndev)
++		if (!gattr->ndev)
+ 			continue;
 -		if (((!vlan_id && !is_vlan_dev(gattr.ndev)) ||
 -		     (vlan_id && is_vlan_dev(gattr.ndev) &&
 -		      vlan_dev_vlan_id(gattr.ndev) == vlan_id)) &&
 -		    gattr.gid_type == IB_GID_TYPE_IB) {
++		if (((!vlan_id && !is_vlan_dev(gattr->ndev)) ||
++		     (vlan_id && is_vlan_dev(gattr->ndev) &&
++		      vlan_dev_vlan_id(gattr->ndev) == vlan_id)) &&
++		    gattr->gid_type == IB_GID_TYPE_IB) {
+ 			if (gid)
 -				memcpy(gid, &_gid, SMC_GID_SIZE);
++				memcpy(gid, &gattr->gid, SMC_GID_SIZE);
+ 			if (sgid_index)
+ 				*sgid_index = i;
 -			dev_put(gattr.ndev);
++			rdma_put_gid_attr(gattr);
+ 			return 0;
+ 		}
 -		dev_put(gattr.ndev);
++		rdma_put_gid_attr(gattr);
+ 	}
+ 	return -ENODEV;
+ }
+ 
+ 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_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)
  {

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2018-07-27  2:48 ` Jason Gunthorpe
@ 2018-07-27  3:28   ` Stephen Rothwell
  2018-07-27  3:45     ` Stephen Rothwell
  2018-07-27  4:57     ` Parav Pandit
  0 siblings, 2 replies; 28+ messages in thread
From: Stephen Rothwell @ 2018-07-27  3:28 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: David Miller, Networking, Doug Ledford, Linux-Next Mailing List,
	Linux Kernel Mailing List, Parav Pandit, Ursula Braun,
	Leon Romanovsky, linux-rdma

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

Hi Jason,

On Thu, 26 Jul 2018 20:48:32 -0600 Jason Gunthorpe <jgg@mellanox.com> wrote:
>
> On Fri, Jul 27, 2018 at 12:33:01PM +1000, Stephen Rothwell wrote:
> 
> > I fixed it up (I wasn't sure how to fix this up as so much has changed
> > in the net-next tree and both modified functions had been (re)moved,
> > so I effectively reverted the rdma tree commit) and can carry the fix
> > as necessary.  Please come to some arrangement about this.  
> 
> How does that still compile? We removed ib_query_gid() from the rdma
> tree and replaced it with rdma_get_gid_attr()..

Yeah, it doesn't :-(

> I think the merge resolution is going to be a bit nasty to absorb
> that much changing..
> 
> Perhaps we should add a compatability ib_query_gid back to the RDMA
> tree and then send DaveM a commit to fix SMC and remove it during the
> next cycle? Linus can resolve smc_ib.c by using the net version
> 
> Does someone else have a better idea?

I applied this merge fix patch:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 27 Jul 2018 13:19:31 +1000
Subject: [PATCH] net/smc: fixups for ip_query_gid API removal

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 net/smc/smc_ib.c | 47 +++++++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c
index 2cc64bc8ae20..debc6e44f738 100644
--- a/net/smc/smc_ib.c
+++ b/net/smc/smc_ib.c
@@ -16,6 +16,7 @@
 #include <linux/workqueue.h>
 #include <linux/scatterlist.h>
 #include <rdma/ib_verbs.h>
+#include <rdma/ib_cache.h>
 
 #include "smc_pnet.h"
 #include "smc_ib.h"
@@ -144,17 +145,21 @@ int smc_ib_ready_link(struct smc_link *lnk)
 
 static int smc_ib_fill_mac(struct smc_ib_device *smcibdev, u8 ibport)
 {
-	struct ib_gid_attr gattr;
-	union ib_gid gid;
-	int rc;
+	const struct ib_gid_attr *gattr;
+	int rc = 0;
 
-	rc = ib_query_gid(smcibdev->ibdev, ibport, 0, &gid, &gattr);
-	if (rc || !gattr.ndev)
-		return -ENODEV;
+	gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, 0);
+	if (IS_ERR(gattr))
+		return PTR_ERR(gattr);
+	if (!gattr->ndev) {
+		rc = -ENODEV;
+		goto done;
+	}
 
-	memcpy(smcibdev->mac[ibport - 1], gattr.ndev->dev_addr, ETH_ALEN);
-	dev_put(gattr.ndev);
-	return 0;
+	memcpy(smcibdev->mac[ibport - 1], gattr->ndev->dev_addr, ETH_ALEN);
+done:
+	rdma_put_gid_attr(gattr);
+	return rc;
 }
 
 /* Create an identifier unique for this instance of SMC-R.
@@ -179,29 +184,27 @@ bool smc_ib_port_active(struct smc_ib_device *smcibdev, u8 ibport)
 int smc_ib_determine_gid(struct smc_ib_device *smcibdev, u8 ibport,
 			 unsigned short vlan_id, u8 gid[], u8 *sgid_index)
 {
-	struct ib_gid_attr gattr;
-	union ib_gid _gid;
+	const struct ib_gid_attr *gattr;
 	int i;
 
 	for (i = 0; i < smcibdev->pattr[ibport - 1].gid_tbl_len; i++) {
-		memset(&_gid, 0, SMC_GID_SIZE);
-		memset(&gattr, 0, sizeof(gattr));
-		if (ib_query_gid(smcibdev->ibdev, ibport, i, &_gid, &gattr))
+		gattr = rdma_get_gid_attr(smcibdev->ibdev, ibport, i);
+		if (IS_ERR(gattr))
 			continue;
-		if (!gattr.ndev)
+		if (!gattr->ndev)
 			continue;
-		if (((!vlan_id && !is_vlan_dev(gattr.ndev)) ||
-		     (vlan_id && is_vlan_dev(gattr.ndev) &&
-		      vlan_dev_vlan_id(gattr.ndev) == vlan_id)) &&
-		    gattr.gid_type == IB_GID_TYPE_IB) {
+		if (((!vlan_id && !is_vlan_dev(gattr->ndev)) ||
+		     (vlan_id && is_vlan_dev(gattr->ndev) &&
+		      vlan_dev_vlan_id(gattr->ndev) == vlan_id)) &&
+		    gattr->gid_type == IB_GID_TYPE_IB) {
 			if (gid)
-				memcpy(gid, &_gid, SMC_GID_SIZE);
+				memcpy(gid, &gattr->gid, SMC_GID_SIZE);
 			if (sgid_index)
 				*sgid_index = i;
-			dev_put(gattr.ndev);
+			rdma_put_gid_attr(gattr);
 			return 0;
 		}
-		dev_put(gattr.ndev);
+		rdma_put_gid_attr(gattr);
 	}
 	return -ENODEV;
 }
-- 
2.18.0

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: manual merge of the net-next tree with the rdma tree
  2018-07-27  2:33 Stephen Rothwell
@ 2018-07-27  2:48 ` Jason Gunthorpe
  2018-07-27  3:28   ` Stephen Rothwell
  0 siblings, 1 reply; 28+ messages in thread
From: Jason Gunthorpe @ 2018-07-27  2:48 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: David Miller, Networking, Doug Ledford, Linux-Next Mailing List,
	Linux Kernel Mailing List, Parav Pandit, Ursula Braun,
	Leon Romanovsky, linux-rdma

On Fri, Jul 27, 2018 at 12:33:01PM +1000, Stephen Rothwell wrote:

> I fixed it up (I wasn't sure how to fix this up as so much has changed
> in the net-next tree and both modified functions had been (re)moved,
> so I effectively reverted the rdma tree commit) and can carry the fix
> as necessary.  Please come to some arrangement about this.

How does that still compile? We removed ib_query_gid() from the rdma
tree and replaced it with rdma_get_gid_attr()..

I think the merge resolution is going to be a bit nasty to absorb
that much changing..

Perhaps we should add a compatability ib_query_gid back to the RDMA
tree and then send DaveM a commit to fix SMC and remove it during the
next cycle? Linus can resolve smc_ib.c by using the net version

Does someone else have a better idea?

Thanks,
Jason

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

* linux-next: manual merge of the net-next tree with the rdma tree
@ 2018-07-27  2:33 Stephen Rothwell
  2018-07-27  2:48 ` Jason Gunthorpe
  0 siblings, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2018-07-27  2:33 UTC (permalink / raw)
  To: David Miller, Networking, Doug Ledford, Jason Gunthorpe
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Parav Pandit,
	Ursula Braun, Leon Romanovsky

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

Hi all,

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

  net/smc/smc_core.c
  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:

  7005ada68d17 ("net/smc: use correct vlan gid of RoCE device")
(and maybe others)

from the net-next tree.

I fixed it up (I wasn't sure how to fix this up as so much has changed
in the net-next tree and both modified functions had been (re)moved,
so I effectively reverted the rdma tree commit) and can carry the fix
as necessary.  Please come to some arrangement about this.

-- 
Cheers,
Stephen Rothwell

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

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

* linux-next: manual merge of the net-next tree with the rdma tree
@ 2018-07-02  0:21 Stephen Rothwell
  2018-08-15 23:41 ` Stephen Rothwell
  0 siblings, 1 reply; 28+ messages in thread
From: Stephen Rothwell @ 2018-07-02  0:21 UTC (permalink / raw)
  To: David Miller, Networking, Doug Ledford, Jason Gunthorpe
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Parav Pandit

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

Hi all,

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)
  {

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

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

end of thread, other threads:[~2021-10-28  7:48 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  3:18 linux-next: manual merge of the net-next tree with the rdma tree Stephen Rothwell
2020-05-08 12:35 ` Jason Gunthorpe
2020-05-09  7:49   ` Saeed Mahameed
2020-05-09  7:40 ` Saeed Mahameed
  -- strict thread matches above, loose matches on Subject: below --
2021-10-28  0:56 Stephen Rothwell
2021-10-28  7:48 ` Saeed Mahameed
2021-10-19 23:34 Stephen Rothwell
2019-06-20  2:15 Stephen Rothwell
2019-02-27  0:25 Stephen Rothwell
2019-02-27 16:24 ` Doug Ledford
2019-02-28  9:05   ` Leon Romanovsky
2019-02-18  0:05 Stephen Rothwell
2019-02-18 10:48 ` Leon Romanovsky
2018-08-02  2:05 Stephen Rothwell
2018-08-15 23:45 ` Stephen Rothwell
2018-07-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-07-02  0:21 Stephen Rothwell
2018-08-15 23:41 ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).