net: cxgb3: simplify logic for rspq_check_napi
Subsystems (3)
PATCH 1/1 net: cxgb3: simplify logic for rspq_check_napi
Simplify logic for rspq_check_napi.
Drop redundant and wrong napi_is_scheduled call as it's not race free and directly use the output of napi_schedule to understand if a napi is pending or not.
rspq_check_napi main logic is to check if is_new_response is true and check if a napi is not scheduled. The result of this function is then used to detect if we are missing some interrupt and act on top of this... With this knowing, we can rework and simplify the logic and make it less problematic with testing an internal bit for napi.
--- drivers/net/ethernet/chelsio/cxgb3/sge.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/ethernet/chelsio/cxgb3/sge.c +1 -6
@@ -2674,12 +2674,7 @@ static int rspq_check_napi(struct sge_qset *qs) {struct sge_rspq *q = &qs->rspq; -if (!napi_is_scheduled (&qs->napi) && -is_new_response (&q->desc[q->cidx], q)) { -napi_schedule (&qs->napi); -return 1 ; - } -return 0 ; +return is_new_response (&q->desc[q->cidx], q) &&napi_schedule (&qs->napi); }/*
Signature · 1 line
2.40.1
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Quoted 5 lines · On Thu, 12 Oct 2023 11:14:29 +0200 you wrote:
Simplify logic for
rspq_check_napi.
Drop redundant and wrongnapi_is_scheduledcall as it's not race free and directly use the output ofnapi_scheduleto understand if a napi is pending or not.
Quoted 7 lines
rspq_check_napimain logic is to check ifis_new_responseis true and check if a napi is not scheduled. The result of this function is then used to detect if we are missing some interrupt and act on top of this... With this knowing, we can rework and simplify the logic and make it less problematic with testing an internal bit for napi.[...]
Here is the summary with links:
- [net-next] net: cxgb3: simplify logic for rspq_check_napi
https://git.kernel.org/netdev/net-next/c/101c6032031f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html