]> git.karo-electronics.de Git - linux-beck.git/commitdiff
sfc: Add ndo_get_vf_config() function for EF10
authorShradha Shah <sshah@solarflare.com>
Wed, 20 May 2015 10:11:18 +0000 (11:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 May 2015 22:43:54 +0000 (18:43 -0400)
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>
drivers/net/ethernet/sfc/ef10_sriov.c
drivers/net/ethernet/sfc/ef10_sriov.h

index 42a3b16e5bc11531fe19b94c86e88ec793de9f97..d9c2ea4da05827260057e7b95a2df5493a40c905 100644 (file)
@@ -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;
+}
index 7f12942656531615f9cabd90e4488816eafe49ab..8c92a8df508533eb7acaa06e05fe6557dc8c2395 100644 (file)
@@ -55,11 +55,8 @@ static inline int efx_ef10_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf,
        return -EOPNOTSUPP;
 }
 
-static inline int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf,
-                                              struct ifla_vf_info *ivf)
-{
-       return -EOPNOTSUPP;
-}
+int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i,
+                                struct ifla_vf_info *ivf);
 
 int efx_ef10_vswitching_probe_pf(struct efx_nic *efx);
 int efx_ef10_vswitching_probe_vf(struct efx_nic *efx);