Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

qlcnic: Fix NAPI poll routine for Tx completion

After d75b1ade567f ("net: less interrupt masking in NAPI")
driver's NAPI poll routine is expected to return
exact budget value if it wants to be re-called.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Fixes: d75b1ade567f ("net: less interrupt masking in NAPI")
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Shahed Shaikh and committed by
David S. Miller
f31ec95f cf180b8a

+24 -3
+24 -3
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
··· 967 967 tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, 968 968 budget); 969 969 work_done = qlcnic_process_rcv_ring(sds_ring, budget); 970 - if ((work_done < budget) && tx_complete) { 970 + 971 + /* Check if we need a repoll */ 972 + if (!tx_complete) 973 + work_done = budget; 974 + 975 + if (work_done < budget) { 971 976 napi_complete(&sds_ring->napi); 972 977 if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) { 973 978 qlcnic_enable_sds_intr(adapter, sds_ring); ··· 997 992 napi_complete(&tx_ring->napi); 998 993 if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) 999 994 qlcnic_enable_tx_intr(adapter, tx_ring); 995 + } else { 996 + /* As qlcnic_process_cmd_ring() returned 0, we need a repoll*/ 997 + work_done = budget; 1000 998 } 1001 999 1002 1000 return work_done; ··· 1958 1950 1959 1951 tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, budget); 1960 1952 work_done = qlcnic_83xx_process_rcv_ring(sds_ring, budget); 1961 - if ((work_done < budget) && tx_complete) { 1953 + 1954 + /* Check if we need a repoll */ 1955 + if (!tx_complete) 1956 + work_done = budget; 1957 + 1958 + if (work_done < budget) { 1962 1959 napi_complete(&sds_ring->napi); 1963 1960 qlcnic_enable_sds_intr(adapter, sds_ring); 1964 1961 } ··· 1986 1973 1987 1974 tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, budget); 1988 1975 work_done = qlcnic_83xx_process_rcv_ring(sds_ring, budget); 1989 - if ((work_done < budget) && tx_complete) { 1976 + 1977 + /* Check if we need a repoll */ 1978 + if (!tx_complete) 1979 + work_done = budget; 1980 + 1981 + if (work_done < budget) { 1990 1982 napi_complete(&sds_ring->napi); 1991 1983 qlcnic_enable_sds_intr(adapter, sds_ring); 1992 1984 } ··· 2013 1995 napi_complete(&tx_ring->napi); 2014 1996 if (test_bit(__QLCNIC_DEV_UP , &adapter->state)) 2015 1997 qlcnic_enable_tx_intr(adapter, tx_ring); 1998 + } else { 1999 + /* need a repoll */ 2000 + work_done = budget; 2016 2001 } 2017 2002 2018 2003 return work_done;