netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ziwei Xiao <ziweixiao@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH net] gve: Fixes for napi_poll when budget is 0
Date: Fri, 10 Nov 2023 12:36:16 -0800	[thread overview]
Message-ID: <20231110123616.06997341@kernel.org> (raw)
In-Reply-To: <20231109235916.1105860-1-ziweixiao@google.com>

On Thu,  9 Nov 2023 15:59:16 -0800 Ziwei Xiao wrote:
> Fixes: f5cedc84a30d ("gve: Add transmit and receive support")

You need to CC everyone who put their tag on that patch. Use:

./scripts/get_maintainer.pl --git-min-percent 25 0001-your.patch

> diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
> index 276f996f95dc..5a84ccfd3423 100644
> --- a/drivers/net/ethernet/google/gve/gve_main.c
> +++ b/drivers/net/ethernet/google/gve/gve_main.c
> @@ -254,16 +254,16 @@ static int gve_napi_poll(struct napi_struct *napi, int budget)
>  	if (block->tx) {
>  		if (block->tx->q_num < priv->tx_cfg.num_queues)
>  			reschedule |= gve_tx_poll(block, budget);
> -		else
> +		else if (budget)

So here you use it as a bool

>  			reschedule |= gve_xdp_poll(block, budget);
>  	}
>  
> -	if (block->rx) {
> +	if (block->rx && budget > 0) {

here as a signed int

>  		work_done = gve_rx_poll(block, budget);
>  		reschedule |= work_done == budget;
>  	}
>  
> -	if (reschedule)
> +	if (reschedule || budget == 0)

and here you compare to 0

Why is every single condition different :S

Just add a new if, before the block->rx handling which does:

	if (!budget)
		return 0;
-- 
pw-bot: cr
pv-bot: cc

      reply	other threads:[~2023-11-10 20:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 23:59 [PATCH net] gve: Fixes for napi_poll when budget is 0 Ziwei Xiao
2023-11-10 20:36 ` Jakub Kicinski [this message]

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=20231110123616.06997341@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=ziweixiao@google.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).