diff mbox series

[net,1/1] netxen_nic: fix MSI/MSI-x interrupts

Message ID 20210107101520.6735-1-manishc@marvell.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series [net,1/1] netxen_nic: fix MSI/MSI-x interrupts | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers warning 2 maintainers not CCed: davem@davemloft.net rahulv@marvell.com
netdev/source_inline success Was 1 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 19 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Manish Chopra Jan. 7, 2021, 10:15 a.m. UTC
For all PCI functions on the netxen_nic adapter, interrupt
mode (INTx or MSI) configuration is dependent on what has
been configured by the PCI function zero in the shared
interrupt register, as these adapters do not support mixed
mode interrupts among the functions of a given adapter.

Logic for setting MSI/MSI-x interrupt mode in the shared interrupt
register based on PCI function id zero check is not appropriate for
all family of netxen adapters, as for some of the netxen family
adapters PCI function zero is not really meant to be probed/loaded
in the host but rather just act as a management function on the device,
which caused all the other PCI functions on the adapter to always use
legacy interrupt (INTx) mode instead of choosing MSI/MSI-x interrupt mode.

This patch replaces that check with port number so that for all
type of adapters driver attempts for MSI/MSI-x interrupt modes.

Fixes: b37eb210c076 ("netxen_nic: Avoid mixed mode interrupts")
Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Jakub Kicinski Jan. 9, 2021, 9:51 p.m. UTC | #1
On Thu, 7 Jan 2021 02:15:20 -0800 Manish Chopra wrote:
> For all PCI functions on the netxen_nic adapter, interrupt
> mode (INTx or MSI) configuration is dependent on what has
> been configured by the PCI function zero in the shared
> interrupt register, as these adapters do not support mixed
> mode interrupts among the functions of a given adapter.
> 
> Logic for setting MSI/MSI-x interrupt mode in the shared interrupt
> register based on PCI function id zero check is not appropriate for
> all family of netxen adapters, as for some of the netxen family
> adapters PCI function zero is not really meant to be probed/loaded
> in the host but rather just act as a management function on the device,
> which caused all the other PCI functions on the adapter to always use
> legacy interrupt (INTx) mode instead of choosing MSI/MSI-x interrupt mode.
> 
> This patch replaces that check with port number so that for all
> type of adapters driver attempts for MSI/MSI-x interrupt modes.
> 
> Fixes: b37eb210c076 ("netxen_nic: Avoid mixed mode interrupts")
> Signed-off-by: Manish Chopra <manishc@marvell.com>
> Signed-off-by: Igor Russkikh <irusskikh@marvell.com>

Interesting that nobody noticed this for 7 years.

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index f218477..d258e0c 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -564,11 +564,6 @@  static int netxen_set_features(struct net_device *dev,
 	.ndo_set_features = netxen_set_features,
 };
 
-static inline bool netxen_function_zero(struct pci_dev *pdev)
-{
-	return (PCI_FUNC(pdev->devfn) == 0) ? true : false;
-}
-
 static inline void netxen_set_interrupt_mode(struct netxen_adapter *adapter,
 					     u32 mode)
 {
@@ -664,7 +659,7 @@  static int netxen_setup_intr(struct netxen_adapter *adapter)
 	netxen_initialize_interrupt_registers(adapter);
 	netxen_set_msix_bit(pdev, 0);
 
-	if (netxen_function_zero(pdev)) {
+	if (adapter->portnum == 0) {
 		if (!netxen_setup_msi_interrupts(adapter, num_msix))
 			netxen_set_interrupt_mode(adapter, NETXEN_MSI_MODE);
 		else