netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 00/10] packing: various improvements and KUnit tests
@ 2024-10-02 21:51 Jacob Keller
  2024-10-02 21:51 ` [PATCH net-next v2 01/10] lib: packing: refuse operating on bit indices which exceed size of buffer Jacob Keller
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Jacob Keller @ 2024-10-02 21:51 UTC (permalink / raw)
  To: Andrew Morton, Vladimir Oltean, David S. Miller
  Cc: netdev, Jacob Keller, Vladimir Oltean, Przemek Kitszel

This series contains a handful of improvements and fixes for the packing
library, including the addition of KUnit tests.

There are two major changes which might be considered bug fixes:

1) The library is updated to handle arbitrary buffer lengths, fixing
   undefined behavior when operating on buffers which are not a multiple of
   4 bytes.

2) The behavior of QUIRK_MSB_ON_THE_RIGHT is fixed to match the intended
   behavior when operating on packings that are not byte aligned.

These are not sent to net because no driver currently depends on this
behavior. For (1), the existing users of the packing API all operate on
buffers which are multiples of 4-bytes. For (2), no driver currently uses
QUIRK_MSB_ON_THE_RIGHT. The incorrect behavior was found while writing
KUnit tests.

This series also includes a handful of minor cleanups from Vladimir, as
well as a change to introduce a separated pack() and unpack() API. This API
is not (yet) used by a driver, but is the first step in implementing
pack_fields() and unpack_fields() which will be used in future changes for
the ice driver and changes Vladimir has in progress for other drivers using
the packing API.

This series is part 1 of a 2-part series for implementing use of
lib/packing in the ice driver. The 2nd part includes a new pack_fields()
and unpack_fields() implementation inspired by the ice driver's existing
bit packing code. It is built on top of the split pack() and unpack()
code. Additionally, the KUnit tests are built on top of pack() and
unpack(), based on original selftests written by Vladimir.

Fitting the entire library changes and drivers changes into a single series
exceeded the usual series limits.

Those interested in seeing the full work along with the ice driver
implementation can find it at:

  https://github.com/jacob-keller/linux/tree/packing/pack-fields-and-ice-implementation

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
Changes in v2:
- Drop the fixes tags, since none of the changes need or want to be
  backported.
- Link to v1: https://lore.kernel.org/r/20240930-packing-kunit-tests-and-split-pack-unpack-v1-0-94b1f04aca85@intel.com

---
Jacob Keller (3):
      lib: packing: add KUnit tests adapted from selftests
      lib: packing: add additional KUnit tests
      lib: packing: fix QUIRK_MSB_ON_THE_RIGHT behavior

Vladimir Oltean (7):
      lib: packing: refuse operating on bit indices which exceed size of buffer
      lib: packing: adjust definitions and implementation for arbitrary buffer lengths
      lib: packing: remove kernel-doc from header file
      lib: packing: add pack() and unpack() wrappers over packing()
      lib: packing: duplicate pack() and unpack() implementations
      lib: packing: use BITS_PER_BYTE instead of 8
      lib: packing: use GENMASK() for box_mask

 include/linux/packing.h            |  32 +--
 lib/packing.c                      | 400 ++++++++++++++++++++++-------------
 lib/packing_test.c                 | 412 +++++++++++++++++++++++++++++++++++++
 Documentation/core-api/packing.rst |  71 +++++++
 MAINTAINERS                        |   1 +
 lib/Kconfig                        |  12 ++
 lib/Makefile                       |   1 +
 7 files changed, 761 insertions(+), 168 deletions(-)
---
base-commit: c824deb1a89755f70156b5cdaf569fca80698719
change-id: 20240930-packing-kunit-tests-and-split-pack-unpack-031d032d584d

Best regards,
-- 
Jacob Keller <jacob.e.keller@intel.com>


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-10-03 23:10 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-02 21:51 [PATCH net-next v2 00/10] packing: various improvements and KUnit tests Jacob Keller
2024-10-02 21:51 ` [PATCH net-next v2 01/10] lib: packing: refuse operating on bit indices which exceed size of buffer Jacob Keller
2024-10-03 15:02   ` Vladimir Oltean
2024-10-02 21:51 ` [PATCH net-next v2 02/10] lib: packing: adjust definitions and implementation for arbitrary buffer lengths Jacob Keller
2024-10-03 15:05   ` Vladimir Oltean
2024-10-02 21:51 ` [PATCH net-next v2 03/10] lib: packing: remove kernel-doc from header file Jacob Keller
2024-10-03 15:05   ` Vladimir Oltean
2024-10-02 21:51 ` [PATCH net-next v2 04/10] lib: packing: add pack() and unpack() wrappers over packing() Jacob Keller
2024-10-03 15:13   ` Vladimir Oltean
2024-10-02 21:51 ` [PATCH net-next v2 05/10] lib: packing: duplicate pack() and unpack() implementations Jacob Keller
2024-10-03 15:11   ` Vladimir Oltean
2024-10-02 21:51 ` [PATCH net-next v2 06/10] lib: packing: add KUnit tests adapted from selftests Jacob Keller
2024-10-03 15:18   ` Vladimir Oltean
2024-10-02 21:51 ` [PATCH net-next v2 07/10] lib: packing: add additional KUnit tests Jacob Keller
2024-10-03 15:21   ` Vladimir Oltean
2024-10-02 21:51 ` [PATCH net-next v2 08/10] lib: packing: fix QUIRK_MSB_ON_THE_RIGHT behavior Jacob Keller
2024-10-03 15:22   ` Vladimir Oltean
2024-10-02 21:51 ` [PATCH net-next v2 09/10] lib: packing: use BITS_PER_BYTE instead of 8 Jacob Keller
2024-10-03 15:23   ` Vladimir Oltean
2024-10-02 21:51 ` [PATCH net-next v2 10/10] lib: packing: use GENMASK() for box_mask Jacob Keller
2024-10-03 23:10 ` [PATCH net-next v2 00/10] packing: various improvements and KUnit tests patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).