diff options
author | Eli Cohen <eli@mellanox.com> | 2016-03-11 15:58:42 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-03-21 17:13:14 -0400 |
commit | eff901d30e6cebd940072637f112ce4d0090ac12 (patch) | |
tree | a2105d1050701146ce1c7364721fb1bc35834b53 /drivers/infiniband/hw/mlx5/main.c | |
parent | 1f324bff9ba3db276f074169d5b4af9e9c117ba1 (diff) |
IB/mlx5: Implement callbacks for manipulating VFs
Implement the IB defined callbacks used to manipulate the policy for the
link state, set GUIDs or get statistics information. This functionality
is added into a new file that will be used to add any SRIOV related
functionality to the mlx5 IB layer.
The following callbacks have been added:
mlx5_ib_get_vf_config
mlx5_ib_set_vf_link_state
mlx5_ib_get_vf_stats
mlx5_ib_set_vf_guid
In addition, publish whether this device is based on a virtual function.
In mlx5 supported devices, virtual functions are implemented as vHCAs.
vHCAs have their own QP number space so it is possible that two vHCAs
will use a QP with the same number at the same time.
Signed-off-by: Eli Cohen <eli@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/main.c')
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 73cb6337d856..e305990b73f6 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
@@ -562,6 +562,9 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, | |||
562 | if (MLX5_CAP_GEN(mdev, cd)) | 562 | if (MLX5_CAP_GEN(mdev, cd)) |
563 | props->device_cap_flags |= IB_DEVICE_CROSS_CHANNEL; | 563 | props->device_cap_flags |= IB_DEVICE_CROSS_CHANNEL; |
564 | 564 | ||
565 | if (!mlx5_core_is_pf(mdev)) | ||
566 | props->device_cap_flags |= IB_DEVICE_VIRTUAL_FUNCTION; | ||
567 | |||
565 | return 0; | 568 | return 0; |
566 | } | 569 | } |
567 | 570 | ||
@@ -699,6 +702,7 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port, | |||
699 | props->qkey_viol_cntr = rep->qkey_violation_counter; | 702 | props->qkey_viol_cntr = rep->qkey_violation_counter; |
700 | props->subnet_timeout = rep->subnet_timeout; | 703 | props->subnet_timeout = rep->subnet_timeout; |
701 | props->init_type_reply = rep->init_type_reply; | 704 | props->init_type_reply = rep->init_type_reply; |
705 | props->grh_required = rep->grh_required; | ||
702 | 706 | ||
703 | err = mlx5_query_port_link_width_oper(mdev, &ib_link_width_oper, port); | 707 | err = mlx5_query_port_link_width_oper(mdev, &ib_link_width_oper, port); |
704 | if (err) | 708 | if (err) |
@@ -2349,6 +2353,12 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) | |||
2349 | dev->ib_dev.map_mr_sg = mlx5_ib_map_mr_sg; | 2353 | dev->ib_dev.map_mr_sg = mlx5_ib_map_mr_sg; |
2350 | dev->ib_dev.check_mr_status = mlx5_ib_check_mr_status; | 2354 | dev->ib_dev.check_mr_status = mlx5_ib_check_mr_status; |
2351 | dev->ib_dev.get_port_immutable = mlx5_port_immutable; | 2355 | dev->ib_dev.get_port_immutable = mlx5_port_immutable; |
2356 | if (mlx5_core_is_pf(mdev)) { | ||
2357 | dev->ib_dev.get_vf_config = mlx5_ib_get_vf_config; | ||
2358 | dev->ib_dev.set_vf_link_state = mlx5_ib_set_vf_link_state; | ||
2359 | dev->ib_dev.get_vf_stats = mlx5_ib_get_vf_stats; | ||
2360 | dev->ib_dev.set_vf_guid = mlx5_ib_set_vf_guid; | ||
2361 | } | ||
2352 | 2362 | ||
2353 | mlx5_ib_internal_fill_odp_caps(dev); | 2363 | mlx5_ib_internal_fill_odp_caps(dev); |
2354 | 2364 | ||