[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240614.114301.1799707546162462902.fujita.tomonori@gmail.com>
Date: Fri, 14 Jun 2024 11:43:01 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: kuba@...nel.org
Cc: fujita.tomonori@...il.com, 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 Thu, 13 Jun 2024 17:30:38 -0700
Jakub Kicinski <kuba@...nel.org> wrote:
> 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.
Indeed, I'll fix.
Powered by blists - more mailing lists
 
