Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Jacob Keller <jacob.e.keller@intel.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>
Subject: Re: [PATCH net-next v8 04/10] lib: packing: document recently added APIs
Date: Thu, 5 Dec 2024 01:26:50 +0200	[thread overview]
Message-ID: <20241204232650.67xald6yfbhtz6a4@skbuf> (raw)
In-Reply-To: <20241203-packing-pack-fields-and-ice-implementation-v8-4-2ed68edfe583@intel.com> <20241203-packing-pack-fields-and-ice-implementation-v8-4-2ed68edfe583@intel.com>

On Tue, Dec 03, 2024 at 03:53:50PM -0800, Jacob Keller wrote:
> Extend the documentation for the packing library, covering the intended use
> for the recently added APIs. This includes the pack() and unpack() macros,
> as well as the pack_fields() and unpack_fields() macros.
> 
> Add a note that the packing() API is now deprecated in favor of pack() and
> unpack().
> 
> For the pack_fields() and unpack_fields() APIs, explain the rationale for
> when a driver may want to select this API. Provide an example which shows
> how to define the fields and call the pack_fields() and unpack_fields()
> macros.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  Documentation/core-api/packing.rst | 118 +++++++++++++++++++++++++++++++++++--
>  1 file changed, 113 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/core-api/packing.rst b/Documentation/core-api/packing.rst
> index 821691f23c541cee27995bb1d77e23ff04f82433..30fc2328f789920e27a1bcf3945a6793894ef1d4 100644
> --- a/Documentation/core-api/packing.rst
> +++ b/Documentation/core-api/packing.rst
> @@ -227,11 +227,119 @@ Intended use
>  
>  Drivers that opt to use this API first need to identify which of the above 3
>  quirk combinations (for a total of 8) match what the hardware documentation
> -describes. Then they should wrap the packing() function, creating a new
> -xxx_packing() that calls it using the proper QUIRK_* one-hot bits set.
> +describes.
> +
> +There are 3 supported usage patterns, detailed below.
> +
> +packing()
> +^^^^^^^^^
> +
> +This API function is deprecated.
>  
>  The packing() function returns an int-encoded error code, which protects the
>  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.
> +during runtime, therefore it is reasonable to wrap packing() into a custom
> +function which returns void and simply swallow those errors. Optionally it can

returns (...) and swallows

> +dump stack or print the error description.

  reply	other threads:[~2024-12-04 23:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 23:53 [PATCH net-next v8 00/10] lib: packing: introduce and use (un)pack_fields Jacob Keller
2024-12-03 23:53 ` [PATCH net-next v8 01/10] lib: packing: create __pack() and __unpack() variants without error checking Jacob Keller
2024-12-03 23:53 ` [PATCH net-next v8 02/10] lib: packing: demote truncation error in pack() to a warning in __pack() Jacob Keller
2024-12-03 23:53 ` [PATCH net-next v8 03/10] lib: packing: add pack_fields() and unpack_fields() Jacob Keller
2024-12-04 17:12   ` Vladimir Oltean
2024-12-04 18:47     ` Jacob Keller
2024-12-04 23:24     ` Jacob Keller
2024-12-04 23:52       ` Vladimir Oltean
2024-12-05  0:23         ` Jacob Keller
2024-12-04 23:43     ` Przemek Kitszel
2024-12-05  9:52       ` Vladimir Oltean
2024-12-05 21:26         ` Jacob Keller
2024-12-03 23:53 ` [PATCH net-next v8 04/10] lib: packing: document recently added APIs Jacob Keller
2024-12-04 23:26   ` Vladimir Oltean [this message]
2024-12-04 23:31   ` Vladimir Oltean
2024-12-03 23:53 ` [PATCH net-next v8 05/10] ice: remove int_q_state from ice_tlan_ctx Jacob Keller
2024-12-03 23:53 ` [PATCH net-next v8 06/10] ice: use structures to keep track of queue context size Jacob Keller
2024-12-03 23:53 ` [PATCH net-next v8 07/10] ice: use <linux/packing.h> for Tx and Rx queue context data Jacob Keller
2024-12-03 23:53 ` [PATCH net-next v8 08/10] ice: reduce size of queue context fields Jacob Keller
2024-12-03 23:53 ` [PATCH net-next v8 09/10] ice: move prefetch enable to ice_setup_rx_ctx Jacob Keller
2024-12-03 23:53 ` [PATCH net-next v8 10/10] 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=20241204232650.67xald6yfbhtz6a4@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