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] [thread-next>] [day] [month] [year] [list]
Message-ID: <680bd25a-8bf1-4af6-b2bb-e5a11daf287d@intel.com>
Date: Wed, 14 Feb 2024 12:50:47 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: Thinh Tran <thinhtr@...ux.vnet.ibm.com>, <kuba@...nel.org>
CC: <netdev@...r.kernel.org>, <davem@...emloft.net>, <manishc@...vell.com>,
	<pabeni@...hat.com>, <skalluru@...vell.com>, <simon.horman@...igine.com>,
	<edumazet@...gle.com>, <VENKATA.SAI.DUGGI@....com>, <drc@...ux.vnet.ibm.com>,
	<abdhalee@...ibm.com>
Subject: Re: [PATCH v10 2/2] net/bnx2x: refactor common code to
 bnx2x_stop_nic()



On 2/13/2024 10:32 AM, Thinh Tran wrote:
> Refactor common code which disables and releases HW interrupts, deletes
> NAPI objects, into a new bnx2x_stop_nic() function.
> 
> Signed-off-by: Thinh Tran <thinhtr@...ux.vnet.ibm.com>
> 

Good cleanup.

Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>

> +void bnx2x_stop_nic(struct bnx2x *bp, int disable_hw)
> +{
> +	if (!bp->nic_stopped) {
> +		/* Disable HW interrupts, NAPI */
> +		bnx2x_netif_stop(bp, disable_hw);
> +		/* Delete all NAPI objects */
> +		bnx2x_del_all_napi(bp);
> +		if (CNIC_LOADED(bp))
> +			bnx2x_del_all_napi_cnic(bp);
> +		/* Release IRQs */
> +		bnx2x_free_irq(bp);
> +		bp->nic_stopped = true;
> +	}
> +}

IMHO this could be an early return:

if (bp->nic_stopped)
    return;

That is a bit of a nitpick and the existing code (by necessity of not
being a function) used this style.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ