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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <22226518-bb44-480b-98af-a949c5a3ed84@intel.com>
Date: Tue, 10 Dec 2024 12:10:56 -0800
From: Jacob Keller <jacob.e.keller@...el.com>
To: Vladimir Oltean <vladimir.oltean@....com>
CC: Jakub Kicinski <kuba@...nel.org>, Andrew Morton
	<akpm@...ux-foundation.org>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
	<pabeni@...hat.com>, Tony Nguyen <anthony.l.nguyen@...el.com>, "Przemek
 Kitszel" <przemyslaw.kitszel@...el.com>, Masahiro Yamada
	<masahiroy@...nel.org>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v9 03/10] lib: packing: add pack_fields() and
 unpack_fields()



On 12/10/2024 2:59 AM, Vladimir Oltean wrote:
> On Mon, Dec 09, 2024 at 03:05:54PM -0800, Jacob Keller wrote:
>> On 12/9/2024 2:18 PM, Jakub Kicinski wrote:
>>> On Wed, 04 Dec 2024 17:22:49 -0800 Jacob Keller wrote:
>>>> +/* Small packed field. Use with bit offsets < 256, buffers < 32B and
>>>> + * unpacked structures < 256B.
>>>> + */
>>>> +struct packed_field_s {
>>>> +	GEN_PACKED_FIELD_MEMBERS(u8);
>>>> +};
>>>> +
>>>> +/* Medium packed field. Use with bit offsets < 65536, buffers < 8KB and
>>>> + * unpacked structures < 64KB.
>>>> + */
>>>> +struct packed_field_m {
>>>> +	GEN_PACKED_FIELD_MEMBERS(u16);
>>>> +};
>>>
>>> Random thought - would it be more intuitive to use the same size
>>> suffixes as readX() / writeX()? b = byte, w = u16, l = u32, q = 64? 
>>> If you're immediate reaction isn't "of course!" -- ignore me.
>>
>> Its fine with me, but Vladimir was the one to change them from numbers
>> (packed_field_8 to packed_field_s and packed_field_16 to packed_field_m).
> 
> That was to avoid confusion with the numbers in CHECK_PACKED_FIELDS_8(),
> which meant something completely different (array length).
> 
>> @Vladimir, thoughts on using the byte/word suffixes over "small/medium"?
>>
>> I'll work on preparing v10 with the git ignore fix, but will wait a bit
>> before sending to get feedback here.
> 
> If you both think it is more intuitive to have struct packed_field_b,
> packed_field_w etc, then so be it, it's just a name. I'm not too
> attached to the current scheme either, and I do agree that "small" and
> "medium" have burger connotations :(

I opted to go with "packed_field_u8" and "packed_field_u16" since I
believe that makes it obvious these are different from the length of the
array itself.

I'll have v10 out soon!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ