Commit b27f0c78 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue

Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2020-12-17

Sylwester fixes an issue where PF was not properly being rebuilt
following VF removal for i40e.

Jakub Kicinski fixes a double release of rtnl_lock on
iavf_lan_add_device() error for iavf.

* '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
  iavf: fix double-release of rtnl_lock
  i40e: Fix Error I40E_AQ_RC_EINVAL when removing VFs
====================

Link: https://lore.kernel.org/r/20201217223418.3134992-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents abdcd06c f1340265
...@@ -120,6 +120,7 @@ enum i40e_state_t { ...@@ -120,6 +120,7 @@ enum i40e_state_t {
__I40E_RESET_INTR_RECEIVED, __I40E_RESET_INTR_RECEIVED,
__I40E_REINIT_REQUESTED, __I40E_REINIT_REQUESTED,
__I40E_PF_RESET_REQUESTED, __I40E_PF_RESET_REQUESTED,
__I40E_PF_RESET_AND_REBUILD_REQUESTED,
__I40E_CORE_RESET_REQUESTED, __I40E_CORE_RESET_REQUESTED,
__I40E_GLOBAL_RESET_REQUESTED, __I40E_GLOBAL_RESET_REQUESTED,
__I40E_EMP_RESET_INTR_RECEIVED, __I40E_EMP_RESET_INTR_RECEIVED,
...@@ -146,6 +147,8 @@ enum i40e_state_t { ...@@ -146,6 +147,8 @@ enum i40e_state_t {
}; };
#define I40E_PF_RESET_FLAG BIT_ULL(__I40E_PF_RESET_REQUESTED) #define I40E_PF_RESET_FLAG BIT_ULL(__I40E_PF_RESET_REQUESTED)
#define I40E_PF_RESET_AND_REBUILD_FLAG \
BIT_ULL(__I40E_PF_RESET_AND_REBUILD_REQUESTED)
/* VSI state flags */ /* VSI state flags */
enum i40e_vsi_state_t { enum i40e_vsi_state_t {
......
...@@ -36,6 +36,8 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf); ...@@ -36,6 +36,8 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf);
static void i40e_determine_queue_usage(struct i40e_pf *pf); static void i40e_determine_queue_usage(struct i40e_pf *pf);
static int i40e_setup_pf_filter_control(struct i40e_pf *pf); static int i40e_setup_pf_filter_control(struct i40e_pf *pf);
static void i40e_prep_for_reset(struct i40e_pf *pf, bool lock_acquired); static void i40e_prep_for_reset(struct i40e_pf *pf, bool lock_acquired);
static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit,
bool lock_acquired);
static int i40e_reset(struct i40e_pf *pf); static int i40e_reset(struct i40e_pf *pf);
static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired); static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired);
static int i40e_setup_misc_vector_for_recovery_mode(struct i40e_pf *pf); static int i40e_setup_misc_vector_for_recovery_mode(struct i40e_pf *pf);
...@@ -8536,6 +8538,14 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired) ...@@ -8536,6 +8538,14 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired)
"FW LLDP is disabled\n" : "FW LLDP is disabled\n" :
"FW LLDP is enabled\n"); "FW LLDP is enabled\n");
} else if (reset_flags & I40E_PF_RESET_AND_REBUILD_FLAG) {
/* Request a PF Reset
*
* Resets PF and reinitializes PFs VSI.
*/
i40e_prep_for_reset(pf, lock_acquired);
i40e_reset_and_rebuild(pf, true, lock_acquired);
} else if (reset_flags & BIT_ULL(__I40E_REINIT_REQUESTED)) { } else if (reset_flags & BIT_ULL(__I40E_REINIT_REQUESTED)) {
int v; int v;
......
...@@ -1772,7 +1772,7 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs) ...@@ -1772,7 +1772,7 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
if (num_vfs) { if (num_vfs) {
if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) { if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {
pf->flags |= I40E_FLAG_VEB_MODE_ENABLED; pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
i40e_do_reset_safe(pf, I40E_PF_RESET_FLAG); i40e_do_reset_safe(pf, I40E_PF_RESET_AND_REBUILD_FLAG);
} }
ret = i40e_pci_sriov_enable(pdev, num_vfs); ret = i40e_pci_sriov_enable(pdev, num_vfs);
goto sriov_configure_out; goto sriov_configure_out;
...@@ -1781,7 +1781,7 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs) ...@@ -1781,7 +1781,7 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
if (!pci_vfs_assigned(pf->pdev)) { if (!pci_vfs_assigned(pf->pdev)) {
i40e_free_vfs(pf); i40e_free_vfs(pf);
pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED; pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;
i40e_do_reset_safe(pf, I40E_PF_RESET_FLAG); i40e_do_reset_safe(pf, I40E_PF_RESET_AND_REBUILD_FLAG);
} else { } else {
dev_warn(&pdev->dev, "Unable to free VFs because some are assigned to VMs.\n"); dev_warn(&pdev->dev, "Unable to free VFs because some are assigned to VMs.\n");
ret = -EINVAL; ret = -EINVAL;
......
...@@ -1834,11 +1834,9 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter) ...@@ -1834,11 +1834,9 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter)
netif_tx_stop_all_queues(netdev); netif_tx_stop_all_queues(netdev);
if (CLIENT_ALLOWED(adapter)) { if (CLIENT_ALLOWED(adapter)) {
err = iavf_lan_add_device(adapter); err = iavf_lan_add_device(adapter);
if (err) { if (err)
rtnl_unlock();
dev_info(&pdev->dev, "Failed to add VF to client API service list: %d\n", dev_info(&pdev->dev, "Failed to add VF to client API service list: %d\n",
err); err);
}
} }
dev_info(&pdev->dev, "MAC address: %pM\n", adapter->hw.mac.addr); dev_info(&pdev->dev, "MAC address: %pM\n", adapter->hw.mac.addr);
if (netdev->features & NETIF_F_GRO) if (netdev->features & NETIF_F_GRO)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment