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

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.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 75db72de c3743039
......@@ -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
......
......@@ -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.
......@@ -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
......@@ -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);
}
......
......@@ -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;
......
......@@ -110,7 +110,7 @@ static unsigned int efx_wanted_parallelism(struct efx_nic *efx)
/* If RSS is requested for the PF *and* VFs then we can't write RSS
* table entries that are inaccessible to VFs
*/
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
if (efx->type->sriov_wanted) {
if (efx->type->sriov_wanted(efx) && efx_vf_size(efx) > 1 &&
count > efx_vf_size(efx)) {
......@@ -348,7 +348,7 @@ int efx_siena_probe_interrupts(struct efx_nic *efx)
rss_spread = efx->n_rx_channels;
/* RSS might be usable on VFs even if it is disabled on the PF */
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
if (efx->type->sriov_wanted) {
efx->rss_spread = ((rss_spread > 1 ||
!efx->type->sriov_wanted(efx)) ?
......
......@@ -112,7 +112,7 @@ static struct workqueue_struct *reset_workqueue;
int efx_siena_create_reset_workqueue(void)
{
reset_workqueue = create_singlethread_workqueue("sfc_reset");
reset_workqueue = create_singlethread_workqueue("sfc_siena_reset");
if (!reset_workqueue) {
printk(KERN_ERR "Failed to create reset workqueue\n");
return -ENOMEM;
......@@ -778,7 +778,7 @@ int efx_siena_reset_up(struct efx_nic *efx, enum reset_type method, bool ok)
if (rc)
goto fail;
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
rc = efx->type->vswitching_restore(efx);
if (rc) /* not fatal; the PF will still work fine */
netif_warn(efx, probe, efx->net_dev,
......@@ -997,7 +997,7 @@ int efx_siena_init_struct(struct efx_nic *efx,
INIT_LIST_HEAD(&efx->node);
INIT_LIST_HEAD(&efx->secondary_list);
spin_lock_init(&efx->biu_lock);
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
INIT_LIST_HEAD(&efx->mtd_list);
#endif
INIT_WORK(&efx->reset_work, efx_reset_work);
......@@ -1170,7 +1170,7 @@ void efx_siena_fini_io(struct efx_nic *efx)
pci_disable_device(efx->pci_dev);
}
#ifdef CONFIG_SFC_MCDI_LOGGING
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
static ssize_t mcdi_logging_show(struct device *dev,
struct device_attribute *attr,
char *buf)
......
......@@ -88,7 +88,7 @@ static inline void efx_schedule_channel_irq(struct efx_channel *channel)
efx_schedule_channel(channel);
}
#ifdef CONFIG_SFC_MCDI_LOGGING
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
void efx_siena_init_mcdi_logging(struct efx_nic *efx);
void efx_siena_fini_mcdi_logging(struct efx_nic *efx);
#else
......
......@@ -228,7 +228,7 @@ static int efx_alloc_special_buffer(struct efx_nic *efx,
struct efx_special_buffer *buffer,
unsigned int len)
{
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
struct siena_nic_data *nic_data = efx->nic_data;
#endif
len = ALIGN(len, EFX_BUF_SIZE);
......@@ -241,7 +241,7 @@ static int efx_alloc_special_buffer(struct efx_nic *efx,
/* Select new buffer ID */
buffer->index = efx->next_buffer_table;
efx->next_buffer_table += buffer->entries;
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
BUG_ON(efx_siena_sriov_enabled(efx) &&
nic_data->vf_buftbl_base < efx->next_buffer_table);
#endif
......@@ -1187,7 +1187,7 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
netif_vdbg(efx, hw, efx->net_dev, "channel %d TXQ %d flushed\n",
channel->channel, ev_sub_data);
efx_farch_handle_tx_flush_done(efx, event);
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
efx_siena_sriov_tx_flush_done(efx, event);
#endif
break;
......@@ -1195,7 +1195,7 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
netif_vdbg(efx, hw, efx->net_dev, "channel %d RXQ %d flushed\n",
channel->channel, ev_sub_data);
efx_farch_handle_rx_flush_done(efx, event);
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
efx_siena_sriov_rx_flush_done(efx, event);
#endif
break;
......@@ -1233,7 +1233,7 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
ev_sub_data);
efx_siena_schedule_reset(efx, RESET_TYPE_DMA_ERROR);
}
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
else
efx_siena_sriov_desc_fetch_err(efx, ev_sub_data);
#endif
......@@ -1246,7 +1246,7 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
ev_sub_data);
efx_siena_schedule_reset(efx, RESET_TYPE_DMA_ERROR);
}
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
else
efx_siena_sriov_desc_fetch_err(efx, ev_sub_data);
#endif
......@@ -1307,7 +1307,7 @@ int efx_farch_ev_process(struct efx_channel *channel, int budget)
case FSE_AZ_EV_CODE_DRIVER_EV:
efx_farch_handle_driver_event(channel, &event);
break;
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
case FSE_CZ_EV_CODE_USER_EV:
efx_siena_sriov_event(channel, &event);
break;
......@@ -1671,7 +1671,7 @@ void efx_farch_rx_pull_indir_table(struct efx_nic *efx)
void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw)
{
unsigned vi_count, total_tx_channels;
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
struct siena_nic_data *nic_data;
unsigned buftbl_min;
#endif
......@@ -1679,7 +1679,7 @@ void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw)
total_tx_channels = efx->n_tx_channels + efx->n_extra_tx_channels;
vi_count = max(efx->n_channels, total_tx_channels * EFX_MAX_TXQ_PER_CHANNEL);
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
nic_data = efx->nic_data;
/* Account for the buffer table entries backing the datapath channels
* and the descriptor caches for those channels.
......
......@@ -51,9 +51,10 @@ static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating,
static bool efx_mcdi_poll_once(struct efx_nic *efx);
static void efx_mcdi_abandon(struct efx_nic *efx);
#ifdef CONFIG_SFC_MCDI_LOGGING
static bool mcdi_logging_default;
module_param(mcdi_logging_default, bool, 0644);
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
static bool efx_siena_mcdi_logging_default;
module_param_named(mcdi_logging_default, efx_siena_mcdi_logging_default,
bool, 0644);
MODULE_PARM_DESC(mcdi_logging_default,
"Enable MCDI logging on newly-probed functions");
#endif
......@@ -70,12 +71,12 @@ int efx_siena_mcdi_init(struct efx_nic *efx)
mcdi = efx_mcdi(efx);
mcdi->efx = efx;
#ifdef CONFIG_SFC_MCDI_LOGGING
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
/* consuming code assumes buffer is page-sized */
mcdi->logging_buffer = (char *)__get_free_page(GFP_KERNEL);
if (!mcdi->logging_buffer)
goto fail1;
mcdi->logging_enabled = mcdi_logging_default;
mcdi->logging_enabled = efx_siena_mcdi_logging_default;
#endif
init_waitqueue_head(&mcdi->wq);
init_waitqueue_head(&mcdi->proxy_rx_wq);
......@@ -114,7 +115,7 @@ int efx_siena_mcdi_init(struct efx_nic *efx)
return 0;
fail2:
#ifdef CONFIG_SFC_MCDI_LOGGING
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
free_page((unsigned long)mcdi->logging_buffer);
fail1:
#endif
......@@ -140,7 +141,7 @@ void efx_siena_mcdi_fini(struct efx_nic *efx)
if (!efx->mcdi)
return;
#ifdef CONFIG_SFC_MCDI_LOGGING
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
free_page((unsigned long)efx->mcdi->iface.logging_buffer);
#endif
......@@ -151,7 +152,7 @@ static void efx_mcdi_send_request(struct efx_nic *efx, unsigned cmd,
const efx_dword_t *inbuf, size_t inlen)
{
struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
#ifdef CONFIG_SFC_MCDI_LOGGING
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
char *buf = mcdi->logging_buffer; /* page-sized */
#endif
efx_dword_t hdr[2];
......@@ -198,7 +199,7 @@ static void efx_mcdi_send_request(struct efx_nic *efx, unsigned cmd,
hdr_len = 8;
}
#ifdef CONFIG_SFC_MCDI_LOGGING
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
if (mcdi->logging_enabled && !WARN_ON_ONCE(!buf)) {
int bytes = 0;
int i;
......@@ -266,7 +267,7 @@ static void efx_mcdi_read_response_header(struct efx_nic *efx)
{
struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
unsigned int respseq, respcmd, error;
#ifdef CONFIG_SFC_MCDI_LOGGING
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
char *buf = mcdi->logging_buffer; /* page-sized */
#endif
efx_dword_t hdr;
......@@ -286,7 +287,7 @@ static void efx_mcdi_read_response_header(struct efx_nic *efx)
EFX_DWORD_FIELD(hdr, MC_CMD_V2_EXTN_IN_ACTUAL_LEN);
}
#ifdef CONFIG_SFC_MCDI_LOGGING
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
if (mcdi->logging_enabled && !WARN_ON_ONCE(!buf)) {
size_t hdr_len, data_len;
int bytes = 0;
......@@ -2014,7 +2015,7 @@ int efx_siena_mcdi_wol_filter_reset(struct efx_nic *efx)
return rc;
}
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
#define EFX_MCDI_NVRAM_LEN_MAX 128
......@@ -2256,4 +2257,4 @@ void efx_siena_mcdi_mtd_rename(struct efx_mtd_partition *part)
efx->name, part->type_name, mcdi_part->fw_subtype);
}
#endif /* CONFIG_SFC_MTD */
#endif /* CONFIG_SFC_SIENA_MTD */
......@@ -80,7 +80,7 @@ struct efx_mcdi_iface {
spinlock_t async_lock;
struct list_head async_list;
struct timer_list async_timer;
#ifdef CONFIG_SFC_MCDI_LOGGING
#ifdef CONFIG_SFC_SIENA_MCDI_LOGGING
char *logging_buffer;
bool logging_enabled;
#endif
......@@ -118,7 +118,7 @@ struct efx_mcdi_mtd_partition {
*/
struct efx_mcdi_data {
struct efx_mcdi_iface iface;
#ifdef CONFIG_SFC_MCDI_MON
#ifdef CONFIG_SFC_SIENA_MCDI_MON
struct efx_mcdi_mon hwmon;
#endif
u32 fn_flags;
......@@ -130,7 +130,7 @@ static inline struct efx_mcdi_iface *efx_mcdi(struct efx_nic *efx)
return &efx->mcdi->iface;
}
#ifdef CONFIG_SFC_MCDI_MON
#ifdef CONFIG_SFC_SIENA_MCDI_MON
static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx)
{
EFX_WARN_ON_PARANOID(!efx->mcdi);
......@@ -365,7 +365,7 @@ void efx_siena_mcdi_mac_pull_stats(struct efx_nic *efx);
enum reset_type efx_siena_mcdi_map_reset_reason(enum reset_type reason);
int efx_siena_mcdi_reset(struct efx_nic *efx, enum reset_type method);
#ifdef CONFIG_SFC_MCDI_MON
#ifdef CONFIG_SFC_SIENA_MCDI_MON
int efx_siena_mcdi_mon_probe(struct efx_nic *efx);
void efx_siena_mcdi_mon_remove(struct efx_nic *efx);
#else
......@@ -373,7 +373,7 @@ static inline int efx_siena_mcdi_mon_probe(struct efx_nic *efx) { return 0; }
static inline void efx_siena_mcdi_mon_remove(struct efx_nic *efx) {}
#endif
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
int efx_siena_mcdi_mtd_read(struct mtd_info *mtd, loff_t start, size_t len,
size_t *retlen, u8 *buffer);
int efx_siena_mcdi_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len);
......
......@@ -130,7 +130,7 @@ void efx_siena_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev)
type, name, state_txt, value, unit);
}
#ifdef CONFIG_SFC_MCDI_MON
#ifdef CONFIG_SFC_SIENA_MCDI_MON
struct efx_mcdi_mon_attribute {
struct device_attribute dev_attr;
......@@ -528,4 +528,4 @@ void efx_siena_mcdi_mon_remove(struct efx_nic *efx)
efx_siena_free_buffer(efx, &hwmon->dma_buf);
}
#endif /* CONFIG_SFC_MCDI_MON */
#endif /* CONFIG_SFC_SIENA_MCDI_MON */
......@@ -1031,7 +1031,7 @@ struct efx_nic {
unsigned irq_level;
struct delayed_work selftest_work;
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
struct list_head mtd_list;
#endif
......@@ -1096,7 +1096,7 @@ struct efx_nic {
atomic_t rxq_flush_outstanding;
wait_queue_head_t flush_wq;
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
unsigned vf_count;
unsigned vf_init_count;
unsigned vi_scale;
......@@ -1411,7 +1411,7 @@ struct efx_nic_type {
bool (*filter_rfs_expire_one)(struct efx_nic *efx, u32 flow_id,
unsigned int index);
#endif
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
int (*mtd_probe)(struct efx_nic *efx);
void (*mtd_rename)(struct efx_mtd_partition *part);
int (*mtd_read)(struct mtd_info *mtd, loff_t start, size_t len,
......
......@@ -104,7 +104,7 @@ struct siena_nic_data {
struct efx_nic *efx;
int wol_filter_id;
u64 stats[SIENA_STAT_COUNT];
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
struct siena_vf *vf;
struct efx_channel *vfdi_channel;
unsigned vf_buftbl_base;
......
......@@ -1422,7 +1422,7 @@ static void efx_ptp_worker(struct work_struct *work)
static const struct ptp_clock_info efx_phc_clock_info = {
.owner = THIS_MODULE,
.name = "sfc",
.name = "sfc_siena",
.max_adj = MAX_PPB,
.n_alarm = 0,
.n_ext_ts = 0,
......@@ -1458,7 +1458,7 @@ static int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
skb_queue_head_init(&ptp->rxq);
skb_queue_head_init(&ptp->txq);
ptp->workwq = create_singlethread_workqueue("sfc_ptp");
ptp->workwq = create_singlethread_workqueue("sfc_siena_ptp");
if (!ptp->workwq) {
rc = -ENOMEM;
goto fail2;
......@@ -1502,7 +1502,8 @@ static int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel)
goto fail3;
} else if (ptp->phc_clock) {
INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker);
ptp->pps_workwq = create_singlethread_workqueue("sfc_pps");
ptp->pps_workwq =
create_singlethread_workqueue("sfc_siena_pps");
if (!ptp->pps_workwq) {
rc = -ENOMEM;
goto fail4;
......
......@@ -328,7 +328,7 @@ static int siena_probe_nic(struct efx_nic *efx)
if (rc)
goto fail5;
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
efx_siena_sriov_probe(efx);
#endif
efx_siena_ptp_defer_probe_with_channel(efx);
......@@ -830,7 +830,7 @@ static int siena_mcdi_poll_reboot(struct efx_nic *efx)
**************************************************************************
*/
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
struct siena_nvram_type_info {
int port;
......@@ -954,7 +954,7 @@ static int siena_mtd_probe(struct efx_nic *efx)
return rc;
}
#endif /* CONFIG_SFC_MTD */
#endif /* CONFIG_SFC_SIENA_MTD */
static unsigned int siena_check_caps(const struct efx_nic *efx,
u8 flag, u32 offset)
......@@ -1058,7 +1058,7 @@ const struct efx_nic_type siena_a0_nic_type = {
#ifdef CONFIG_RFS_ACCEL
.filter_rfs_expire_one = efx_farch_filter_rfs_expire_one,
#endif
#ifdef CONFIG_SFC_MTD
#ifdef CONFIG_SFC_SIENA_MTD
.mtd_probe = siena_mtd_probe,
.mtd_rename = efx_siena_mcdi_mtd_rename,
.mtd_read = efx_siena_mcdi_mtd_read,
......@@ -1068,7 +1068,7 @@ const struct efx_nic_type siena_a0_nic_type = {
#endif
.ptp_write_host_time = siena_ptp_write_host_time,
.ptp_set_ts_config = siena_ptp_set_ts_config,
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
.sriov_configure = efx_siena_sriov_configure,
.sriov_init = efx_siena_sriov_init,
.sriov_fini = efx_siena_sriov_fini,
......
......@@ -54,18 +54,21 @@ int efx_siena_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf,
int efx_siena_sriov_get_vf_config(struct efx_nic *efx, int vf,
struct ifla_vf_info *ivf);
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
static inline bool efx_siena_sriov_enabled(struct efx_nic *efx)
{
return efx->vf_init_count != 0;
}
#else /* !CONFIG_SFC_SRIOV */
int efx_init_sriov(void);
void efx_fini_sriov(void);
#else /* !CONFIG_SFC_SIENA_SRIOV */
static inline bool efx_siena_sriov_enabled(struct efx_nic *efx)
{
return false;
}
#endif /* CONFIG_SFC_SRIOV */
#endif /* CONFIG_SFC_SIENA_SRIOV */
void efx_siena_sriov_probe(struct efx_nic *efx);
void efx_siena_sriov_tx_flush_done(struct efx_nic *efx, efx_qword_t *event);
......
......@@ -9,7 +9,7 @@
#include "net_driver.h"
#ifdef CONFIG_SFC_SRIOV
#ifdef CONFIG_SFC_SIENA_SRIOV
static inline
int efx_sriov_set_vf_mac(struct net_device *net_dev, int vf_i, u8 *mac)
......@@ -78,6 +78,6 @@ int efx_sriov_set_vf_link_state(struct net_device *net_dev, int vf_i,
else
return -EOPNOTSUPP;
}
#endif /* CONFIG_SFC_SRIOV */
#endif /* CONFIG_SFC_SIENA_SRIOV */
#endif /* EFX_SRIOV_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment