[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACKFLimMfDTatETF+iTWkCBhVH80O=SC-u066XsREoQgVEmmpg@mail.gmail.com>
Date: Mon, 10 Jun 2024 16:52:01 -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 Mon, Jun 10, 2024 at 7:00 AM Michael Chan <michael.chan@...adcom.com> wrote:
>
> On Mon, Jun 10, 2024 at 4:38 AM Przemek Kitszel
> <przemyslaw.kitszel@...el.com> wrote:
> >
> > I assume that the first 96 bytes of the current
> > struct hwrm_port_phy_qcfg are the same as here; with that you could wrap
> > those there by struct_group_tagged, giving the very same name as here,
> > but without replicating all the content.
>
> Except for the valid bit at the end of the struct. Let me see if I
> can define the struct_group thing for 95 bytes and add the valid bit
> here. Thanks.
>
The struct_group_tagged() idea works in general. However, the
hwrm_port_phy_qcfg_output struct is generated from yaml and it
contains a lot of #define within the structure. So it looks like this
with struct_group_tagged added:
struct hwrm_port_phy_qcfg_output {
struct_group_tagged(hwrm_port_phy_qcfg_output_legacy, legacy,
__le16 error_code;
__le16 req_type;
__le16 seq_id;
__le16 resp_len;
u8 link;
#define PORT_PHY_QCFG_RESP_LINK_NO_LINK 0x0UL
#define PORT_PHY_QCFG_RESP_LINK_SIGNAL 0x1UL
#define PORT_PHY_QCFG_RESP_LINK_LINK 0x2UL
....
);
....
};
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
move all the #define macros. Maybe in the future when we restructure
these generated structs, we can do it in a better way.
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)
Powered by blists - more mailing lists