Commit 0c1822d9 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'make-sfc-siena-ko-specific-to-siena'

Martin Habets says:

====================
Make sfc-siena.ko specific to Siena

This series is a follow-up to the one titled "Move Siena into
a separate subdirectory".
It enhances the new sfc-siena.ko module to differentiate it from sfc.ko.

	Patches

Patches 1-5 create separate Kconfig options for Siena, and adjusts the
various names used for work items and directories.
Patch 6 reinstates SRIOV functionality in sfc-siena.ko.

	Testing

Various build tests were done such as allyesconfig, W=1 and sparse.
The new sfc-siena.ko and sfc.ko modules were tested on a machine with NICs
for both modules in them.
Inserting the updated sfc.ko and the new sfc-siena.ko modules at the same
time works, and no work items and directories exist with the same name.
====================

Link: https://lore.kernel.org/r/165228589518.696.7119477411428288875.stgit@palantir17.mph.net


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 75db72de c3743039
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ config SFC
	  To compile this driver as a module, choose M here.  The module
	  will be called sfc.
config SFC_MTD
	bool "Solarflare SFC9000/SFC9100-family MTD support"
	bool "Solarflare SFC9100-family MTD support"
	depends on SFC && MTD && !(SFC=y && MTD=m)
	default y
	help
@@ -40,14 +40,14 @@ config SFC_MTD
	  (e.g. /dev/mtd1).  This is required to update the firmware or
	  the boot configuration under Linux.
config SFC_MCDI_MON
	bool "Solarflare SFC9000/SFC9100-family hwmon support"
	bool "Solarflare SFC9100-family hwmon support"
	depends on SFC && HWMON && !(SFC=y && HWMON=m)
	default y
	help
	  This exposes the on-board firmware-managed sensors as a
	  hardware monitor device.
config SFC_SRIOV
	bool "Solarflare SFC9000/SFC9100-family SR-IOV support"
	bool "Solarflare SFC9100-family SR-IOV support"
	depends on SFC && PCI_IOV
	default y
	help
@@ -55,7 +55,7 @@ config SFC_SRIOV
	  features, allowing accelerated network performance in
	  virtualized environments.
config SFC_MCDI_LOGGING
	bool "Solarflare SFC9000/SFC9100-family MCDI logging support"
	bool "Solarflare SFC9100-family MCDI logging support"
	depends on SFC
	default y
	help
+33 −0
Original line number Diff line number Diff line
@@ -10,3 +10,36 @@ config SFC_SIENA

	  To compile this driver as a module, choose M here.  The module
	  will be called sfc-siena.
config SFC_SIENA_MTD
	bool "Solarflare SFC9000-family MTD support"
	depends on SFC_SIENA && MTD && !(SFC_SIENA=y && MTD=m)
	default y
	help
	  This exposes the on-board flash and/or EEPROM as MTD devices
	  (e.g. /dev/mtd1).  This is required to update the firmware or
	  the boot configuration under Linux.
config SFC_SIENA_MCDI_MON
	bool "Solarflare SFC9000-family hwmon support"
	depends on SFC_SIENA && HWMON && !(SFC_SIENA=y && HWMON=m)
	default y
	help
	  This exposes the on-board firmware-managed sensors as a
	  hardware monitor device.
config SFC_SIENA_SRIOV
	bool "Solarflare SFC9000-family SR-IOV support"
	depends on SFC_SIENA && PCI_IOV
	default n
	help
	  This enables support for the Single Root I/O Virtualization
	  features, allowing accelerated network performance in
	  virtualized environments.
config SFC_SIENA_MCDI_LOGGING
	bool "Solarflare SFC9000-family MCDI logging support"
	depends on SFC_SIENA
	default y
	help
	  This enables support for tracing of MCDI (Management-Controller-to-
	  Driver-Interface) commands and responses, allowing debugging of
	  driver/firmware interaction.  The tracing is actually enabled by
	  a sysfs file 'mcdi_logging' under the PCI device, or via module
	  parameter mcdi_logging_default.
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ sfc-siena-y += farch.o siena.o \
			   selftest.o ethtool.o ethtool_common.o ptp.o \
			   mcdi.o mcdi_port.o mcdi_port_common.o \
			   mcdi_mon.o
sfc-siena-$(CONFIG_SFC_MTD)	+= mtd.o
sfc-siena-$(CONFIG_SFC_SRIOV)	+= siena_sriov.o
sfc-siena-$(CONFIG_SFC_SIENA_MTD)	+= mtd.o
sfc-siena-$(CONFIG_SFC_SIENA_SRIOV)	+= siena_sriov.o

obj-$(CONFIG_SFC_SIENA)	+= sfc-siena.o
+22 −6
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@
#include "io.h"
#include "selftest.h"
#include "sriov.h"
#ifdef CONFIG_SFC_SIENA_SRIOV
#include "siena_sriov.h"
#endif

#include "mcdi_port_common.h"
#include "mcdi_pcol.h"
@@ -359,7 +362,7 @@ static int efx_probe_all(struct efx_nic *efx)
		goto fail3;
	}

#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
	rc = efx->type->vswitching_probe(efx);
	if (rc) /* not fatal; the PF will still work fine */
		netif_warn(efx, probe, efx->net_dev,
@@ -383,7 +386,7 @@ static int efx_probe_all(struct efx_nic *efx)
 fail5:
	efx_siena_remove_filters(efx);
 fail4:
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
	efx->type->vswitching_remove(efx);
#endif
 fail3:
@@ -402,7 +405,7 @@ static void efx_remove_all(struct efx_nic *efx)

	efx_siena_remove_channels(efx);
	efx_siena_remove_filters(efx);
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
	efx->type->vswitching_remove(efx);
#endif
	efx_remove_port(efx);
@@ -592,7 +595,7 @@ static const struct net_device_ops efx_netdev_ops = {
	.ndo_features_check	= efx_siena_features_check,
	.ndo_vlan_rx_add_vid	= efx_vlan_rx_add_vid,
	.ndo_vlan_rx_kill_vid	= efx_vlan_rx_kill_vid,
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
	.ndo_set_vf_mac		= efx_sriov_set_vf_mac,
	.ndo_set_vf_vlan	= efx_sriov_set_vf_vlan,
	.ndo_set_vf_spoofchk	= efx_sriov_set_vf_spoofchk,
@@ -1108,7 +1111,7 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
/* efx_pci_sriov_configure returns the actual number of Virtual Functions
 * enabled on success
 */
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
static int efx_pci_sriov_configure(struct pci_dev *dev, int num_vfs)
{
	int rc;
@@ -1250,7 +1253,7 @@ static struct pci_driver efx_pci_driver = {
	.remove		= efx_pci_remove,
	.driver.pm	= &efx_pm_ops,
	.err_handler	= &efx_siena_err_handlers,
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
	.sriov_configure = efx_pci_sriov_configure,
#endif
};
@@ -1271,6 +1274,12 @@ static int __init efx_init_module(void)
	if (rc)
		goto err_notifier;

#ifdef CONFIG_SFC_SIENA_SRIOV
	rc = efx_init_sriov();
	if (rc)
		goto err_sriov;
#endif

	rc = efx_siena_create_reset_workqueue();
	if (rc)
		goto err_reset;
@@ -1284,6 +1293,10 @@ static int __init efx_init_module(void)
 err_pci:
	efx_siena_destroy_reset_workqueue();
 err_reset:
#ifdef CONFIG_SFC_SIENA_SRIOV
	efx_fini_sriov();
 err_sriov:
#endif
	unregister_netdevice_notifier(&efx_netdev_notifier);
 err_notifier:
	return rc;
@@ -1295,6 +1308,9 @@ static void __exit efx_exit_module(void)

	pci_unregister_driver(&efx_pci_driver);
	efx_siena_destroy_reset_workqueue();
#ifdef CONFIG_SFC_SIENA_SRIOV
	efx_fini_sriov();
#endif
	unregister_netdevice_notifier(&efx_netdev_notifier);

}
+2 −2
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ void efx_siena_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs,
void efx_siena_update_sw_stats(struct efx_nic *efx, u64 *stats);

/* MTD */
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
int efx_siena_mtd_add(struct efx_nic *efx, struct efx_mtd_partition *parts,
		      size_t n_parts, size_t sizeof_part);
static inline int efx_mtd_probe(struct efx_nic *efx)
@@ -177,7 +177,7 @@ static inline void efx_siena_mtd_rename(struct efx_nic *efx) {}
static inline void efx_siena_mtd_remove(struct efx_nic *efx) {}
#endif

#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
static inline unsigned int efx_vf_size(struct efx_nic *efx)
{
	return 1 << efx->vi_scale;
Loading