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]
Message-ID: <fa366511-e246-4e6c-9e8d-e539802e49ef@intel.com>
Date: Fri, 23 Aug 2024 14:39:36 +0200
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Colin Ian King <colin.i.king@...il.com>
CC: Tony Nguyen <anthony.l.nguyen@...el.com>, Przemek Kitszel
	<przemyslaw.kitszel@...el.com>, "David S . Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, "Paolo
 Abeni" <pabeni@...hat.com>, <intel-wired-lan@...ts.osuosl.org>,
	<netdev@...r.kernel.org>, <kernel-janitors@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH][next] idpf: make read-only arrays
 tx_itr and rx_itr static const

From: Colin Ian King <colin.i.king@...il.com>
Date: Thu, 22 Aug 2024 22:34:10 +0100

> Don't populate the read-only arrays tx_itr and rx_itr on the stack at
> run time, instead make them static const.
> 
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
>  drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> index 70986e12da28..d50e5cab05fc 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> +++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> @@ -3149,8 +3149,8 @@ void idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q)
>  	struct idpf_adapter *adapter = vport->adapter;
>  	struct virtchnl2_create_vport *vport_msg;
>  	struct idpf_vport_config *vport_config;
> -	u16 tx_itr[] = {2, 8, 64, 128, 256};
> -	u16 rx_itr[] = {2, 8, 32, 96, 128};
> +	static const u16 tx_itr[] = {2, 8, 64, 128, 256};
> +	static const u16 rx_itr[] = {2, 8, 32, 96, 128};

Move it to the top of the function to keep the RCT style?

>  	struct idpf_rss_data *rss_data;
>  	u16 idx = vport->idx;

Thanks,
Olek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ