diff options
author | Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> | 2018-09-19 20:42:55 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2018-10-03 10:42:29 -0400 |
commit | ddf30f7ff840d4467ef45ec0b443575f9e95bec6 (patch) | |
tree | c9059b346847f2818907c2857ea2db3860e51419 /drivers/net/ethernet/intel/ice/ice_lib.c | |
parent | 75d2b253026b8b1cb625f6ccdb9d54cdecae7935 (diff) |
ice: Add handler to configure SR-IOV
This patch implements parts of ice_sriov_configure and VF reset flow.
To create virtual functions (VFs), the user sets a value in num_vfs
through sysfs. This results in the kernel calling the handler for
.sriov_configure which is ice_sriov_configure.
VF setup first starts with a VF reset, followed by allocation of the VF
VSI using ice_vf_vsi_setup. Once the VF setup is complete a state bit
ICE_VF_STATE_INIT is set in the vf->states bitmap to indicate that
the VF is ready to go.
Also for VF reset to go into effect, it's necessary to issue a disable
queue command (ice_aqc_opc_dis_txqs). So this patch updates multiple
functions in the disable queue flow to take additional parameters that
distinguish if queues are being disabled due to VF reset.
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_lib.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_lib.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index acf3478a3f3b..4b26705a9ab5 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c | |||
@@ -1784,8 +1784,11 @@ int ice_vsi_stop_rx_rings(struct ice_vsi *vsi) | |||
1784 | /** | 1784 | /** |
1785 | * ice_vsi_stop_tx_rings - Disable Tx rings | 1785 | * ice_vsi_stop_tx_rings - Disable Tx rings |
1786 | * @vsi: the VSI being configured | 1786 | * @vsi: the VSI being configured |
1787 | * @rst_src: reset source | ||
1788 | * @rel_vmvf_num: Relative id of VF/VM | ||
1787 | */ | 1789 | */ |
1788 | int ice_vsi_stop_tx_rings(struct ice_vsi *vsi) | 1790 | int ice_vsi_stop_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, |
1791 | u16 rel_vmvf_num) | ||
1789 | { | 1792 | { |
1790 | struct ice_pf *pf = vsi->back; | 1793 | struct ice_pf *pf = vsi->back; |
1791 | struct ice_hw *hw = &pf->hw; | 1794 | struct ice_hw *hw = &pf->hw; |
@@ -1837,7 +1840,7 @@ int ice_vsi_stop_tx_rings(struct ice_vsi *vsi) | |||
1837 | GLINT_DYN_CTL_SWINT_TRIG_M | GLINT_DYN_CTL_INTENA_MSK_M); | 1840 | GLINT_DYN_CTL_SWINT_TRIG_M | GLINT_DYN_CTL_INTENA_MSK_M); |
1838 | } | 1841 | } |
1839 | status = ice_dis_vsi_txq(vsi->port_info, vsi->num_txq, q_ids, q_teids, | 1842 | status = ice_dis_vsi_txq(vsi->port_info, vsi->num_txq, q_ids, q_teids, |
1840 | NULL); | 1843 | rst_src, rel_vmvf_num, NULL); |
1841 | /* if the disable queue command was exercised during an active reset | 1844 | /* if the disable queue command was exercised during an active reset |
1842 | * flow, ICE_ERR_RESET_ONGOING is returned. This is not an error as | 1845 | * flow, ICE_ERR_RESET_ONGOING is returned. This is not an error as |
1843 | * the reset operation disables queues at the hardware level anyway. | 1846 | * the reset operation disables queues at the hardware level anyway. |