Skip to content

Commit cc52a5e

Browse files
committed
idpf: fix idpf_vport_splitq_napi_poll()
JIRA: https://issues.redhat.com/browse/RHEL-79685 commit 407e0ef Author: Eric Dumazet <edumazet@google.com> Date: Tue May 20 12:40:30 2025 +0000 idpf: fix idpf_vport_splitq_napi_poll() idpf_vport_splitq_napi_poll() can incorrectly return @Budget after napi_complete_done() has been called. This violates NAPI rules, because after napi_complete_done(), current thread lost napi ownership. Move the test against POLL_MODE before the napi_complete_done(). Fixes: c2d548c ("idpf: add TX splitq napi poll support") Reported-by: Peter Newman <peternewman@google.com> Closes: https://lore.kernel.org/netdev/20250520121908.1805732-1-edumazet@google.com/T/#u Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Joshua Hay <joshua.a.hay@intel.com> Cc: Alan Brady <alan.brady@intel.com> Cc: Madhu Chittim <madhu.chittim@intel.com> Cc: Phani Burra <phani.r.burra@intel.com> Cc: Pavan Kumar Linga <pavan.kumar.linga@intel.com> Link: https://patch.msgid.link/20250520124030.1983936-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
1 parent bba8817 commit cc52a5e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/net/ethernet/intel/idpf/idpf_txrx.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4031,6 +4031,14 @@ static int idpf_vport_splitq_napi_poll(struct napi_struct *napi, int budget)
40314031
return budget;
40324032
}
40334033

4034+
/* Switch to poll mode in the tear-down path after sending disable
4035+
* queues virtchnl message, as the interrupts will be disabled after
4036+
* that.
4037+
*/
4038+
if (unlikely(q_vector->num_txq && idpf_queue_has(POLL_MODE,
4039+
q_vector->tx[0])))
4040+
return budget;
4041+
40344042
work_done = min_t(int, work_done, budget - 1);
40354043

40364044
/* Exit the polling mode, but don't re-enable interrupts if stack might
@@ -4041,15 +4049,7 @@ static int idpf_vport_splitq_napi_poll(struct napi_struct *napi, int budget)
40414049
else
40424050
idpf_vport_intr_set_wb_on_itr(q_vector);
40434051

4044-
/* Switch to poll mode in the tear-down path after sending disable
4045-
* queues virtchnl message, as the interrupts will be disabled after
4046-
* that
4047-
*/
4048-
if (unlikely(q_vector->num_txq && idpf_queue_has(POLL_MODE,
4049-
q_vector->tx[0])))
4050-
return budget;
4051-
else
4052-
return work_done;
4052+
return work_done;
40534053
}
40544054

40554055
/**

0 commit comments

Comments
 (0)