summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc/nic.h
diff options
context:
space:
mode:
authorShradha Shah <sshah@solarflare.com>2015-05-06 00:58:31 +0100
committerDavid S. Miller <davem@davemloft.net>2015-05-09 16:16:48 -0400
commit3c5eb87605e85146a78de589b5070a37862425db (patch)
tree4730938ae165f0ee4bfd70d887982ef427ff0f10 /drivers/net/ethernet/sfc/nic.h
parent02246a7f966c2e66ff0453d12d9b8d1bff895cf9 (diff)
sfc: create vports for VFs and assign random MAC addresses
The parent PF creates vports for all its child VFs and adds MAC addresses to these. When the VF driver loads, it can make an MCDI call to get the MAC address that the parent PF assigned it. The parent PF also assigns a mac address to its own vport because implicit creation of a vAdaptor will only work on evb ports with MAC addresses assigned. The vport MAC address needs to be stored in the PF's nic_data struct as it can later be changed on the vadaptor (and its net_dev struct). When removing a vport the original MAC address must be deleted. A new flag is needed in the VF data structure to identify whether a vport has been assigned to the VF. This is to determine whether it needs to be un-assigned before freeing the vport. Also, attempting to un-assign a vport which is not assigned will result in an EALREADY error. Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/nic.h')
-rw-r--r--drivers/net/ethernet/sfc/nic.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h
index b350c396bcc5..e833e973b79d 100644
--- a/drivers/net/ethernet/sfc/nic.h
+++ b/drivers/net/ethernet/sfc/nic.h
@@ -496,6 +496,9 @@ enum {
* @vport_id: The function's vport ID, only relevant for PFs
* @must_probe_vswitching: Flag: vswitching has yet to be setup after MC reboot
* @pf_index: The number for this PF, or the parent PF if this is a VF
+#ifdef CONFIG_SFC_SRIOV
+ * @vf: Pointer to VF data structure
+#endif
*/
struct efx_ef10_nic_data {
struct efx_buffer mcdi_buf;
@@ -519,6 +522,10 @@ struct efx_ef10_nic_data {
unsigned int vport_id;
bool must_probe_vswitching;
unsigned int pf_index;
+#ifdef CONFIG_SFC_SRIOV
+ struct ef10_vf *vf;
+#endif
+ u8 vport_mac[ETH_ALEN];
};
int efx_init_sriov(void);