diff options
author | Shahed Shaikh <shahed.shaikh@qlogic.com> | 2015-02-04 05:41:25 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-05 03:24:08 -0500 |
commit | f31ec95fa19e07a8beebcc0297284f23aa57967e (patch) | |
tree | 3f798f397f854986424f359d5457865998bba66c | |
parent | cf180b8acf2627fdc9ab472ed0dc565803cd388a (diff) |
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>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c index 18e5de72e9b4..4e1f58cf19ce 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | |||
@@ -967,7 +967,12 @@ static int qlcnic_poll(struct napi_struct *napi, int budget) | |||
967 | tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, | 967 | tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, |
968 | budget); | 968 | budget); |
969 | work_done = qlcnic_process_rcv_ring(sds_ring, budget); | 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 | napi_complete(&sds_ring->napi); | 976 | napi_complete(&sds_ring->napi); |
972 | if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) { | 977 | if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) { |
973 | qlcnic_enable_sds_intr(adapter, sds_ring); | 978 | qlcnic_enable_sds_intr(adapter, sds_ring); |
@@ -992,6 +997,9 @@ static int qlcnic_tx_poll(struct napi_struct *napi, int budget) | |||
992 | napi_complete(&tx_ring->napi); | 997 | napi_complete(&tx_ring->napi); |
993 | if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) | 998 | if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) |
994 | qlcnic_enable_tx_intr(adapter, tx_ring); | 999 | qlcnic_enable_tx_intr(adapter, tx_ring); |
1000 | } else { | ||
1001 | /* As qlcnic_process_cmd_ring() returned 0, we need a repoll*/ | ||
1002 | work_done = budget; | ||
995 | } | 1003 | } |
996 | 1004 | ||
997 | return work_done; | 1005 | return work_done; |
@@ -1950,7 +1958,12 @@ static int qlcnic_83xx_msix_sriov_vf_poll(struct napi_struct *napi, int budget) | |||
1950 | 1958 | ||
1951 | tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, budget); | 1959 | tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, budget); |
1952 | work_done = qlcnic_83xx_process_rcv_ring(sds_ring, budget); | 1960 | work_done = qlcnic_83xx_process_rcv_ring(sds_ring, budget); |
1953 | if ((work_done < budget) && tx_complete) { | 1961 | |
1962 | /* Check if we need a repoll */ | ||
1963 | if (!tx_complete) | ||
1964 | work_done = budget; | ||
1965 | |||
1966 | if (work_done < budget) { | ||
1954 | napi_complete(&sds_ring->napi); | 1967 | napi_complete(&sds_ring->napi); |
1955 | qlcnic_enable_sds_intr(adapter, sds_ring); | 1968 | qlcnic_enable_sds_intr(adapter, sds_ring); |
1956 | } | 1969 | } |
@@ -1973,7 +1986,12 @@ static int qlcnic_83xx_poll(struct napi_struct *napi, int budget) | |||
1973 | 1986 | ||
1974 | tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, budget); | 1987 | tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, budget); |
1975 | work_done = qlcnic_83xx_process_rcv_ring(sds_ring, budget); | 1988 | work_done = qlcnic_83xx_process_rcv_ring(sds_ring, budget); |
1976 | if ((work_done < budget) && tx_complete) { | 1989 | |
1990 | /* Check if we need a repoll */ | ||
1991 | if (!tx_complete) | ||
1992 | work_done = budget; | ||
1993 | |||
1994 | if (work_done < budget) { | ||
1977 | napi_complete(&sds_ring->napi); | 1995 | napi_complete(&sds_ring->napi); |
1978 | qlcnic_enable_sds_intr(adapter, sds_ring); | 1996 | qlcnic_enable_sds_intr(adapter, sds_ring); |
1979 | } | 1997 | } |
@@ -1995,6 +2013,9 @@ static int qlcnic_83xx_msix_tx_poll(struct napi_struct *napi, int budget) | |||
1995 | napi_complete(&tx_ring->napi); | 2013 | napi_complete(&tx_ring->napi); |
1996 | if (test_bit(__QLCNIC_DEV_UP , &adapter->state)) | 2014 | if (test_bit(__QLCNIC_DEV_UP , &adapter->state)) |
1997 | qlcnic_enable_tx_intr(adapter, tx_ring); | 2015 | qlcnic_enable_tx_intr(adapter, tx_ring); |
2016 | } else { | ||
2017 | /* need a repoll */ | ||
2018 | work_done = budget; | ||
1998 | } | 2019 | } |
1999 | 2020 | ||
2000 | return work_done; | 2021 | return work_done; |