Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8127d661 authored by Ben Hutchings's avatar Ben Hutchings
Browse files

sfc: Add support for Solarflare SFC9100 family



This adds support for the EF10 network controller architecture and the
SFC9100 family, starting with SFC9120 'Farmingdale', and bumps the
driver version to 4.0.

New features in the SFC9100 family include:

- Flexible allocation of internal resources to PCIe physical and virtual
  functions under firmware control
- RX event merging to reduce DMA writes at high packet rates
- Integrated RX timestamping
- PIO buffers for lower TX latency
- Firmware-driven data path that supports additional offload features
  and filter types
- Delivery of packets between functions and to multiple recipients,
  allowing firmware to implement a vswitch
- Multiple RX flow hash (RSS) contexts with their own hash keys and
  indirection tables
- 40G MAC (single port only)

...not all of which are enabled in this initial driver or the initial
firmware release.

Much of the new code is by Jon Cooper.

Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
parent 4c75b43a
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
config SFC
config SFC
	tristate "Solarflare SFC4000/SFC9000-family support"
	tristate "Solarflare SFC4000/SFC9000/SFC9100-family support"
	depends on PCI
	depends on PCI
	select MDIO
	select MDIO
	select CRC32
	select CRC32
@@ -8,12 +8,13 @@ config SFC
	select PTP_1588_CLOCK
	select PTP_1588_CLOCK
	---help---
	---help---
	  This driver supports 10-gigabit Ethernet cards based on
	  This driver supports 10-gigabit Ethernet cards based on
	  the Solarflare SFC4000 and SFC9000-family controllers.
	  the Solarflare SFC4000, SFC9000-family and SFC9100-family
	  controllers.


	  To compile this driver as a module, choose M here.  The module
	  To compile this driver as a module, choose M here.  The module
	  will be called sfc.
	  will be called sfc.
config SFC_MTD
config SFC_MTD
	bool "Solarflare SFC4000/SFC9000-family MTD support"
	bool "Solarflare SFC4000/SFC9000/SFC9100-family MTD support"
	depends on SFC && MTD && !(SFC=y && MTD=m)
	depends on SFC && MTD && !(SFC=y && MTD=m)
	default y
	default y
	---help---
	---help---
@@ -21,7 +22,7 @@ config SFC_MTD
	  (e.g. /dev/mtd1).  This is required to update the firmware or
	  (e.g. /dev/mtd1).  This is required to update the firmware or
	  the boot configuration under Linux.
	  the boot configuration under Linux.
config SFC_MCDI_MON
config SFC_MCDI_MON
	bool "Solarflare SFC9000-family hwmon support"
	bool "Solarflare SFC9000/SFC9100-family hwmon support"
	depends on SFC && HWMON && !(SFC=y && HWMON=m)
	depends on SFC && HWMON && !(SFC=y && HWMON=m)
	default y
	default y
	---help---
	---help---
+2 −2
Original line number Original line Diff line number Diff line
sfc-y			+= efx.o nic.o farch.o falcon.o siena.o tx.o rx.o \
sfc-y			+= efx.o nic.o farch.o falcon.o siena.o ef10.o tx.o \
			   selftest.o ethtool.o qt202x_phy.o mdio_10g.o \
			   rx.o selftest.o ethtool.o qt202x_phy.o mdio_10g.o \
			   tenxpress.o txc43128_phy.o falcon_boards.o \
			   tenxpress.o txc43128_phy.o falcon_boards.o \
			   mcdi.o mcdi_port.o mcdi_mon.o ptp.o
			   mcdi.o mcdi_port.o mcdi_mon.o ptp.o
sfc-$(CONFIG_SFC_MTD)	+= mtd.o
sfc-$(CONFIG_SFC_MTD)	+= mtd.o
+4 −0
Original line number Original line Diff line number Diff line
@@ -29,6 +29,10 @@
/* Lowest bit numbers and widths */
/* Lowest bit numbers and widths */
#define EFX_DUMMY_FIELD_LBN 0
#define EFX_DUMMY_FIELD_LBN 0
#define EFX_DUMMY_FIELD_WIDTH 0
#define EFX_DUMMY_FIELD_WIDTH 0
#define EFX_WORD_0_LBN 0
#define EFX_WORD_0_WIDTH 16
#define EFX_WORD_1_LBN 16
#define EFX_WORD_1_WIDTH 16
#define EFX_DWORD_0_LBN 0
#define EFX_DWORD_0_LBN 0
#define EFX_DWORD_0_WIDTH 32
#define EFX_DWORD_0_WIDTH 32
#define EFX_DWORD_1_LBN 32
#define EFX_DWORD_1_LBN 32
+3043 −0

File added.

Preview size limit exceeded, changes collapsed.

+31 −3
Original line number Original line Diff line number Diff line
@@ -2075,7 +2075,7 @@ static int efx_set_features(struct net_device *net_dev, netdev_features_t data)
	return 0;
	return 0;
}
}


static const struct net_device_ops efx_netdev_ops = {
static const struct net_device_ops efx_farch_netdev_ops = {
	.ndo_open		= efx_net_open,
	.ndo_open		= efx_net_open,
	.ndo_stop		= efx_net_stop,
	.ndo_stop		= efx_net_stop,
	.ndo_get_stats64	= efx_net_stats,
	.ndo_get_stats64	= efx_net_stats,
@@ -2102,6 +2102,26 @@ static const struct net_device_ops efx_netdev_ops = {
#endif
#endif
};
};


static const struct net_device_ops efx_ef10_netdev_ops = {
	.ndo_open		= efx_net_open,
	.ndo_stop		= efx_net_stop,
	.ndo_get_stats64	= efx_net_stats,
	.ndo_tx_timeout		= efx_watchdog,
	.ndo_start_xmit		= efx_hard_start_xmit,
	.ndo_validate_addr	= eth_validate_addr,
	.ndo_do_ioctl		= efx_ioctl,
	.ndo_change_mtu		= efx_change_mtu,
	.ndo_set_mac_address	= efx_set_mac_address,
	.ndo_set_rx_mode	= efx_set_rx_mode,
	.ndo_set_features	= efx_set_features,
#ifdef CONFIG_NET_POLL_CONTROLLER
	.ndo_poll_controller	= efx_netpoll,
#endif
#ifdef CONFIG_RFS_ACCEL
	.ndo_rx_flow_steer	= efx_filter_rfs,
#endif
};

static void efx_update_name(struct efx_nic *efx)
static void efx_update_name(struct efx_nic *efx)
{
{
	strcpy(efx->name, efx->net_dev->name);
	strcpy(efx->name, efx->net_dev->name);
@@ -2114,7 +2134,8 @@ static int efx_netdev_event(struct notifier_block *this,
{
{
	struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);
	struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);


	if (net_dev->netdev_ops == &efx_netdev_ops &&
	if ((net_dev->netdev_ops == &efx_farch_netdev_ops ||
	     net_dev->netdev_ops == &efx_ef10_netdev_ops) &&
	    event == NETDEV_CHANGENAME)
	    event == NETDEV_CHANGENAME)
		efx_update_name(netdev_priv(net_dev));
		efx_update_name(netdev_priv(net_dev));


@@ -2141,7 +2162,12 @@ static int efx_register_netdev(struct efx_nic *efx)


	net_dev->watchdog_timeo = 5 * HZ;
	net_dev->watchdog_timeo = 5 * HZ;
	net_dev->irq = efx->pci_dev->irq;
	net_dev->irq = efx->pci_dev->irq;
	net_dev->netdev_ops = &efx_netdev_ops;
	if (efx_nic_rev(efx) >= EFX_REV_HUNT_A0) {
		net_dev->netdev_ops = &efx_ef10_netdev_ops;
		net_dev->priv_flags |= IFF_UNICAST_FLT;
	} else {
		net_dev->netdev_ops = &efx_farch_netdev_ops;
	}
	SET_ETHTOOL_OPS(net_dev, &efx_ethtool_ops);
	SET_ETHTOOL_OPS(net_dev, &efx_ethtool_ops);
	net_dev->gso_max_segs = EFX_TSO_MAX_SEGS;
	net_dev->gso_max_segs = EFX_TSO_MAX_SEGS;


@@ -2463,6 +2489,8 @@ static DEFINE_PCI_DEVICE_TABLE(efx_pci_table) = {
	 .driver_data = (unsigned long) &siena_a0_nic_type},
	 .driver_data = (unsigned long) &siena_a0_nic_type},
	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0813),	/* SFL9021 */
	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0813),	/* SFL9021 */
	 .driver_data = (unsigned long) &siena_a0_nic_type},
	 .driver_data = (unsigned long) &siena_a0_nic_type},
	{PCI_DEVICE(PCI_VENDOR_ID_SOLARFLARE, 0x0903),  /* SFC9120 PF */
	 .driver_data = (unsigned long) &efx_hunt_a0_nic_type},
	{0}			/* end of list */
	{0}			/* end of list */
};
};


Loading