lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHS8izN0nXPxpNDB=b=3dLMuf5KjGq_AswHsJ-XQDhMi7Y3WYQ@mail.gmail.com>
Date: Mon, 27 Oct 2025 17:32:12 -0700
From: Mina Almasry <almasrymina@...gle.com>
To: Bobby Eshleman <bobbyeshleman@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, 
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Byungchul Park <byungchul@...com>, Stanislav Fomichev <sdf@...ichev.me>, 
	Bobby Eshleman <bobbyeshleman@...a.com>
Subject: Re: [PATCH net-next] net: netmem: remove NET_IOV_MAX from
 net_iov_type enum

On Fri, Oct 24, 2025 at 11:03 AM Bobby Eshleman <bobbyeshleman@...il.com> wrote:
>
> From: Bobby Eshleman <bobbyeshleman@...a.com>
>
> Remove the NET_IOV_MAX workaround from the net_iov_type enum. This entry
> was previously added to force the enum size to unsigned long to satisfy
> the NET_IOV_ASSERT_OFFSET static assertions.
>
> After commit f3d85c9ee510 ("netmem: introduce struct netmem_desc
> mirroring struct page") this approach became unnecessary by placing the
> net_iov_type after the netmem_desc. Placing the net_iov_type after
> netmem_desc results in the net_iov_type size having no effect on the
> position or layout of the fields that mirror the struct page.
>
> The layout before this patch:
>
> struct net_iov {
>         union {
>                 struct netmem_desc desc;                 /*     0    48 */
>                 struct {
>                         long unsigned int _flags;        /*     0     8 */
>                         long unsigned int pp_magic;      /*     8     8 */
>                         struct page_pool * pp;           /*    16     8 */
>                         long unsigned int _pp_mapping_pad; /*    24     8 */
>                         long unsigned int dma_addr;      /*    32     8 */
>                         atomic_long_t pp_ref_count;      /*    40     8 */
>                 };                                       /*     0    48 */
>         };                                               /*     0    48 */
>         struct net_iov_area *      owner;                /*    48     8 */
>         enum net_iov_type          type;                 /*    56     8 */
>
>         /* size: 64, cachelines: 1, members: 3 */
> };
>
> The layout after this patch:
>
> struct net_iov {
>         union {
>                 struct netmem_desc desc;                 /*     0    48 */
>                 struct {
>                         long unsigned int _flags;        /*     0     8 */
>                         long unsigned int pp_magic;      /*     8     8 */
>                         struct page_pool * pp;           /*    16     8 */
>                         long unsigned int _pp_mapping_pad; /*    24     8 */
>                         long unsigned int dma_addr;      /*    32     8 */
>                         atomic_long_t pp_ref_count;      /*    40     8 */
>                 };                                       /*     0    48 */
>         };                                               /*     0    48 */
>         struct net_iov_area *      owner;                /*    48     8 */
>         enum net_iov_type          type;                 /*    56     4 */
>
>         /* size: 64, cachelines: 1, members: 3 */
>         /* padding: 4 */
> };
>
> Signed-off-by: Bobby Eshleman <bobbyeshleman@...a.com>

Reviewed-by: Mina Almasry <almasrymina@...gle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ