Skip to content

Commit

Permalink
net: cxgb3: simplify logic for rspq_check_napi
Browse files Browse the repository at this point in the history
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.

Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christian Marangi authored and David S. Miller committed Oct 16, 2023
1 parent c49bba0 commit 101c603
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/net/ethernet/chelsio/cxgb3/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit 101c603

Please sign in to comment.