From: Rahul Rameshbabu <rrameshbabu@nvidia.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: saeedm@nvidia.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net/mlx5e: simplify condition after napi budget handling change
Date: Tue, 30 May 2023 20:05:32 -0700 [thread overview]
Message-ID: <87sfbd9p4z.fsf@nvidia.com> (raw)
In-Reply-To: <20230531020051.52655-1-kuba@kernel.org> (Jakub Kicinski's message of "Tue, 30 May 2023 19:00:51 -0700")
You might want to clean up
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c as well in the
mlx5e_ptp_napi_poll function as well.
static int mlx5e_ptp_napi_poll(struct napi_struct *napi, int budget)
{
struct mlx5e_ptp *c = container_of(napi, struct mlx5e_ptp, napi);
struct mlx5e_ch_stats *ch_stats = c->stats;
struct mlx5e_rq *rq = &c->rq;
bool busy = false;
int work_done = 0;
int i;
rcu_read_lock();
ch_stats->poll++;
if (test_bit(MLX5E_PTP_STATE_TX, c->state)) {
for (i = 0; i < c->num_tc; i++) {
busy |= mlx5e_poll_tx_cq(&c->ptpsq[i].txqsq.cq, budget);
busy |= mlx5e_ptp_poll_ts_cq(&c->ptpsq[i].ts_cq, budget);
}
}
if (test_bit(MLX5E_PTP_STATE_RX, c->state) && likely(budget)) {
That last conditional would be reduced to the following with this commit.
if (test_bit(MLX5E_PTP_STATE_RX, c->state)) {
On Tue, 30 May, 2023 19:00:51 -0700 Jakub Kicinski <kuba@kernel.org> wrote:
> Since recent commit budget can't be 0 here.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> pw-bot: au
>
> drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
> index fbb2d963fb7e..a7d9b7cb4297 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c
> @@ -207,7 +207,7 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget)
> }
> ch_stats->aff_change++;
> aff_change = true;
> - if (budget && work_done == budget)
> + if (work_done == budget)
> work_done--;
> }
-- Rahul Rameshbabu
next prev parent reply other threads:[~2023-05-31 3:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 2:00 [PATCH net-next] net/mlx5e: simplify condition after napi budget handling change Jakub Kicinski
2023-05-31 3:05 ` Rahul Rameshbabu [this message]
2023-05-31 5:19 ` Jakub Kicinski
2023-05-31 22:04 ` Saeed Mahameed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sfbd9p4z.fsf@nvidia.com \
--to=rrameshbabu@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).