Netdev List
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, 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>,
	Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH net-next v7 3/9] lib: packing: add pack_fields() and unpack_fields()
Date: Tue, 3 Dec 2024 09:57:18 -0800	[thread overview]
Message-ID: <4341bd7e-7f32-4096-a14c-f84376625d5d@intel.com> (raw)
In-Reply-To: <20241203133628.lcefexgtwvbgasav@skbuf>



On 12/3/2024 5:36 AM, Vladimir Oltean wrote:
> On Mon, Dec 02, 2024 at 04:26:26PM -0800, Jacob Keller wrote:
>> diff --git a/include/linux/packing.h b/include/linux/packing.h
>> index 5d36dcd06f60420325473dae3a0e9ac37d03da4b..f9bfb20060300e33a455b46d3266ea5083a62102 100644
>> --- a/include/linux/packing.h
>> +++ b/include/linux/packing.h
>> @@ -7,6 +7,7 @@
>>  
>>  #include <linux/types.h>
>>  #include <linux/bitops.h>
>> +#include <linux/packing_types.h>
> 
> I'm unsure of the benefit of splitting the headers in this way, if
> packing_types.h is not going to contain purely auto-generated code and
> is tracked fully by git.
> 

I can put this back into one file. I had kept it split from when we
needed things separated to work with modpost.

I can move it back to a single file.

>> diff --git a/Documentation/core-api/packing.rst b/Documentation/core-api/packing.rst
>> index 821691f23c541cee27995bb1d77e23ff04f82433..5f729a9d4e87b438b67ec6b46626403c8f1655c3 100644
>> --- a/Documentation/core-api/packing.rst
>> +++ b/Documentation/core-api/packing.rst
>> @@ -235,3 +235,61 @@ programmer against incorrect API use.  The errors are not expected to occur
>>  during runtime, therefore it is reasonable for xxx_packing() to return void
>>  and simply swallow those errors. Optionally it can dump stack or print the
>>  error description.
>> +
>> +The pack_fields() and unpack_fields() macros automatically select the
>> +appropriate function at compile time based on the type of the fields array
>> +passed in.
> 
> This paragraph is out of context (select the appropriate function among
> which options? what fields array?).
> 

I'll use your suggested documentation.

> Also, I think this patch could use some de-cluttering by making the
> documentation update separate. We need to document 2 new APIs anyway,
> not just pack_fields() but also pack().
> 

I can split the documentation out.

>> diff --git a/scripts/Makefile b/scripts/Makefile
>> index 6bcda4b9d054021b185488841cd36c6e0fb86d0c..546e8175e1c4c8209e67a7f92f7d1e795a030988 100644
>> --- a/scripts/Makefile
>> +++ b/scripts/Makefile
>> @@ -47,7 +47,7 @@ HOSTCFLAGS_sorttable.o += -DMCOUNT_SORT_ENABLED
>>  endif
>>  
>>  # The following programs are only built on demand
>> -hostprogs += unifdef
>> +hostprogs += unifdef gen_packed_field_checks
> 
> I will let those who have been more vocal in their complaints about
> the compile-time checks comment on whether this approach of running
> gen_packed_field_checks on demand rather than during any build is
> acceptable.
> 

We had a lot of issues with getting the generated file to work properly,
and I even *still* had some minor issues where the files just didn't get
generated properly. If others agree to go back to generating on demand I
can try to resolve all of those.. but I'd prefer to not touch the top
level Kbuild :(

I think the overhead of committing these lines when its no longer 20K+
is acceptable for the simplicity of just having it made on-demand. I
also prefer keeping the script as an actual script you can run vs trying
to embed the script in the header.

  reply	other threads:[~2024-12-03 17:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03  0:26 [PATCH net-next v7 0/9] lib: packing: introduce and use (un)pack_fields Jacob Keller
2024-12-03  0:26 ` [PATCH net-next v7 1/9] lib: packing: create __pack() and __unpack() variants without error checking Jacob Keller
2024-12-03  0:26 ` [PATCH net-next v7 2/9] lib: packing: demote truncation error in pack() to a warning in __pack() Jacob Keller
2024-12-03 12:43   ` Vladimir Oltean
2024-12-03 17:50     ` Jacob Keller
2024-12-03  0:26 ` [PATCH net-next v7 3/9] lib: packing: add pack_fields() and unpack_fields() Jacob Keller
2024-12-03 13:36   ` Vladimir Oltean
2024-12-03 17:57     ` Jacob Keller [this message]
2024-12-03 13:39   ` Vladimir Oltean
2024-12-03 17:57     ` Jacob Keller
2024-12-03  0:26 ` [PATCH net-next v7 4/9] ice: remove int_q_state from ice_tlan_ctx Jacob Keller
2024-12-03  0:26 ` [PATCH net-next v7 5/9] ice: use structures to keep track of queue context size Jacob Keller
2024-12-03  0:26 ` [PATCH net-next v7 6/9] ice: use <linux/packing.h> for Tx and Rx queue context data Jacob Keller
2024-12-03 13:43   ` Vladimir Oltean
2024-12-03 18:01     ` Jacob Keller
2024-12-03  0:26 ` [PATCH net-next v7 7/9] ice: reduce size of queue context fields Jacob Keller
2024-12-03  0:26 ` [PATCH net-next v7 8/9] ice: move prefetch enable to ice_setup_rx_ctx Jacob Keller
2024-12-03  0:26 ` [PATCH net-next v7 9/9] ice: cleanup Rx queue context programming functions Jacob Keller

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=4341bd7e-7f32-4096-a14c-f84376625d5d@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=vladimir.oltean@nxp.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