|
@@ -103,6 +103,68 @@ void mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev, u8 *addr)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(mlx5_query_nic_vport_mac_address);
|
|
EXPORT_SYMBOL(mlx5_query_nic_vport_mac_address);
|
|
|
|
|
|
|
|
+int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev,
|
|
|
|
+ u64 *system_image_guid)
|
|
|
|
+{
|
|
|
|
+ u32 *out;
|
|
|
|
+ int outlen = MLX5_ST_SZ_BYTES(query_nic_vport_context_out);
|
|
|
|
+
|
|
|
|
+ out = mlx5_vzalloc(outlen);
|
|
|
|
+ if (!out)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+
|
|
|
|
+ mlx5_query_nic_vport_context(mdev, out, outlen);
|
|
|
|
+
|
|
|
|
+ *system_image_guid = MLX5_GET64(query_nic_vport_context_out, out,
|
|
|
|
+ nic_vport_context.system_image_guid);
|
|
|
|
+
|
|
|
|
+ kfree(out);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_system_image_guid);
|
|
|
|
+
|
|
|
|
+int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid)
|
|
|
|
+{
|
|
|
|
+ u32 *out;
|
|
|
|
+ int outlen = MLX5_ST_SZ_BYTES(query_nic_vport_context_out);
|
|
|
|
+
|
|
|
|
+ out = mlx5_vzalloc(outlen);
|
|
|
|
+ if (!out)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+
|
|
|
|
+ mlx5_query_nic_vport_context(mdev, out, outlen);
|
|
|
|
+
|
|
|
|
+ *node_guid = MLX5_GET64(query_nic_vport_context_out, out,
|
|
|
|
+ nic_vport_context.node_guid);
|
|
|
|
+
|
|
|
|
+ kfree(out);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_node_guid);
|
|
|
|
+
|
|
|
|
+int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev,
|
|
|
|
+ u16 *qkey_viol_cntr)
|
|
|
|
+{
|
|
|
|
+ u32 *out;
|
|
|
|
+ int outlen = MLX5_ST_SZ_BYTES(query_nic_vport_context_out);
|
|
|
|
+
|
|
|
|
+ out = mlx5_vzalloc(outlen);
|
|
|
|
+ if (!out)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+
|
|
|
|
+ mlx5_query_nic_vport_context(mdev, out, outlen);
|
|
|
|
+
|
|
|
|
+ *qkey_viol_cntr = MLX5_GET(query_nic_vport_context_out, out,
|
|
|
|
+ nic_vport_context.qkey_violation_counter);
|
|
|
|
+
|
|
|
|
+ kfree(out);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_qkey_viol_cntr);
|
|
|
|
+
|
|
int mlx5_query_hca_vport_gid(struct mlx5_core_dev *dev, u8 other_vport,
|
|
int mlx5_query_hca_vport_gid(struct mlx5_core_dev *dev, u8 other_vport,
|
|
u8 port_num, u16 vf_num, u16 gid_index,
|
|
u8 port_num, u16 vf_num, u16 gid_index,
|
|
union ib_gid *gid)
|
|
union ib_gid *gid)
|