Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Shradha Shah and committed by
David S. Miller
b9af9049 e340be92

+26 -5
+24
drivers/net/ethernet/sfc/ef10_sriov.c
··· 521 521 memset(vf->mac, 0, ETH_ALEN); 522 522 return rc; 523 523 } 524 + 525 + int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i, 526 + struct ifla_vf_info *ivf) 527 + { 528 + struct efx_ef10_nic_data *nic_data = efx->nic_data; 529 + struct ef10_vf *vf; 530 + 531 + if (vf_i >= efx->vf_count) 532 + return -EINVAL; 533 + 534 + if (!nic_data->vf) 535 + return -EOPNOTSUPP; 536 + 537 + vf = nic_data->vf + vf_i; 538 + 539 + ivf->vf = vf_i; 540 + ivf->min_tx_rate = 0; 541 + ivf->max_tx_rate = 0; 542 + ether_addr_copy(ivf->mac, vf->mac); 543 + ivf->vlan = 0; 544 + ivf->qos = 0; 545 + 546 + return 0; 547 + }
+2 -5
drivers/net/ethernet/sfc/ef10_sriov.h
··· 55 55 return -EOPNOTSUPP; 56 56 } 57 57 58 - static inline int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf, 59 - struct ifla_vf_info *ivf) 60 - { 61 - return -EOPNOTSUPP; 62 - } 58 + int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i, 59 + struct ifla_vf_info *ivf); 63 60 64 61 int efx_ef10_vswitching_probe_pf(struct efx_nic *efx); 65 62 int efx_ef10_vswitching_probe_vf(struct efx_nic *efx);