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>
Subject: Re: [PATCH net-next v7 6/9] ice: use <linux/packing.h> for Tx and Rx queue context data
Date: Tue, 3 Dec 2024 15:43:54 +0200 [thread overview]
Message-ID: <20241203134354.mormzine4gt37xha@skbuf> (raw)
In-Reply-To: <20241202-packing-pack-fields-and-ice-implementation-v7-6-ed22e38e6c65@intel.com> <20241202-packing-pack-fields-and-ice-implementation-v7-6-ed22e38e6c65@intel.com>
On Mon, Dec 02, 2024 at 04:26:29PM -0800, Jacob Keller wrote:
> +/**
> + * ice_pack_rxq_ctx - Pack Rx queue context into a HW buffer
> + * @ctx: the Rx queue context to pack
> + * @buf: the HW buffer to pack into
> + *
> + * Pack the Rx queue context from the CPU-friendly unpacked buffer into its
> + * bit-packed HW layout.
> + */
> +static void ice_pack_rxq_ctx(const struct ice_rlan_ctx *ctx,
> + ice_rxq_ctx_buf_t *buf)
> +{
> + pack_fields(buf, sizeof(*buf), ctx, ice_rlan_ctx_fields,
> + QUIRK_LITTLE_ENDIAN | QUIRK_LSW32_IS_FIRST);
An alternative pack_fields() design would enforce that the pbuf argument
has a sizeof() which reveals the packed buffer size. Pro: one macro
argument less. Con: too intrusive in forcing authors to write code in a
certain way maybe?
> +}
next prev parent reply other threads:[~2024-12-03 13: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
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 [this message]
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=20241203134354.mormzine4gt37xha@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 \
/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