Skip to content

Commit a77ed5c

Browse files
azaki1anguy11
authored andcommitted
iavf: use internal state to free traffic IRQs
If the system tries to close the netdev while iavf_reset_task() is running, __LINK_STATE_START will be cleared and netif_running() will return false in iavf_reinit_interrupt_scheme(). This will result in iavf_free_traffic_irqs() not being called and a leak as follows: [7632.489326] remove_proc_entry: removing non-empty directory 'irq/999', leaking at least 'iavf-enp24s0f0v0-TxRx-0' [7632.490214] WARNING: CPU: 0 PID: 10 at fs/proc/generic.c:718 remove_proc_entry+0x19b/0x1b0 is shown when pci_disable_msix() is later called. Fix by using the internal adapter state. The traffic IRQs will always exist if state == __IAVF_RUNNING. Fixes: 5b36e8d ("i40evf: Enable VF to request an alternate queue allocation") Signed-off-by: Ahmed Zaki <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 7c4bced commit a77ed5c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,15 +1929,16 @@ static void iavf_free_rss(struct iavf_adapter *adapter)
19291929
/**
19301930
* iavf_reinit_interrupt_scheme - Reallocate queues and vectors
19311931
* @adapter: board private structure
1932+
* @running: true if adapter->state == __IAVF_RUNNING
19321933
*
19331934
* Returns 0 on success, negative on failure
19341935
**/
1935-
static int iavf_reinit_interrupt_scheme(struct iavf_adapter *adapter)
1936+
static int iavf_reinit_interrupt_scheme(struct iavf_adapter *adapter, bool running)
19361937
{
19371938
struct net_device *netdev = adapter->netdev;
19381939
int err;
19391940

1940-
if (netif_running(netdev))
1941+
if (running)
19411942
iavf_free_traffic_irqs(adapter);
19421943
iavf_free_misc_irq(adapter);
19431944
iavf_reset_interrupt_capability(adapter);
@@ -3053,7 +3054,7 @@ static void iavf_reset_task(struct work_struct *work)
30533054

30543055
if ((adapter->flags & IAVF_FLAG_REINIT_MSIX_NEEDED) ||
30553056
(adapter->flags & IAVF_FLAG_REINIT_ITR_NEEDED)) {
3056-
err = iavf_reinit_interrupt_scheme(adapter);
3057+
err = iavf_reinit_interrupt_scheme(adapter, running);
30573058
if (err)
30583059
goto reset_err;
30593060
}

0 commit comments

Comments
 (0)