lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 10 Nov 2023 12:36:16 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Ziwei Xiao <ziweixiao@...gle.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH net] gve: Fixes for napi_poll when budget is 0

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ