Skip to content

Commit

Permalink
enic: unmask intr only when napi is complete
Browse files Browse the repository at this point in the history
In case of busy poll, napi_complete_done returns false and does not
dequeue napi. In this case do not unmask the intr. We are guaranteed
napi is called again. This reduces unnecessary iowrites.

Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Govindarajulu Varadarajan authored and David S. Miller committed May 23, 2017
1 parent f93e1cd commit 9acfd1c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/cisco/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,13 +1537,12 @@ static int enic_poll(struct napi_struct *napi, int budget)
*/
enic_calc_int_moderation(enic, &enic->rq[0]);

if (rq_work_done < rq_work_to_do) {
if ((rq_work_done < budget) && napi_complete_done(napi, rq_work_done)) {

/* Some work done, but not enough to stay in polling,
* exit polling
*/

napi_complete_done(napi, rq_work_done);
if (enic->rx_coalesce_setting.use_adaptive_rx_coalesce)
enic_set_int_moderation(enic, &enic->rq[0]);
vnic_intr_unmask(&enic->intr[intr]);
Expand Down Expand Up @@ -1663,13 +1662,12 @@ static int enic_poll_msix_rq(struct napi_struct *napi, int budget)
*/
enic_calc_int_moderation(enic, &enic->rq[rq]);

if (work_done < work_to_do) {
if ((work_done < budget) && napi_complete_done(napi, work_done)) {

/* Some work done, but not enough to stay in polling,
* exit polling
*/

napi_complete_done(napi, work_done);
if (enic->rx_coalesce_setting.use_adaptive_rx_coalesce)
enic_set_int_moderation(enic, &enic->rq[rq]);
vnic_intr_unmask(&enic->intr[intr]);
Expand Down

0 comments on commit 9acfd1c

Please sign in to comment.