Skip to content

Commit f31ec95

Browse files
Shahed Shaikhdavem330
authored andcommitted
qlcnic: Fix NAPI poll routine for Tx completion
After d75b1ad ("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 <[email protected]> Fixes: d75b1ad ("net: less interrupt masking in NAPI") Signed-off-by: David S. Miller <[email protected]>
1 parent cf180b8 commit f31ec95

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,12 @@ static int qlcnic_poll(struct napi_struct *napi, int budget)
967967
tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring,
968968
budget);
969969
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) {
971976
napi_complete(&sds_ring->napi);
972977
if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
973978
qlcnic_enable_sds_intr(adapter, sds_ring);
@@ -992,6 +997,9 @@ static int qlcnic_tx_poll(struct napi_struct *napi, int budget)
992997
napi_complete(&tx_ring->napi);
993998
if (test_bit(__QLCNIC_DEV_UP, &adapter->state))
994999
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;
9951003
}
9961004

9971005
return work_done;
@@ -1950,7 +1958,12 @@ static int qlcnic_83xx_msix_sriov_vf_poll(struct napi_struct *napi, int budget)
19501958

19511959
tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, budget);
19521960
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) {
19541967
napi_complete(&sds_ring->napi);
19551968
qlcnic_enable_sds_intr(adapter, sds_ring);
19561969
}
@@ -1973,7 +1986,12 @@ static int qlcnic_83xx_poll(struct napi_struct *napi, int budget)
19731986

19741987
tx_complete = qlcnic_process_cmd_ring(adapter, tx_ring, budget);
19751988
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) {
19771995
napi_complete(&sds_ring->napi);
19781996
qlcnic_enable_sds_intr(adapter, sds_ring);
19791997
}
@@ -1995,6 +2013,9 @@ static int qlcnic_83xx_msix_tx_poll(struct napi_struct *napi, int budget)
19952013
napi_complete(&tx_ring->napi);
19962014
if (test_bit(__QLCNIC_DEV_UP , &adapter->state))
19972015
qlcnic_enable_tx_intr(adapter, tx_ring);
2016+
} else {
2017+
/* need a repoll */
2018+
work_done = budget;
19982019
}
19992020

20002021
return work_done;

0 commit comments

Comments
 (0)