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]
Date: Tue, 11 Jun 2024 14:01:36 -0700
From: Michael Chan <michael.chan@...adcom.com>
To: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Cc: netdev@...r.kernel.org, edumazet@...gle.com, kuba@...nel.org, 
	pabeni@...hat.com, andrew.gospodarek@...adcom.com, horms@...nel.org, 
	Somnath Kotur <somnath.kotur@...adcom.com>, Pavan Chebbi <pavan.chebbi@...adcom.com>, 
	davem@...emloft.net
Subject: Re: [PATCH net v2] bnxt_en: Cap the size of HWRM_PORT_PHY_QCFG
 forwarded response

On Tue, Jun 11, 2024 at 4:10 AM Przemek Kitszel
<przemyslaw.kitszel@...el.com> wrote:
>
> On 6/11/24 01:52, Michael Chan wrote:
> > The #define within the struct_group generates a lot of warnings with make C=1:
> >
> >    CC [M]  drivers/net/ethernet/broadcom/bnxt/bnxt.o
> >    CHECK   drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > drivers/net/ethernet/broadcom/bnxt/bnxt.c: note: in included file:
> > drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h:4211:9: warning:
> > directive in macro's argument list
> >
> > Because it's a generated file, it's hard to make the drastic change to
>
> is this generated as part of upstream build process or just manually?

This is generated internally for our firmware interface structures and
definitions.

>
> > move all the #define macros.  Maybe in the future when we restructure
> > these generated structs, we can do it in a better way.
>
> You could also just split struct into two and combine them (packed)
> into hwrm_port_phy_qcfg_output and add compat one as combination of
> hwrm_port_phy_qcfg_output + valid bit

What I tried to do was to use struct_group_tagged to wrap the first 95
bytes of the structure.  No changes are required for the existing code
using the structure and that's the good thing.  The new compat.
structure uses the struct_group plus 1 more byte at the end for the
valid bit.  This works fine except for the warning due to the embedded
#define within the struct_group.

>
> If you don't want to do so, please at least document in code that only
> the first 95 bytes match and the last one is different

Will do.  Thanks for the review.

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ