Commit a2bc221b authored by Manish Chopra's avatar Manish Chopra Committed by Jakub Kicinski

netxen_nic: fix MSI/MSI-x interrupts

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: b37eb210 ("netxen_nic: Avoid mixed mode interrupts")
Signed-off-by: default avatarManish Chopra <manishc@marvell.com>
Signed-off-by: default avatarIgor Russkikh <irusskikh@marvell.com>
Link: https://lore.kernel.org/r/20210107101520.6735-1-manishc@marvell.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c49243e8
...@@ -564,11 +564,6 @@ static const struct net_device_ops netxen_netdev_ops = { ...@@ -564,11 +564,6 @@ static const struct net_device_ops netxen_netdev_ops = {
.ndo_set_features = netxen_set_features, .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, static inline void netxen_set_interrupt_mode(struct netxen_adapter *adapter,
u32 mode) u32 mode)
{ {
...@@ -664,7 +659,7 @@ static int netxen_setup_intr(struct netxen_adapter *adapter) ...@@ -664,7 +659,7 @@ static int netxen_setup_intr(struct netxen_adapter *adapter)
netxen_initialize_interrupt_registers(adapter); netxen_initialize_interrupt_registers(adapter);
netxen_set_msix_bit(pdev, 0); netxen_set_msix_bit(pdev, 0);
if (netxen_function_zero(pdev)) { if (adapter->portnum == 0) {
if (!netxen_setup_msi_interrupts(adapter, num_msix)) if (!netxen_setup_msi_interrupts(adapter, num_msix))
netxen_set_interrupt_mode(adapter, NETXEN_MSI_MODE); netxen_set_interrupt_mode(adapter, NETXEN_MSI_MODE);
else else
......
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