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

sfc: Bind the sfc driver to any available VF's

Add the device ID of the VF to the PCI device ID table.

Added a boolean flag is_vf in efx_nic_type to differentiate
between a VF and PF at probe time. This flag is useful in later
patches while setting MAC address specially in the
PCI-passthrough case.

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
6f7f8aa6 267c0157

+11 -11
+2
drivers/net/ethernet/sfc/ef10.c
··· 3810 3810 } 3811 3811 3812 3812 const struct efx_nic_type efx_hunt_a0_vf_nic_type = { 3813 + .is_vf = true, 3813 3814 .mem_bar = EFX_MEM_VF_BAR, 3814 3815 .mem_map_size = efx_ef10_mem_map_size, 3815 3816 .probe = efx_ef10_probe_vf, ··· 3908 3907 }; 3909 3908 3910 3909 const struct efx_nic_type efx_hunt_a0_nic_type = { 3910 + .is_vf = false, 3911 3911 .mem_bar = EFX_MEM_BAR, 3912 3912 .mem_map_size = efx_ef10_mem_map_size, 3913 3913 .probe = efx_ef10_probe_pf,
+5 -1
drivers/net/ethernet/sfc/efx.c
··· 1454 1454 } 1455 1455 #endif 1456 1456 efx->rss_spread = efx->n_rx_channels; 1457 + 1457 1458 return 0; 1458 1459 } 1459 1460 ··· 2677 2676 .driver_data = (unsigned long) &siena_a0_nic_type}, 2678 2677 {PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0903), /* SFC9120 PF */ 2679 2678 .driver_data = (unsigned long) &efx_hunt_a0_nic_type}, 2679 + {PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x1903), /* SFC9120 VF */ 2680 + .driver_data = (unsigned long) &efx_hunt_a0_vf_nic_type}, 2680 2681 {PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0923), /* SFC9140 PF */ 2681 2682 .driver_data = (unsigned long) &efx_hunt_a0_nic_type}, 2682 2683 {0} /* end of list */ ··· 3034 3031 netif_info(efx, probe, efx->net_dev, 3035 3032 "Solarflare NIC detected\n"); 3036 3033 3037 - efx_probe_vpd_strings(efx); 3034 + if (!efx->type->is_vf) 3035 + efx_probe_vpd_strings(efx); 3038 3036 3039 3037 /* Set up basic I/O (BAR mappings etc) */ 3040 3038 rc = efx_init_io(efx);
+2
drivers/net/ethernet/sfc/falcon.c
··· 2700 2700 */ 2701 2701 2702 2702 const struct efx_nic_type falcon_a1_nic_type = { 2703 + .is_vf = false, 2703 2704 .mem_bar = EFX_MEM_BAR, 2704 2705 .mem_map_size = falcon_a1_mem_map_size, 2705 2706 .probe = falcon_probe_nic, ··· 2798 2797 }; 2799 2798 2800 2799 const struct efx_nic_type falcon_b0_nic_type = { 2800 + .is_vf = false, 2801 2801 .mem_bar = EFX_MEM_BAR, 2802 2802 .mem_map_size = falcon_b0_mem_map_size, 2803 2803 .probe = falcon_probe_nic,
-10
drivers/net/ethernet/sfc/mcdi.c
··· 1186 1186 * and are completely trusted by firmware. Abort probing 1187 1187 * if that's not true for this function. 1188 1188 */ 1189 - if (driver_operating && 1190 - (efx->mcdi->fn_flags & 1191 - (1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL | 1192 - 1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED)) != 1193 - (1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL | 1194 - 1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED)) { 1195 - netif_err(efx, probe, efx->net_dev, 1196 - "This driver version only supports one function per port\n"); 1197 - return -ENODEV; 1198 - } 1199 1189 1200 1190 if (was_attached != NULL) 1201 1191 *was_attached = MCDI_DWORD(outbuf, DRV_ATTACH_OUT_OLD_STATE);
+1
drivers/net/ethernet/sfc/net_driver.h
··· 1224 1224 * @hwtstamp_filters: Mask of hardware timestamp filter types supported 1225 1225 */ 1226 1226 struct efx_nic_type { 1227 + bool is_vf; 1227 1228 unsigned int mem_bar; 1228 1229 unsigned int (*mem_map_size)(struct efx_nic *efx); 1229 1230 int (*probe)(struct efx_nic *efx);
+1
drivers/net/ethernet/sfc/siena.c
··· 917 917 */ 918 918 919 919 const struct efx_nic_type siena_a0_nic_type = { 920 + .is_vf = false, 920 921 .mem_bar = EFX_MEM_BAR, 921 922 .mem_map_size = siena_mem_map_size, 922 923 .probe = siena_probe_nic,