Lines Matching refs:vf

40 static int sriov_restore_guids(struct mlx5_core_dev *dev, int vf, u16 func_id)  in sriov_restore_guids()  argument
47 if (sriov->vfs_ctx[vf].node_guid || in sriov_restore_guids()
48 sriov->vfs_ctx[vf].port_guid || in sriov_restore_guids()
49 sriov->vfs_ctx[vf].policy != MLX5_POLICY_INVALID) { in sriov_restore_guids()
54 in->node_guid = sriov->vfs_ctx[vf].node_guid; in sriov_restore_guids()
55 in->port_guid = sriov->vfs_ctx[vf].port_guid; in sriov_restore_guids()
56 in->policy = sriov->vfs_ctx[vf].policy; in sriov_restore_guids()
64 mlx5_core_warn(dev, "modify vport context failed, unable to restore VF %d settings\n", vf); in sriov_restore_guids()
75 int err, vf, num_msix_count; in mlx5_device_enable_sriov() local
86 for (vf = 0; vf < num_vfs; vf++) { in mlx5_device_enable_sriov()
90 blocking_notifier_call_chain(&sriov->vfs_ctx[vf].notifier, in mlx5_device_enable_sriov()
92 err = mlx5_core_enable_hca(dev, vf + 1); in mlx5_device_enable_sriov()
94 mlx5_core_warn(dev, "failed to enable VF %d (%d)\n", vf, err); in mlx5_device_enable_sriov()
98 err = mlx5_set_msix_vec_count(dev, vf + 1, num_msix_count); in mlx5_device_enable_sriov()
102 vf, err); in mlx5_device_enable_sriov()
106 sriov->vfs_ctx[vf].enabled = 1; in mlx5_device_enable_sriov()
109 mlx5_core_ec_vf_vport_base(dev) + vf in mlx5_device_enable_sriov()
110 : vf + 1; in mlx5_device_enable_sriov()
111 err = sriov_restore_guids(dev, vf, vport_num); in mlx5_device_enable_sriov()
115 vf, err); in mlx5_device_enable_sriov()
119 mlx5_core_dbg(dev, "successfully enabled VF* %d\n", vf); in mlx5_device_enable_sriov()
132 int vf; in mlx5_device_disable_sriov() local
134 for (vf = num_vfs - 1; vf >= 0; vf--) { in mlx5_device_disable_sriov()
135 if (!sriov->vfs_ctx[vf].enabled) in mlx5_device_disable_sriov()
140 blocking_notifier_call_chain(&sriov->vfs_ctx[vf].notifier, in mlx5_device_disable_sriov()
142 err = mlx5_core_disable_hca(dev, vf + 1); in mlx5_device_disable_sriov()
144 mlx5_core_warn(dev, "failed to disable VF %d\n", vf); in mlx5_device_disable_sriov()
147 sriov->vfs_ctx[vf].enabled = 0; in mlx5_device_disable_sriov()
231 int mlx5_core_sriov_set_msix_vec_count(struct pci_dev *vf, int msix_vec_count) in mlx5_core_sriov_set_msix_vec_count() argument
233 struct pci_dev *pf = pci_physfn(vf); in mlx5_core_sriov_set_msix_vec_count()
248 id = pci_iov_vf_id(vf); in mlx5_core_sriov_set_msix_vec_count()