From: Vladimir Oltean <olteanv@gmail.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>,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH net-next v7 2/9] lib: packing: demote truncation error in pack() to a warning in __pack()
Date: Tue, 3 Dec 2024 14:43:16 +0200 [thread overview]
Message-ID: <20241203124316.er7w64rdkc4nedno@skbuf> (raw)
In-Reply-To: <20241202-packing-pack-fields-and-ice-implementation-v7-2-ed22e38e6c65@intel.com>
On Mon, Dec 02, 2024 at 04:26:25PM -0800, Jacob Keller wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
>
> Most of the sanity checks in pack() and unpack() can be covered at
> compile time. There is only one exception, and that is truncation of the
> uval during a pack() operation.
>
> We'd like the error-less __pack() to catch that condition as well. But
> at the same time, it is currently the responsibility of consumer drivers
> (currently just sja1105) to print anything at all when this error
> occurs, and then discard the return code.
>
> We can just print a loud warning in the library code and continue with
> the truncated __pack() operation. In practice, having the warning is
> very important, see commit 24deec6b9e4a ("net: dsa: sja1105: disallow
> C45 transactions on the BASE-TX MDIO bus") where the bug was caught
> exactly by noticing this print.
>
> Add the first print to the packing library, and at the same time remove
> the print for the same condition from the sja1105 driver, to avoid
> double printing.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
Somehow this is missing your sign off.
next prev parent reply other threads:[~2024-12-03 12:43 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 [this message]
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
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=20241203124316.er7w64rdkc4nedno@skbuf \
--to=olteanv@gmail.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 \
--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