[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241029144257.7bo7zqpyd525dqpb@DEN-DL-M70577>
Date: Tue, 29 Oct 2024 14:42:57 +0000
From: Daniel Machon <daniel.machon@...rochip.com>
To: Jacob Keller <jacob.e.keller@...el.com>
CC: Vladimir Oltean <olteanv@...il.com>, Andrew Morton
<akpm@...ux-foundation.org>, Eric Dumazet <edumazet@...gle.com>, Jakub
Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Tony Nguyen
<anthony.l.nguyen@...el.com>, Przemek Kitszel <przemyslaw.kitszel@...el.com>,
Masahiro Yamada <masahiroy@...nel.org>, <linux-kernel@...r.kernel.org>,
<netdev@...r.kernel.org>, Vladimir Oltean <vladimir.oltean@....com>
Subject: Re: [PATCH net-next v2 5/9] ice: use structures to keep track of
queue context size
> The ice Tx and Rx queue context are currently stored as arrays of bytes
> with defined size (ICE_RXQ_CTX_SZ and ICE_TXQ_CTX_SZ). The packed queue
> context is often passed to other functions as a simple u8 * pointer, which
> does not allow tracking the size. This makes the queue context API easy to
> misuse, as you can pass an arbitrary u8 array or pointer.
>
> Introduce wrapper typedefs which use a __packed structure that has the
> proper fixed size for the Tx and Rx context buffers. This enables the
> compiler to track the size of the value and ensures that passing the wrong
> buffer size will be detected by the compiler.
>
> The existing APIs do not benefit much from this change, however the
> wrapping structures will be used to simplify the arguments of new packing
> functions based on the recently introduced pack_fields API.
>
Reviewed-by: Daniel Machon <daniel.machon@...rochip.com>
Powered by blists - more mailing lists