From: Jacob Keller <jacob.e.keller@intel.com>
To: Daniel Machon <daniel.machon@microchip.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Lars Povlsen <lars.povlsen@microchip.com>,
Steen Hegelund <Steen.Hegelund@microchip.com>,
<horatiu.vultur@microchip.com>,
<jensemil.schulzostergaard@microchip.com>,
<UNGLinuxDriver@microchip.com>,
Richard Cochran <richardcochran@gmail.com>, <horms@kernel.org>,
<justinstitt@google.com>, <gal@nvidia.com>,
<aakash.r.menon@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 06/15] net: sparx5: add constants to match data
Date: Tue, 1 Oct 2024 10:56:38 -0700 [thread overview]
Message-ID: <cadefecc-44aa-443c-a412-723cab46eea9@intel.com> (raw)
In-Reply-To: <20241001-b4-sparx5-lan969x-switch-driver-v1-6-8c6896fdce66@microchip.com>
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@microchip.com>
> Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.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?
next prev parent reply other threads:[~2024-10-01 18:01 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-01 13:50 [PATCH net-next 00/15] net: sparx5: prepare for lan969x switch driver Daniel Machon
2024-10-01 13:50 ` [PATCH net-next 01/15] net: sparx5: add support for private match data Daniel Machon
2024-10-01 17:43 ` Jacob Keller
2024-10-01 13:50 ` [PATCH net-next 03/15] net: sparx5: rename *spx5 to *sparx5 in a few places Daniel Machon
2024-10-01 17:54 ` Jacob Keller
2024-10-01 13:50 ` [PATCH net-next 04/15] net: sparx5: modify SPX5_PORTS_ALL macro Daniel Machon
2024-10-01 17:54 ` Jacob Keller
2024-10-01 13:50 ` [PATCH net-next 05/15] net: sparx5: add *sparx5 argument to a few functions Daniel Machon
2024-10-01 13:50 ` [PATCH net-next 06/15] net: sparx5: add constants to match data Daniel Machon
2024-10-01 17:56 ` Jacob Keller [this message]
2024-10-02 12:47 ` Jakub Kicinski
2024-10-02 13:31 ` Daniel Machon
2024-10-02 14:33 ` Jakub Kicinski
2024-10-02 18:28 ` Daniel Machon
2024-10-01 13:50 ` [PATCH net-next 07/15] net: sparx5: use SPX5_CONST for constants which already have a symbol Daniel Machon
2024-10-01 17:58 ` Jacob Keller
2024-10-01 13:50 ` [PATCH net-next 08/15] net: sparx5: use SPX5_CONST for constants which do not " Daniel Machon
2024-10-01 13:50 ` [PATCH net-next 09/15] net: sparx5: add ops to match data Daniel Machon
2024-10-01 13:50 ` [PATCH net-next 10/15] net: sparx5: ops out chip port to device index/bit functions Daniel Machon
2024-10-01 18:00 ` Jacob Keller
2024-10-02 7:48 ` Daniel Machon
2024-10-01 13:50 ` [PATCH net-next 11/15] net: sparx5: ops out functions for getting certain array values Daniel Machon
2024-10-01 13:50 ` [PATCH net-next 12/15] net: sparx5: ops out function for setting the port mux Daniel Machon
2024-10-01 13:50 ` [PATCH net-next 13/15] net: sparx5: ops out PTP IRQ handler Daniel Machon
2024-10-01 13:50 ` [PATCH net-next 14/15] net: sparx5: ops out function for DSM calendar calculation Daniel Machon
2024-10-01 13:50 ` [PATCH net-next 15/15] net: sparx5: add is_sparx5 macro and use it throughout Daniel Machon
[not found] ` <20241001-b4-sparx5-lan969x-switch-driver-v1-2-8c6896fdce66@microchip.com>
2024-10-01 17:52 ` [PATCH net-next 02/15] net: sparx5: add indirection layer to register macros Jacob Keller
2024-10-02 8:07 ` Daniel Machon
2024-10-01 18:03 ` [PATCH net-next 00/15] net: sparx5: prepare for lan969x switch driver Jacob Keller
2024-10-02 7:47 ` Daniel Machon
2024-10-02 21:44 ` Jacob Keller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cadefecc-44aa-443c-a412-723cab46eea9@intel.com \
--to=jacob.e.keller@intel.com \
--cc=Steen.Hegelund@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=aakash.r.menon@gmail.com \
--cc=daniel.machon@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=horatiu.vultur@microchip.com \
--cc=horms@kernel.org \
--cc=jensemil.schulzostergaard@microchip.com \
--cc=justinstitt@google.com \
--cc=kuba@kernel.org \
--cc=lars.povlsen@microchip.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).