Skip to content

Commit 5a6681e

Browse files
ecree-solarflaredavem330
authored andcommitted
sfc: separate out SFC4000 ("Falcon") support into new sfc-falcon driver
Rationale: The differences between Falcon and Siena are in many ways larger than those between Siena and EF10 (despite Siena being nominally "Falcon- architecture"); for instance, Falcon has no MCPU, so there is no MCDI. Removing Falcon support from the sfc driver should simplify the latter, and avoid the possibility of Falcon support being broken by changes to sfc (which are rarely if ever tested on Falcon, it being end-of-lifed hardware). The sfc-falcon driver created in this changeset is essentially a copy of the sfc driver, but with Siena- and EF10-specific code, including MCDI, removed and with the "efx_" identifier prefix changed to "ef4_" (for "EFX 4000- series") to avoid collisions when both drivers are built-in. This changeset removes Falcon from the sfc driver's PCI ID table; then in sfc I've removed obvious Falcon-related code: I removed the Falcon NIC functions, Falcon PHY code, and EFX_REV_FALCON_*, then fixed up everything that referenced them. Also, increment minor version of both drivers (to 4.1). For now, CONFIG_SFC selects CONFIG_SFC_FALCON, so that updating old configs doesn't cause Falcon support to disappear; but that should be undone at some point in the future. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6bb10c2 commit 5a6681e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+18213
-1220
lines changed

drivers/net/ethernet/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ source "drivers/net/ethernet/seeq/Kconfig"
165165
source "drivers/net/ethernet/silan/Kconfig"
166166
source "drivers/net/ethernet/sis/Kconfig"
167167
source "drivers/net/ethernet/sfc/Kconfig"
168+
source "drivers/net/ethernet/sfc/falcon/Kconfig"
168169
source "drivers/net/ethernet/sgi/Kconfig"
169170
source "drivers/net/ethernet/smsc/Kconfig"
170171
source "drivers/net/ethernet/stmicro/Kconfig"

drivers/net/ethernet/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ obj-$(CONFIG_NET_VENDOR_SEEQ) += seeq/
7575
obj-$(CONFIG_NET_VENDOR_SILAN) += silan/
7676
obj-$(CONFIG_NET_VENDOR_SIS) += sis/
7777
obj-$(CONFIG_SFC) += sfc/
78+
obj-$(CONFIG_SFC_FALCON) += sfc/falcon/
7879
obj-$(CONFIG_NET_VENDOR_SGI) += sgi/
7980
obj-$(CONFIG_NET_VENDOR_SMSC) += smsc/
8081
obj-$(CONFIG_NET_VENDOR_STMICRO) += stmicro/

drivers/net/ethernet/sfc/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
config SFC
2-
tristate "Solarflare SFC4000/SFC9000/SFC9100-family support"
2+
tristate "Solarflare SFC9000/SFC9100-family support"
33
depends on PCI
44
select MDIO
55
select CRC32
66
select I2C
77
select I2C_ALGOBIT
88
select PTP_1588_CLOCK
9+
select SFC_FALCON
910
---help---
1011
This driver supports 10/40-gigabit Ethernet cards based on
11-
the Solarflare SFC4000, SFC9000-family and SFC9100-family
12-
controllers.
12+
the Solarflare SFC9000-family and SFC9100-family controllers.
1313

1414
To compile this driver as a module, choose M here. The module
1515
will be called sfc.
1616
config SFC_MTD
17-
bool "Solarflare SFC4000/SFC9000/SFC9100-family MTD support"
17+
bool "Solarflare SFC9000/SFC9100-family MTD support"
1818
depends on SFC && MTD && !(SFC=y && MTD=m)
1919
default y
2020
---help---

drivers/net/ethernet/sfc/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
sfc-y += efx.o nic.o farch.o falcon.o siena.o ef10.o tx.o \
2-
rx.o selftest.o ethtool.o qt202x_phy.o mdio_10g.o \
3-
tenxpress.o txc43128_phy.o falcon_boards.o \
4-
mcdi.o mcdi_port.o mcdi_mon.o ptp.o tx_tso.o
1+
sfc-y += efx.o nic.o farch.o siena.o ef10.o tx.o rx.o \
2+
selftest.o ethtool.o ptp.o tx_tso.o \
3+
mcdi.o mcdi_port.o mcdi_mon.o
54
sfc-$(CONFIG_SFC_MTD) += mtd.o
65
sfc-$(CONFIG_SFC_SRIOV) += sriov.o siena_sriov.o ef10_sriov.o
76

drivers/net/ethernet/sfc/efx.c

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -733,16 +733,7 @@ static void efx_stop_datapath(struct efx_nic *efx)
733733
}
734734

735735
rc = efx->type->fini_dmaq(efx);
736-
if (rc && EFX_WORKAROUND_7803(efx)) {
737-
/* Schedule a reset to recover from the flush failure. The
738-
* descriptor caches reference memory we're about to free,
739-
* but falcon_reconfigure_mac_wrapper() won't reconnect
740-
* the MACs because of the pending reset.
741-
*/
742-
netif_err(efx, drv, efx->net_dev,
743-
"Resetting to recover from flush failure\n");
744-
efx_schedule_reset(efx, RESET_TYPE_ALL);
745-
} else if (rc) {
736+
if (rc) {
746737
netif_err(efx, drv, efx->net_dev, "failed to flush queues\n");
747738
} else {
748739
netif_dbg(efx, drv, efx->net_dev,
@@ -1892,15 +1883,13 @@ static void efx_start_all(struct efx_nic *efx)
18921883
queue_delayed_work(efx->workqueue, &efx->monitor_work,
18931884
efx_monitor_interval);
18941885

1895-
/* If link state detection is normally event-driven, we have
1886+
/* Link state detection is normally event-driven; we have
18961887
* to poll now because we could have missed a change
18971888
*/
1898-
if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0) {
1899-
mutex_lock(&efx->mac_lock);
1900-
if (efx->phy_op->poll(efx))
1901-
efx_link_status_changed(efx);
1902-
mutex_unlock(&efx->mac_lock);
1903-
}
1889+
mutex_lock(&efx->mac_lock);
1890+
if (efx->phy_op->poll(efx))
1891+
efx_link_status_changed(efx);
1892+
mutex_unlock(&efx->mac_lock);
19041893

19051894
efx->type->start_stats(efx);
19061895
efx->type->pull_stats(efx);
@@ -2842,12 +2831,6 @@ void efx_schedule_reset(struct efx_nic *efx, enum reset_type type)
28422831

28432832
/* PCI device ID table */
28442833
static const struct pci_device_id efx_pci_table[] = {
2845-
{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE,
2846-
PCI_DEVICE_ID_SOLARFLARE_SFC4000A_0),
2847-
.driver_data = (unsigned long) &falcon_a1_nic_type},
2848-
{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE,
2849-
PCI_DEVICE_ID_SOLARFLARE_SFC4000B),
2850-
.driver_data = (unsigned long) &falcon_b0_nic_type},
28512834
{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0803), /* SFC9020 */
28522835
.driver_data = (unsigned long) &siena_a0_nic_type},
28532836
{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0813), /* SFL9021 */

drivers/net/ethernet/sfc/ethtool.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,8 @@ static void efx_ethtool_get_drvinfo(struct net_device *net_dev,
169169

170170
strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
171171
strlcpy(info->version, EFX_DRIVER_VERSION, sizeof(info->version));
172-
if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0)
173-
efx_mcdi_print_fwver(efx, info->fw_version,
174-
sizeof(info->fw_version));
172+
efx_mcdi_print_fwver(efx, info->fw_version,
173+
sizeof(info->fw_version));
175174
strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
176175
}
177176

@@ -966,8 +965,6 @@ efx_ethtool_get_rxnfc(struct net_device *net_dev,
966965
return 0;
967966

968967
case ETHTOOL_GRXFH: {
969-
unsigned min_revision = 0;
970-
971968
info->data = 0;
972969
switch (info->flow_type) {
973970
case UDP_V4_FLOW:
@@ -980,7 +977,6 @@ efx_ethtool_get_rxnfc(struct net_device *net_dev,
980977
case AH_ESP_V4_FLOW:
981978
case IPV4_FLOW:
982979
info->data |= RXH_IP_SRC | RXH_IP_DST;
983-
min_revision = EFX_REV_FALCON_B0;
984980
break;
985981
case UDP_V6_FLOW:
986982
if (efx->rx_hash_udp_4tuple)
@@ -992,13 +988,10 @@ efx_ethtool_get_rxnfc(struct net_device *net_dev,
992988
case AH_ESP_V6_FLOW:
993989
case IPV6_FLOW:
994990
info->data |= RXH_IP_SRC | RXH_IP_DST;
995-
min_revision = EFX_REV_SIENA_A0;
996991
break;
997992
default:
998993
break;
999994
}
1000-
if (efx_nic_rev(efx) < min_revision)
1001-
info->data = 0;
1002995
return 0;
1003996
}
1004997

@@ -1271,9 +1264,7 @@ static u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
12711264
{
12721265
struct efx_nic *efx = netdev_priv(net_dev);
12731266

1274-
return ((efx_nic_rev(efx) < EFX_REV_FALCON_B0 ||
1275-
efx->n_rx_channels == 1) ?
1276-
0 : ARRAY_SIZE(efx->rx_indir_table));
1267+
return (efx->n_rx_channels == 1) ? 0 : ARRAY_SIZE(efx->rx_indir_table);
12771268
}
12781269

12791270
static int efx_ethtool_get_rxfh(struct net_device *net_dev, u32 *indir, u8 *key,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
config SFC_FALCON
2+
tristate "Solarflare SFC4000 support"
3+
depends on PCI
4+
select MDIO
5+
select CRC32
6+
select I2C
7+
select I2C_ALGOBIT
8+
---help---
9+
This driver supports 10-gigabit Ethernet cards based on
10+
the Solarflare SFC4000 controller.
11+
12+
To compile this driver as a module, choose M here. The module
13+
will be called sfc-falcon.
14+
config SFC_FALCON_MTD
15+
bool "Solarflare SFC4000 MTD support"
16+
depends on SFC_FALCON && MTD && !(SFC_FALCON=y && MTD=m)
17+
default y
18+
---help---
19+
This exposes the on-board flash and/or EEPROM as MTD devices
20+
(e.g. /dev/mtd1). This is required to update the boot
21+
configuration under Linux.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sfc-falcon-y += efx.o nic.o farch.o falcon.o tx.o rx.o selftest.o \
2+
ethtool.o qt202x_phy.o mdio_10g.o tenxpress.o \
3+
txc43128_phy.o falcon_boards.o
4+
5+
sfc-falcon-$(CONFIG_SFC_FALCON_MTD) += mtd.o
6+
obj-$(CONFIG_SFC_FALCON) += sfc-falcon.o

0 commit comments

Comments
 (0)