From patchwork Wed May 11 16:19:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Habets X-Patchwork-Id: 12846415 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3BDCC433F5 for ; Wed, 11 May 2022 16:19:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344550AbiEKQTa (ORCPT ); Wed, 11 May 2022 12:19:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234281AbiEKQT1 (ORCPT ); Wed, 11 May 2022 12:19:27 -0400 Received: from mint-fitpc2.mph.net (unknown [81.168.73.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1068558385 for ; Wed, 11 May 2022 09:19:25 -0700 (PDT) Received: from palantir17.mph.net (unknown [192.168.0.4]) by mint-fitpc2.mph.net (Postfix) with ESMTP id 0D8F53200F2; Wed, 11 May 2022 17:19:25 +0100 (BST) Received: from localhost ([::1] helo=palantir17.mph.net) by palantir17.mph.net with esmtp (Exim 4.89) (envelope-from ) id 1nop3c-0000Cd-QQ; Wed, 11 May 2022 17:19:24 +0100 Subject: [PATCH net-next 1/6] siena: Make MTD support specific for Siena From: Martin Habets To: kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, ecree.xilinx@gmail.com Date: Wed, 11 May 2022 17:19:24 +0100 Message-ID: <165228596467.696.7070610538839753629.stgit@palantir17.mph.net> In-Reply-To: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> References: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add a Siena Kconfig option and use it in stead of the sfc one. Signed-off-by: Martin Habets --- drivers/net/ethernet/sfc/siena/Kconfig | 8 ++++++++ drivers/net/ethernet/sfc/siena/Makefile | 4 ++-- drivers/net/ethernet/sfc/siena/efx.h | 2 +- drivers/net/ethernet/sfc/siena/efx_common.c | 2 +- drivers/net/ethernet/sfc/siena/mcdi.c | 4 ++-- drivers/net/ethernet/sfc/siena/mcdi.h | 2 +- drivers/net/ethernet/sfc/siena/net_driver.h | 4 ++-- drivers/net/ethernet/sfc/siena/siena.c | 6 +++--- 8 files changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/sfc/Kconfig b/drivers/net/ethernet/sfc/Kconfig index 98db551ba2b7..79b8ccaeee01 100644 --- a/drivers/net/ethernet/sfc/Kconfig +++ b/drivers/net/ethernet/sfc/Kconfig @@ -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 diff --git a/drivers/net/ethernet/sfc/siena/Kconfig b/drivers/net/ethernet/sfc/siena/Kconfig index 3d52aee50d5a..805b902f903d 100644 --- a/drivers/net/ethernet/sfc/siena/Kconfig +++ b/drivers/net/ethernet/sfc/siena/Kconfig @@ -10,3 +10,11 @@ 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. diff --git a/drivers/net/ethernet/sfc/siena/Makefile b/drivers/net/ethernet/sfc/siena/Makefile index 74cb8b7d281e..3729095a51d9 100644 --- a/drivers/net/ethernet/sfc/siena/Makefile +++ b/drivers/net/ethernet/sfc/siena/Makefile @@ -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_SRIOV) += siena_sriov.o obj-$(CONFIG_SFC_SIENA) += sfc-siena.o diff --git a/drivers/net/ethernet/sfc/siena/efx.h b/drivers/net/ethernet/sfc/siena/efx.h index f91f3c94a275..1d9755e59d75 100644 --- a/drivers/net/ethernet/sfc/siena/efx.h +++ b/drivers/net/ethernet/sfc/siena/efx.h @@ -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) diff --git a/drivers/net/ethernet/sfc/siena/efx_common.c b/drivers/net/ethernet/sfc/siena/efx_common.c index b44a7114e319..7c400fd590f5 100644 --- a/drivers/net/ethernet/sfc/siena/efx_common.c +++ b/drivers/net/ethernet/sfc/siena/efx_common.c @@ -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); diff --git a/drivers/net/ethernet/sfc/siena/mcdi.c b/drivers/net/ethernet/sfc/siena/mcdi.c index eb13aa59fe50..b767e29cfe92 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi.c +++ b/drivers/net/ethernet/sfc/siena/mcdi.c @@ -2014,7 +2014,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 +2256,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 */ diff --git a/drivers/net/ethernet/sfc/siena/mcdi.h b/drivers/net/ethernet/sfc/siena/mcdi.h index dcebdbf956ce..64990f398e67 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi.h +++ b/drivers/net/ethernet/sfc/siena/mcdi.h @@ -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); diff --git a/drivers/net/ethernet/sfc/siena/net_driver.h b/drivers/net/ethernet/sfc/siena/net_driver.h index 7e0659be4348..6af172fb0b10 100644 --- a/drivers/net/ethernet/sfc/siena/net_driver.h +++ b/drivers/net/ethernet/sfc/siena/net_driver.h @@ -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 @@ -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, diff --git a/drivers/net/ethernet/sfc/siena/siena.c b/drivers/net/ethernet/sfc/siena/siena.c index 741313aff1d1..9fe8ffc3a8d3 100644 --- a/drivers/net/ethernet/sfc/siena/siena.c +++ b/drivers/net/ethernet/sfc/siena/siena.c @@ -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, From patchwork Wed May 11 16:19:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Habets X-Patchwork-Id: 12846416 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 806F5C433F5 for ; Wed, 11 May 2022 16:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344583AbiEKQTl (ORCPT ); Wed, 11 May 2022 12:19:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344581AbiEKQTk (ORCPT ); Wed, 11 May 2022 12:19:40 -0400 Received: from mint-fitpc2.mph.net (unknown [81.168.73.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F06A1ACF9A for ; Wed, 11 May 2022 09:19:38 -0700 (PDT) Received: from palantir17.mph.net (unknown [192.168.0.4]) by mint-fitpc2.mph.net (Postfix) with ESMTP id 443423200F2; Wed, 11 May 2022 17:19:37 +0100 (BST) Received: from localhost ([::1] helo=palantir17.mph.net) by palantir17.mph.net with esmtp (Exim 4.89) (envelope-from ) id 1nop3p-0000Ct-1P; Wed, 11 May 2022 17:19:37 +0100 Subject: [PATCH net-next 2/6] siena: Make SRIOV support specific for Siena From: Martin Habets To: kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, ecree.xilinx@gmail.com Date: Wed, 11 May 2022 17:19:36 +0100 Message-ID: <165228597689.696.16795585611235554188.stgit@palantir17.mph.net> In-Reply-To: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> References: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add a Siena Kconfig option and use it in stead of the sfc one. Signed-off-by: Martin Habets --- drivers/net/ethernet/sfc/siena/Kconfig | 8 ++++++++ drivers/net/ethernet/sfc/siena/Makefile | 2 +- drivers/net/ethernet/sfc/siena/efx.c | 12 ++++++------ drivers/net/ethernet/sfc/siena/efx.h | 2 +- drivers/net/ethernet/sfc/siena/efx_channels.c | 4 ++-- drivers/net/ethernet/sfc/siena/efx_common.c | 2 +- drivers/net/ethernet/sfc/siena/farch.c | 18 +++++++++--------- drivers/net/ethernet/sfc/siena/net_driver.h | 2 +- drivers/net/ethernet/sfc/siena/nic.h | 2 +- drivers/net/ethernet/sfc/siena/siena.c | 4 ++-- drivers/net/ethernet/sfc/siena/siena_sriov.h | 6 +++--- drivers/net/ethernet/sfc/siena/sriov.h | 4 ++-- 12 files changed, 37 insertions(+), 29 deletions(-) diff --git a/drivers/net/ethernet/sfc/Kconfig b/drivers/net/ethernet/sfc/Kconfig index 79b8ccaeee01..4c85b26279c5 100644 --- a/drivers/net/ethernet/sfc/Kconfig +++ b/drivers/net/ethernet/sfc/Kconfig @@ -47,7 +47,7 @@ config SFC_MCDI_MON 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 diff --git a/drivers/net/ethernet/sfc/siena/Kconfig b/drivers/net/ethernet/sfc/siena/Kconfig index 805b902f903d..26a8cb838d47 100644 --- a/drivers/net/ethernet/sfc/siena/Kconfig +++ b/drivers/net/ethernet/sfc/siena/Kconfig @@ -18,3 +18,11 @@ config SFC_SIENA_MTD 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_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. diff --git a/drivers/net/ethernet/sfc/siena/Makefile b/drivers/net/ethernet/sfc/siena/Makefile index 3729095a51d9..f7384299667c 100644 --- a/drivers/net/ethernet/sfc/siena/Makefile +++ b/drivers/net/ethernet/sfc/siena/Makefile @@ -6,6 +6,6 @@ sfc-siena-y += farch.o siena.o \ mcdi.o mcdi_port.o mcdi_port_common.o \ mcdi_mon.o sfc-siena-$(CONFIG_SFC_SIENA_MTD) += mtd.o -sfc-siena-$(CONFIG_SFC_SRIOV) += siena_sriov.o +sfc-siena-$(CONFIG_SFC_SIENA_SRIOV) += siena_sriov.o obj-$(CONFIG_SFC_SIENA) += sfc-siena.o diff --git a/drivers/net/ethernet/sfc/siena/efx.c b/drivers/net/ethernet/sfc/siena/efx.c index 3f6e732f5fdc..01809666a3d1 100644 --- a/drivers/net/ethernet/sfc/siena/efx.c +++ b/drivers/net/ethernet/sfc/siena/efx.c @@ -359,7 +359,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 +383,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 +402,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 +592,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 +1108,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 +1250,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 }; diff --git a/drivers/net/ethernet/sfc/siena/efx.h b/drivers/net/ethernet/sfc/siena/efx.h index 1d9755e59d75..27d1d3f19cae 100644 --- a/drivers/net/ethernet/sfc/siena/efx.h +++ b/drivers/net/ethernet/sfc/siena/efx.h @@ -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; diff --git a/drivers/net/ethernet/sfc/siena/efx_channels.c b/drivers/net/ethernet/sfc/siena/efx_channels.c index 276cd7d88732..28391875de69 100644 --- a/drivers/net/ethernet/sfc/siena/efx_channels.c +++ b/drivers/net/ethernet/sfc/siena/efx_channels.c @@ -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)) ? diff --git a/drivers/net/ethernet/sfc/siena/efx_common.c b/drivers/net/ethernet/sfc/siena/efx_common.c index 7c400fd590f5..3aef8d216f95 100644 --- a/drivers/net/ethernet/sfc/siena/efx_common.c +++ b/drivers/net/ethernet/sfc/siena/efx_common.c @@ -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, diff --git a/drivers/net/ethernet/sfc/siena/farch.c b/drivers/net/ethernet/sfc/siena/farch.c index a24ba23fd19f..cce23803c652 100644 --- a/drivers/net/ethernet/sfc/siena/farch.c +++ b/drivers/net/ethernet/sfc/siena/farch.c @@ -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. diff --git a/drivers/net/ethernet/sfc/siena/net_driver.h b/drivers/net/ethernet/sfc/siena/net_driver.h index 6af172fb0b10..a8f6c3699c8b 100644 --- a/drivers/net/ethernet/sfc/siena/net_driver.h +++ b/drivers/net/ethernet/sfc/siena/net_driver.h @@ -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; diff --git a/drivers/net/ethernet/sfc/siena/nic.h b/drivers/net/ethernet/sfc/siena/nic.h index 935cb0ab5ec0..6def31070edb 100644 --- a/drivers/net/ethernet/sfc/siena/nic.h +++ b/drivers/net/ethernet/sfc/siena/nic.h @@ -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; diff --git a/drivers/net/ethernet/sfc/siena/siena.c b/drivers/net/ethernet/sfc/siena/siena.c index 9fe8ffc3a8d3..a44c8fa25748 100644 --- a/drivers/net/ethernet/sfc/siena/siena.c +++ b/drivers/net/ethernet/sfc/siena/siena.c @@ -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); @@ -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, diff --git a/drivers/net/ethernet/sfc/siena/siena_sriov.h b/drivers/net/ethernet/sfc/siena/siena_sriov.h index e548c4daf189..69a7a18e9ba0 100644 --- a/drivers/net/ethernet/sfc/siena/siena_sriov.h +++ b/drivers/net/ethernet/sfc/siena/siena_sriov.h @@ -54,18 +54,18 @@ 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 */ +#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); diff --git a/drivers/net/ethernet/sfc/siena/sriov.h b/drivers/net/ethernet/sfc/siena/sriov.h index fbde67319d87..a6981bad7621 100644 --- a/drivers/net/ethernet/sfc/siena/sriov.h +++ b/drivers/net/ethernet/sfc/siena/sriov.h @@ -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 */ From patchwork Wed May 11 16:19:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Habets X-Patchwork-Id: 12846417 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 142DBC433F5 for ; Wed, 11 May 2022 16:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344581AbiEKQTy (ORCPT ); Wed, 11 May 2022 12:19:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344627AbiEKQTw (ORCPT ); Wed, 11 May 2022 12:19:52 -0400 Received: from mint-fitpc2.mph.net (unknown [81.168.73.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 35C23237BA4 for ; Wed, 11 May 2022 09:19:50 -0700 (PDT) Received: from palantir17.mph.net (unknown [192.168.0.4]) by mint-fitpc2.mph.net (Postfix) with ESMTP id 77DE93200F2; Wed, 11 May 2022 17:19:49 +0100 (BST) Received: from localhost ([::1] helo=palantir17.mph.net) by palantir17.mph.net with esmtp (Exim 4.89) (envelope-from ) id 1nop41-0000D9-8r; Wed, 11 May 2022 17:19:49 +0100 Subject: [PATCH net-next 3/6] siena: Make HWMON support specific for Siena From: Martin Habets To: kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, ecree.xilinx@gmail.com Date: Wed, 11 May 2022 17:19:49 +0100 Message-ID: <165228598913.696.2878212343054461064.stgit@palantir17.mph.net> In-Reply-To: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> References: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add a Siena Kconfig option and use it in stead of the sfc one. Signed-off-by: Martin Habets --- drivers/net/ethernet/sfc/siena/Kconfig | 7 +++++++ drivers/net/ethernet/sfc/siena/mcdi.h | 6 +++--- drivers/net/ethernet/sfc/siena/mcdi_mon.c | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/sfc/Kconfig b/drivers/net/ethernet/sfc/Kconfig index 4c85b26279c5..dac2f09702aa 100644 --- a/drivers/net/ethernet/sfc/Kconfig +++ b/drivers/net/ethernet/sfc/Kconfig @@ -40,7 +40,7 @@ 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 diff --git a/drivers/net/ethernet/sfc/siena/Kconfig b/drivers/net/ethernet/sfc/siena/Kconfig index 26a8cb838d47..4eb6801ff3c0 100644 --- a/drivers/net/ethernet/sfc/siena/Kconfig +++ b/drivers/net/ethernet/sfc/siena/Kconfig @@ -18,6 +18,13 @@ config SFC_SIENA_MTD 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 diff --git a/drivers/net/ethernet/sfc/siena/mcdi.h b/drivers/net/ethernet/sfc/siena/mcdi.h index 64990f398e67..03810c570a33 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi.h +++ b/drivers/net/ethernet/sfc/siena/mcdi.h @@ -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 diff --git a/drivers/net/ethernet/sfc/siena/mcdi_mon.c b/drivers/net/ethernet/sfc/siena/mcdi_mon.c index d0c25dfda0d7..c7ea703c5d7a 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi_mon.c +++ b/drivers/net/ethernet/sfc/siena/mcdi_mon.c @@ -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 */ From patchwork Wed May 11 16:20:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Habets X-Patchwork-Id: 12846418 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4623CC433F5 for ; Wed, 11 May 2022 16:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344627AbiEKQUF (ORCPT ); Wed, 11 May 2022 12:20:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344628AbiEKQUE (ORCPT ); Wed, 11 May 2022 12:20:04 -0400 Received: from mint-fitpc2.mph.net (unknown [81.168.73.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 14B302380C0 for ; Wed, 11 May 2022 09:20:02 -0700 (PDT) Received: from palantir17.mph.net (unknown [192.168.0.4]) by mint-fitpc2.mph.net (Postfix) with ESMTP id B46923200F2; Wed, 11 May 2022 17:20:01 +0100 (BST) Received: from localhost ([::1] helo=palantir17.mph.net) by palantir17.mph.net with esmtp (Exim 4.89) (envelope-from ) id 1nop4D-0000DO-GD; Wed, 11 May 2022 17:20:01 +0100 Subject: [PATCH net-next 4/6] sfc/siena: Make MCDI logging support specific for Siena From: Martin Habets To: kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, ecree.xilinx@gmail.com Date: Wed, 11 May 2022 17:20:01 +0100 Message-ID: <165228600135.696.1243231411252975277.stgit@palantir17.mph.net> In-Reply-To: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> References: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add a Siena Kconfig option and use it in stead of the sfc one. Rename the internal variable for the 'mcdi_logging_default' module parameter to avoid a naming conflict with the one in sfc.ko. Signed-off-by: Martin Habets --- drivers/net/ethernet/sfc/siena/Kconfig | 10 ++++++++++ drivers/net/ethernet/sfc/siena/efx_common.c | 2 +- drivers/net/ethernet/sfc/siena/efx_common.h | 2 +- drivers/net/ethernet/sfc/siena/mcdi.c | 23 ++++++++++++----------- drivers/net/ethernet/sfc/siena/mcdi.h | 2 +- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/sfc/Kconfig b/drivers/net/ethernet/sfc/Kconfig index dac2f09702aa..0950e6b0508f 100644 --- a/drivers/net/ethernet/sfc/Kconfig +++ b/drivers/net/ethernet/sfc/Kconfig @@ -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 diff --git a/drivers/net/ethernet/sfc/siena/Kconfig b/drivers/net/ethernet/sfc/siena/Kconfig index 4eb6801ff3c0..cb3c5cb42a53 100644 --- a/drivers/net/ethernet/sfc/siena/Kconfig +++ b/drivers/net/ethernet/sfc/siena/Kconfig @@ -33,3 +33,13 @@ config SFC_SIENA_SRIOV 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. diff --git a/drivers/net/ethernet/sfc/siena/efx_common.c b/drivers/net/ethernet/sfc/siena/efx_common.c index 3aef8d216f95..a615bffcbad4 100644 --- a/drivers/net/ethernet/sfc/siena/efx_common.c +++ b/drivers/net/ethernet/sfc/siena/efx_common.c @@ -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) diff --git a/drivers/net/ethernet/sfc/siena/efx_common.h b/drivers/net/ethernet/sfc/siena/efx_common.h index 470033611436..aeb92f4e34b7 100644 --- a/drivers/net/ethernet/sfc/siena/efx_common.h +++ b/drivers/net/ethernet/sfc/siena/efx_common.h @@ -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 diff --git a/drivers/net/ethernet/sfc/siena/mcdi.c b/drivers/net/ethernet/sfc/siena/mcdi.c index b767e29cfe92..3df0f0eca3b7 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi.c +++ b/drivers/net/ethernet/sfc/siena/mcdi.c @@ -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; diff --git a/drivers/net/ethernet/sfc/siena/mcdi.h b/drivers/net/ethernet/sfc/siena/mcdi.h index 03810c570a33..06f38e5e6832 100644 --- a/drivers/net/ethernet/sfc/siena/mcdi.h +++ b/drivers/net/ethernet/sfc/siena/mcdi.h @@ -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 From patchwork Wed May 11 16:20:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Habets X-Patchwork-Id: 12846419 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E40E4C433F5 for ; Wed, 11 May 2022 16:20:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344631AbiEKQUQ (ORCPT ); Wed, 11 May 2022 12:20:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344628AbiEKQUP (ORCPT ); Wed, 11 May 2022 12:20:15 -0400 Received: from mint-fitpc2.mph.net (unknown [81.168.73.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9BDA6237240 for ; Wed, 11 May 2022 09:20:14 -0700 (PDT) Received: from palantir17.mph.net (unknown [192.168.0.4]) by mint-fitpc2.mph.net (Postfix) with ESMTP id E46183200F2; Wed, 11 May 2022 17:20:13 +0100 (BST) Received: from localhost ([::1] helo=palantir17.mph.net) by palantir17.mph.net with esmtp (Exim 4.89) (envelope-from ) id 1nop4P-0000Dd-NJ; Wed, 11 May 2022 17:20:13 +0100 Subject: [PATCH net-next 5/6] sfc/siena: Make PTP and reset support specific for Siena From: Martin Habets To: kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, ecree.xilinx@gmail.com Date: Wed, 11 May 2022 17:20:13 +0100 Message-ID: <165228601357.696.10361036152437614572.stgit@palantir17.mph.net> In-Reply-To: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> References: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Change the clock name and work queue names to differentiate them from the names used in sfc.ko. Signed-off-by: Martin Habets --- drivers/net/ethernet/sfc/siena/efx_common.c | 2 +- drivers/net/ethernet/sfc/siena/ptp.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/sfc/siena/efx_common.c b/drivers/net/ethernet/sfc/siena/efx_common.c index a615bffcbad4..954daf464abb 100644 --- a/drivers/net/ethernet/sfc/siena/efx_common.c +++ b/drivers/net/ethernet/sfc/siena/efx_common.c @@ -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; diff --git a/drivers/net/ethernet/sfc/siena/ptp.c b/drivers/net/ethernet/sfc/siena/ptp.c index 8e18da096595..7c46752e6eae 100644 --- a/drivers/net/ethernet/sfc/siena/ptp.c +++ b/drivers/net/ethernet/sfc/siena/ptp.c @@ -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; From patchwork Wed May 11 16:20:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Habets X-Patchwork-Id: 12846420 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CBC1C433F5 for ; Wed, 11 May 2022 16:20:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344700AbiEKQUg (ORCPT ); Wed, 11 May 2022 12:20:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344662AbiEKQU2 (ORCPT ); Wed, 11 May 2022 12:20:28 -0400 Received: from mint-fitpc2.mph.net (unknown [81.168.73.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DBAEA237B8D for ; Wed, 11 May 2022 09:20:26 -0700 (PDT) Received: from palantir17.mph.net (unknown [192.168.0.4]) by mint-fitpc2.mph.net (Postfix) with ESMTP id 265393200F2; Wed, 11 May 2022 17:20:26 +0100 (BST) Received: from localhost ([::1] helo=palantir17.mph.net) by palantir17.mph.net with esmtp (Exim 4.89) (envelope-from ) id 1nop4b-0000Ds-UA; Wed, 11 May 2022 17:20:25 +0100 Subject: [PATCH net-next 6/6] sfc/siena: Reinstate SRIOV init/fini function calls From: Martin Habets To: kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, davem@davemloft.net Cc: netdev@vger.kernel.org, ecree.xilinx@gmail.com Date: Wed, 11 May 2022 17:20:25 +0100 Message-ID: <165228602579.696.13026076797222373028.stgit@palantir17.mph.net> In-Reply-To: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> References: <165228589518.696.7119477411428288875.stgit@palantir17.mph.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org They were removed in the first series since they were not used for EF10. Put that code back for Siena, with the prototypes in siena_sriov.h since that file is a more applicable place for it. Reported-by: kernel test robot Signed-off-by: Martin Habets --- drivers/net/ethernet/sfc/siena/efx.c | 16 ++++++++++++++++ drivers/net/ethernet/sfc/siena/siena_sriov.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/drivers/net/ethernet/sfc/siena/efx.c b/drivers/net/ethernet/sfc/siena/efx.c index 01809666a3d1..63d999e63960 100644 --- a/drivers/net/ethernet/sfc/siena/efx.c +++ b/drivers/net/ethernet/sfc/siena/efx.c @@ -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" @@ -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); } diff --git a/drivers/net/ethernet/sfc/siena/siena_sriov.h b/drivers/net/ethernet/sfc/siena/siena_sriov.h index 69a7a18e9ba0..50f6e924495e 100644 --- a/drivers/net/ethernet/sfc/siena/siena_sriov.h +++ b/drivers/net/ethernet/sfc/siena/siena_sriov.h @@ -60,6 +60,9 @@ static inline bool efx_siena_sriov_enabled(struct efx_nic *efx) { return efx->vf_init_count != 0; } + +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) {