diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2012-08-03 08:40:56 +0000 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-09-30 20:33:43 -0700 |
commit | afa8fd1db9f295a0c4130bc6d87bf8b05bdd0523 (patch) | |
tree | 725c4a2c6a9044ff9ac79e4f6a863393756953f0 /drivers/net/ethernet/mellanox/mlx4/main.c | |
parent | 026149cbaada391d98f1cbec47c488cb548f753a (diff) | |
download | blackbird-obmc-linux-afa8fd1db9f295a0c4130bc6d87bf8b05bdd0523.tar.gz blackbird-obmc-linux-afa8fd1db9f295a0c4130bc6d87bf8b05bdd0523.zip |
mlx4: Paravirtualize Node Guids for slaves
This is necessary in order to support > 1 VF/PF in a VM for software
that uses the node guid as a discriminator, such as librdmacm.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/main.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 2294b7173180..76f69fdd01d5 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -435,6 +435,28 @@ void mlx4_sync_pkey_table(struct mlx4_dev *dev, int slave, int port, int i, int } EXPORT_SYMBOL(mlx4_sync_pkey_table); +void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid) +{ + struct mlx4_priv *priv = container_of(dev, struct mlx4_priv, dev); + + if (!mlx4_is_master(dev)) + return; + + priv->slave_node_guids[slave] = guid; +} +EXPORT_SYMBOL(mlx4_put_slave_node_guid); + +__be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave) +{ + struct mlx4_priv *priv = container_of(dev, struct mlx4_priv, dev); + + if (!mlx4_is_master(dev)) + return 0; + + return priv->slave_node_guids[slave]; +} +EXPORT_SYMBOL(mlx4_get_slave_node_guid); + int mlx4_is_slave_active(struct mlx4_dev *dev, int slave) { struct mlx4_priv *priv = mlx4_priv(dev); |