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
@ 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
@ 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
@ 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
* 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
* 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
* 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
* 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
* 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 --
2018-07-27  2:33 linux-next: manual merge of the net-next tree with the rdma tree Stephen Rothwell
2018-07-27  2:48 ` Jason Gunthorpe
2018-07-27  3:28   ` Stephen Rothwell
2018-07-27  3:45     ` Stephen Rothwell
2018-07-27  5:03       ` Parav Pandit
2018-07-27  4:57     ` Parav Pandit
2018-07-27  5:09       ` Stephen Rothwell
2018-07-31 21:12         ` Parav Pandit
2018-08-01  5:33           ` Stephen Rothwell
2018-08-01 17:13             ` Jason Gunthorpe
2018-08-01 18:30               ` Parav Pandit
  -- strict thread matches above, loose matches on Subject: below --
2021-10-28  0:56 Stephen Rothwell
2021-10-28  7:48 ` Saeed Mahameed
2021-10-19 23:34 Stephen Rothwell
2020-05-08  3:18 Stephen Rothwell
2020-05-08 12:35 ` Jason Gunthorpe
2020-05-09  7:49   ` Saeed Mahameed
2020-05-09  7:40 ` Saeed Mahameed
2019-06-20  2:15 Stephen Rothwell
2019-02-27  0:25 Stephen Rothwell
2019-02-27 16:24 ` Doug Ledford
2019-02-28  9:05   ` Leon Romanovsky
2019-02-18  0:05 Stephen Rothwell
2019-02-18 10:48 ` Leon Romanovsky
2018-08-02  2:05 Stephen Rothwell
2018-08-15 23:45 ` Stephen Rothwell
2018-07-02  0:21 Stephen Rothwell
2018-08-15 23:41 ` Stephen Rothwell

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