* @max_data_vnics: Number of data vNICs app firmware supports
* @num_vnics: Number of vNICs spawned
* @vnics: Linked list of vNIC structures (struct nfp_net)
+ * @ports: Linked list of port structures (struct nfp_port)
* @port_refresh_work: Work entry for taking netdevs out
* @lock: Protects all fields which may change after probe
*/
unsigned int num_vnics;
struct list_head vnics;
+ struct list_head ports;
struct work_struct port_refresh_work;
struct mutex lock;
};
port_refresh_work);
struct nfp_eth_table *eth_table;
struct nfp_net *nn, *next;
+ struct nfp_port *port;
mutex_lock(&pf->lock);
/* Update state of all ports */
rtnl_lock();
- list_for_each_entry(nn, &pf->vnics, vnic_list)
- if (nn->port)
- clear_bit(NFP_PORT_CHANGED, &nn->port->flags);
+ list_for_each_entry(port, &pf->ports, port_list)
+ clear_bit(NFP_PORT_CHANGED, &port->flags);
eth_table = nfp_eth_read_ports(pf->cpp);
if (!eth_table) {
goto out;
}
- list_for_each_entry(nn, &pf->vnics, vnic_list) {
- if (!__nfp_port_get_eth_port(nn->port))
- continue;
-
- nfp_net_eth_port_update(pf->cpp, nn->port, eth_table);
- }
+ list_for_each_entry(port, &pf->ports, port_list)
+ if (__nfp_port_get_eth_port(port))
+ nfp_net_eth_port_update(pf->cpp, port, eth_table);
rtnl_unlock();
kfree(eth_table);
* @app: backpointer to the app structure
* @eth_id: for %NFP_PORT_PHYS_PORT port ID in NFP enumeration scheme
* @eth_port: for %NFP_PORT_PHYS_PORT translated ETH Table port entry
+ * @port_list: entry on pf's list of ports
*/
struct nfp_port {
struct net_device *netdev;
unsigned int eth_id;
struct nfp_eth_table_port *eth_port;
+
+ struct list_head port_list;
};
struct nfp_port *nfp_port_from_netdev(struct net_device *netdev);