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] [thread-next>] [day] [month] [year] [list]
Message-ID: <cadefecc-44aa-443c-a412-723cab46eea9@intel.com>
Date: Tue, 1 Oct 2024 10:56:38 -0700
From: Jacob Keller <jacob.e.keller@...el.com>
To: Daniel Machon <daniel.machon@...rochip.com>, "David S. Miller"
	<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
	<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Lars Povlsen
	<lars.povlsen@...rochip.com>, Steen Hegelund <Steen.Hegelund@...rochip.com>,
	<horatiu.vultur@...rochip.com>, <jensemil.schulzostergaard@...rochip.com>,
	<UNGLinuxDriver@...rochip.com>, Richard Cochran <richardcochran@...il.com>,
	<horms@...nel.org>, <justinstitt@...gle.com>, <gal@...dia.com>,
	<aakash.r.menon@...il.com>
CC: <netdev@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 06/15] net: sparx5: add constants to match data



On 10/1/2024 6:50 AM, Daniel Machon wrote:
> Add new struct sparx5_consts, containing all the chip constants that are
> known to be different for Sparx5 and lan969x. Also add a macro to access
> the constants.
> 
> Signed-off-by: Daniel Machon <daniel.machon@...rochip.com>
> Reviewed-by: Steen Hegelund <Steen.Hegelund@...rochip.com>
> ---
>  .../net/ethernet/microchip/sparx5/sparx5_main.c    | 21 ++++++++++++++++++++
>  .../net/ethernet/microchip/sparx5/sparx5_main.h    | 23 ++++++++++++++++++++++
>  2 files changed, 44 insertions(+)
> 
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> index 9a8d2e8c02a5..5f3690a59ac1 100644
> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> @@ -953,11 +953,32 @@ static const struct sparx5_regs sparx5_regs = {
>  	.fsize = sparx5_fsize,
>  };
>  
> +static const struct sparx5_consts sparx5_consts = {
> +	.n_ports             = 65,
> +	.n_ports_all         = 70,
> +	.n_hsch_l1_elems     = 64,
> +	.n_hsch_queues       = 8,
> +	.n_lb_groups         = 10,
> +	.n_pgids             = 2113, /* (2048 + n_ports) */
> +	.n_sio_clks          = 3,
> +	.n_own_upsids        = 3,
> +	.n_auto_cals         = 7,
> +	.n_filters           = 1024,
> +	.n_gates             = 1024,
> +	.n_sdlbs             = 4096,
> +	.n_dsm_cal_taxis     = 8,
> +	.buf_size            = 4194280,
> +	.qres_max_prio_idx   = 630,
> +	.qres_max_colour_idx = 638,
> +	.tod_pin             = 4,
> +};
> +
>  static const struct sparx5_match_data sparx5_desc = {
>  	.iomap = sparx5_main_iomap,
>  	.iomap_size = ARRAY_SIZE(sparx5_main_iomap),
>  	.ioranges = 3,
>  	.regs = &sparx5_regs,
> +	.consts = &sparx5_consts,
>  };
>  
>  static const struct of_device_id mchp_sparx5_match[] = {
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
> index 738b86999fd8..91f5a3be829e 100644
> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
> @@ -51,6 +51,8 @@ enum sparx5_vlan_port_type {
>  	SPX5_VLAN_PORT_TYPE_S_CUSTOM /* S-port using custom type */
>  };
>  
> +#define SPX5_CONST(const) sparx5->data->consts->const
> +

I'm not a fan of implicit dependency here. Whats the reason for having
it done this way vs passing something in as a parameter here?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ