|
@@ -43,6 +43,7 @@
|
|
#include <linux/etherdevice.h>
|
|
#include <linux/etherdevice.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
|
|
+#include <linux/lockdep.h>
|
|
#include <linux/pci.h>
|
|
#include <linux/pci.h>
|
|
#include <linux/pci_regs.h>
|
|
#include <linux/pci_regs.h>
|
|
#include <linux/msi.h>
|
|
#include <linux/msi.h>
|
|
@@ -561,19 +562,17 @@ nfp_net_eth_port_update(struct nfp_cpp *cpp, struct nfp_port *port,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void nfp_net_refresh_vnics(struct work_struct *work)
|
|
|
|
|
|
+int nfp_net_refresh_port_table_sync(struct nfp_pf *pf)
|
|
{
|
|
{
|
|
- struct nfp_pf *pf = container_of(work, struct nfp_pf,
|
|
|
|
- port_refresh_work);
|
|
|
|
struct nfp_eth_table *eth_table;
|
|
struct nfp_eth_table *eth_table;
|
|
struct nfp_net *nn, *next;
|
|
struct nfp_net *nn, *next;
|
|
struct nfp_port *port;
|
|
struct nfp_port *port;
|
|
|
|
|
|
- mutex_lock(&pf->lock);
|
|
|
|
|
|
+ lockdep_assert_held(&pf->lock);
|
|
|
|
|
|
/* Check for nfp_net_pci_remove() racing against us */
|
|
/* Check for nfp_net_pci_remove() racing against us */
|
|
if (list_empty(&pf->vnics))
|
|
if (list_empty(&pf->vnics))
|
|
- goto out;
|
|
|
|
|
|
+ return 0;
|
|
|
|
|
|
/* Update state of all ports */
|
|
/* Update state of all ports */
|
|
rtnl_lock();
|
|
rtnl_lock();
|
|
@@ -587,7 +586,7 @@ static void nfp_net_refresh_vnics(struct work_struct *work)
|
|
set_bit(NFP_PORT_CHANGED, &port->flags);
|
|
set_bit(NFP_PORT_CHANGED, &port->flags);
|
|
rtnl_unlock();
|
|
rtnl_unlock();
|
|
nfp_err(pf->cpp, "Error refreshing port config!\n");
|
|
nfp_err(pf->cpp, "Error refreshing port config!\n");
|
|
- goto out;
|
|
|
|
|
|
+ return -EIO;
|
|
}
|
|
}
|
|
|
|
|
|
list_for_each_entry(port, &pf->ports, port_list)
|
|
list_for_each_entry(port, &pf->ports, port_list)
|
|
@@ -608,7 +607,17 @@ static void nfp_net_refresh_vnics(struct work_struct *work)
|
|
|
|
|
|
if (list_empty(&pf->vnics))
|
|
if (list_empty(&pf->vnics))
|
|
nfp_net_pci_remove_finish(pf);
|
|
nfp_net_pci_remove_finish(pf);
|
|
-out:
|
|
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void nfp_net_refresh_vnics(struct work_struct *work)
|
|
|
|
+{
|
|
|
|
+ struct nfp_pf *pf = container_of(work, struct nfp_pf,
|
|
|
|
+ port_refresh_work);
|
|
|
|
+
|
|
|
|
+ mutex_lock(&pf->lock);
|
|
|
|
+ nfp_net_refresh_port_table_sync(pf);
|
|
mutex_unlock(&pf->lock);
|
|
mutex_unlock(&pf->lock);
|
|
}
|
|
}
|
|
|
|
|