From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Masahiro Yamada <masahiroy@kernel.org>,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v9 03/10] lib: packing: add pack_fields() and unpack_fields()
Date: Tue, 10 Dec 2024 12:59:52 +0200 [thread overview]
Message-ID: <20241210105952.xbh7gnoaxseni66q@skbuf> (raw)
In-Reply-To: <89f34386-1d18-423f-a105-228eb3d9c345@intel.com>
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 :(
next prev parent reply other threads:[~2024-12-10 10:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 1:22 [PATCH net-next v9 00/10] lib: packing: introduce and use (un)pack_fields Jacob Keller
2024-12-05 1:22 ` [PATCH net-next v9 01/10] lib: packing: create __pack() and __unpack() variants without error checking Jacob Keller
2024-12-05 1:22 ` [PATCH net-next v9 02/10] lib: packing: demote truncation error in pack() to a warning in __pack() Jacob Keller
2024-12-05 1:22 ` [PATCH net-next v9 03/10] lib: packing: add pack_fields() and unpack_fields() Jacob Keller
2024-12-05 10:15 ` Vladimir Oltean
2024-12-09 22:18 ` Jakub Kicinski
2024-12-09 23:05 ` Jacob Keller
2024-12-10 10:59 ` Vladimir Oltean [this message]
2024-12-10 20:10 ` Jacob Keller
2024-12-05 1:22 ` [PATCH net-next v9 04/10] lib: packing: document recently added APIs Jacob Keller
2024-12-05 1:22 ` [PATCH net-next v9 05/10] ice: remove int_q_state from ice_tlan_ctx Jacob Keller
2024-12-05 1:22 ` [PATCH net-next v9 06/10] ice: use structures to keep track of queue context size Jacob Keller
2024-12-05 1:22 ` [PATCH net-next v9 07/10] ice: use <linux/packing.h> for Tx and Rx queue context data Jacob Keller
2024-12-05 1:22 ` [PATCH net-next v9 08/10] ice: reduce size of queue context fields Jacob Keller
2024-12-05 1:22 ` [PATCH net-next v9 09/10] ice: move prefetch enable to ice_setup_rx_ctx Jacob Keller
2024-12-05 1:22 ` [PATCH net-next v9 10/10] ice: cleanup Rx queue context programming functions Jacob Keller
2024-12-05 10:20 ` [PATCH net-next v9 00/10] lib: packing: introduce and use (un)pack_fields Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241210105952.xbh7gnoaxseni66q@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=akpm@linux-foundation.org \
--cc=anthony.l.nguyen@intel.com \
--cc=edumazet@google.com \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=masahiroy@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox