summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/sfc/ef10_sriov.c
diff options
context:
space:
mode:
authorShradha Shah <sshah@solarflare.com>2015-05-20 13:11:18 +0300
committerDavid S. Miller <davem@davemloft.net>2015-05-22 01:43:54 +0300
commitb9af90499a9ac3b42f364216ec65e9c096c3a076 (patch)
tree275261f39ee20d170654e0c0e5f76ad5b6921f1d /drivers/net/ethernet/sfc/ef10_sriov.c
parente340be923012bfbc8935aa0af5638349939c82d2 (diff)
downloadlinux-b9af90499a9ac3b42f364216ec65e9c096c3a076.tar.xz
sfc: Add ndo_get_vf_config() function for EF10
rtnetlink calls ndo_get_vf_config when compiling information about a network interface, so that the VFs associated with a PF can be listed (eg: ip link show). Implement a response to this entry point and return PF-set MAC address for VF in ndo_get_vf_config Signed-off-by: Shradha Shah <sshah@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/ef10_sriov.c')
-rw-r--r--drivers/net/ethernet/sfc/ef10_sriov.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c
index 42a3b16e5bc1..d9c2ea4da058 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/drivers/net/ethernet/sfc/ef10_sriov.c
@@ -521,3 +521,27 @@ fail:
memset(vf->mac, 0, ETH_ALEN);
return rc;
}
+
+int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i,
+ struct ifla_vf_info *ivf)
+{
+ struct efx_ef10_nic_data *nic_data = efx->nic_data;
+ struct ef10_vf *vf;
+
+ if (vf_i >= efx->vf_count)
+ return -EINVAL;
+
+ if (!nic_data->vf)
+ return -EOPNOTSUPP;
+
+ vf = nic_data->vf + vf_i;
+
+ ivf->vf = vf_i;
+ ivf->min_tx_rate = 0;
+ ivf->max_tx_rate = 0;
+ ether_addr_copy(ivf->mac, vf->mac);
+ ivf->vlan = 0;
+ ivf->qos = 0;
+
+ return 0;
+}