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>
This commit is contained in:

zatwierdzone przez
Roland Dreier

rodzic
026149cbaa
commit
afa8fd1db9
@@ -35,6 +35,7 @@
|
||||
#include <rdma/ib_sa.h>
|
||||
#include <rdma/ib_cache.h>
|
||||
|
||||
#include <linux/random.h>
|
||||
#include <linux/mlx4/cmd.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <rdma/ib_pma.h>
|
||||
@@ -89,6 +90,12 @@ static void handle_lid_change_event(struct mlx4_ib_dev *dev, u8 port_num);
|
||||
static void __propagate_pkey_ev(struct mlx4_ib_dev *dev, int port_num,
|
||||
int block, u32 change_bitmap);
|
||||
|
||||
__be64 mlx4_ib_gen_node_guid(void)
|
||||
{
|
||||
#define NODE_GUID_HI ((u64) (((u64)IB_OPENIB_OUI) << 40))
|
||||
return cpu_to_be64(NODE_GUID_HI | random32());
|
||||
}
|
||||
|
||||
__be64 mlx4_ib_get_new_demux_tid(struct mlx4_ib_demux_ctx *ctx)
|
||||
{
|
||||
return cpu_to_be64(atomic_inc_return(&ctx->tid)) |
|
||||
@@ -1962,6 +1969,13 @@ int mlx4_ib_init_sriov(struct mlx4_ib_dev *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < dev->dev->caps.sqp_demux; i++) {
|
||||
if (i == mlx4_master_func_num(dev->dev))
|
||||
mlx4_put_slave_node_guid(dev->dev, i, dev->ib_dev.node_guid);
|
||||
else
|
||||
mlx4_put_slave_node_guid(dev->dev, i, mlx4_ib_gen_node_guid());
|
||||
}
|
||||
|
||||
err = mlx4_ib_init_alias_guid_service(dev);
|
||||
if (err) {
|
||||
mlx4_ib_warn(&dev->ib_dev, "Failed init alias guid process.\n");
|
||||
|
Reference in New Issue
Block a user