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: <20240613173038.18b2a1ce@kernel.org>
Date: Thu, 13 Jun 2024 17:30:38 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: FUJITA Tomonori <fujita.tomonori@...il.com>
Cc: netdev@...r.kernel.org, andrew@...n.ch, horms@...nel.org,
 jiri@...nulli.us, pabeni@...hat.com, linux@...linux.org.uk,
 hfdevel@....net, naveenm@...vell.com, jdamato@...tly.com
Subject: Re: [PATCH net-next v10 4/7] net: tn40xx: add basic Tx handling

On Tue, 11 Jun 2024 13:52:14 +0900 FUJITA Tomonori wrote:
> +static void tn40_init_txd_sizes(void)
> +{
> +	int i, lwords;
> +
> +	if (tn40_txd_sizes[0].bytes)
> +		return;
> +
> +	/* 7 - is number of lwords in txd with one phys buffer
> +	 * 3 - is number of lwords used for every additional phys buffer
> +	 */
> +	for (i = 0; i < TN40_MAX_PBL; i++) {
> +		lwords = 7 + (i * 3);
> +		if (lwords & 1)
> +			lwords++;	/* pad it with 1 lword */
> +		tn40_txd_sizes[i].qwords = lwords >> 1;
> +		tn40_txd_sizes[i].bytes = lwords << 2;
> +	}
> +}

Since this initializes global data - you should do it in module init.
Due to this you can't rely on module_pci_driver(), you gotta write
the module init / exit functions by hand.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ