Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Tobias Waldekranz <tobias@waldekranz.com>
Cc: davem@davemloft.net, kuba@kernel.org, andrew@lunn.ch,
	f.fainelli@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/4] net: dsa: mv88e6xxx: Give each hw stat an ID
Date: Mon, 4 Dec 2023 18:20:35 +0200	[thread overview]
Message-ID: <20231204162035.7cjjn6jrbp5lsz63@skbuf> (raw)
In-Reply-To: <20231201125812.1052078-3-tobias@waldekranz.com> <20231201125812.1052078-3-tobias@waldekranz.com>

On Fri, Dec 01, 2023 at 01:58:10PM +0100, Tobias Waldekranz wrote:
> +#define MV88E6XXX_HW_STAT_MAPPER(_fn)				   \
> +	_fn(in_good_octets,		8, 0x00, STATS_TYPE_BANK0) \
> +	_fn(in_bad_octets,		4, 0x02, STATS_TYPE_BANK0) \
> +	_fn(in_unicast,			4, 0x04, STATS_TYPE_BANK0) \
> +	_fn(in_broadcasts,		4, 0x06, STATS_TYPE_BANK0) \
> +	_fn(in_multicasts,		4, 0x07, STATS_TYPE_BANK0) \
> +	_fn(in_pause,			4, 0x16, STATS_TYPE_BANK0) \
> +	_fn(in_undersize,		4, 0x18, STATS_TYPE_BANK0) \
> +	_fn(in_fragments,		4, 0x19, STATS_TYPE_BANK0) \
> +	_fn(in_oversize,		4, 0x1a, STATS_TYPE_BANK0) \
> +	_fn(in_jabber,			4, 0x1b, STATS_TYPE_BANK0) \
> +	_fn(in_rx_error,		4, 0x1c, STATS_TYPE_BANK0) \
> +	_fn(in_fcs_error,		4, 0x1d, STATS_TYPE_BANK0) \
> +	_fn(out_octets,			8, 0x0e, STATS_TYPE_BANK0) \
> +	_fn(out_unicast,		4, 0x10, STATS_TYPE_BANK0) \
> +	_fn(out_broadcasts,		4, 0x13, STATS_TYPE_BANK0) \
> +	_fn(out_multicasts,		4, 0x12, STATS_TYPE_BANK0) \
> +	_fn(out_pause,			4, 0x15, STATS_TYPE_BANK0) \
> +	_fn(excessive,			4, 0x11, STATS_TYPE_BANK0) \
> +	_fn(collisions,			4, 0x1e, STATS_TYPE_BANK0) \
> +	_fn(deferred,			4, 0x05, STATS_TYPE_BANK0) \
> +	_fn(single,			4, 0x14, STATS_TYPE_BANK0) \
> +	_fn(multiple,			4, 0x17, STATS_TYPE_BANK0) \
> +	_fn(out_fcs_error,		4, 0x03, STATS_TYPE_BANK0) \
> +	_fn(late,			4, 0x1f, STATS_TYPE_BANK0) \
> +	_fn(hist_64bytes,		4, 0x08, STATS_TYPE_BANK0) \
> +	_fn(hist_65_127bytes,		4, 0x09, STATS_TYPE_BANK0) \
> +	_fn(hist_128_255bytes,		4, 0x0a, STATS_TYPE_BANK0) \
> +	_fn(hist_256_511bytes,		4, 0x0b, STATS_TYPE_BANK0) \
> +	_fn(hist_512_1023bytes,		4, 0x0c, STATS_TYPE_BANK0) \
> +	_fn(hist_1024_max_bytes,	4, 0x0d, STATS_TYPE_BANK0) \
> +	_fn(sw_in_discards,		4, 0x10, STATS_TYPE_PORT)  \
> +	_fn(sw_in_filtered,		2, 0x12, STATS_TYPE_PORT)  \
> +	_fn(sw_out_filtered,		2, 0x13, STATS_TYPE_PORT)  \
> +	_fn(in_discards,		4, 0x00, STATS_TYPE_BANK1) \
> +	_fn(in_filtered,		4, 0x01, STATS_TYPE_BANK1) \
> +	_fn(in_accepted,		4, 0x02, STATS_TYPE_BANK1) \
> +	_fn(in_bad_accepted,		4, 0x03, STATS_TYPE_BANK1) \
> +	_fn(in_good_avb_class_a,	4, 0x04, STATS_TYPE_BANK1) \
> +	_fn(in_good_avb_class_b,	4, 0x05, STATS_TYPE_BANK1) \
> +	_fn(in_bad_avb_class_a,		4, 0x06, STATS_TYPE_BANK1) \
> +	_fn(in_bad_avb_class_b,		4, 0x07, STATS_TYPE_BANK1) \
> +	_fn(tcam_counter_0,		4, 0x08, STATS_TYPE_BANK1) \
> +	_fn(tcam_counter_1,		4, 0x09, STATS_TYPE_BANK1) \
> +	_fn(tcam_counter_2,		4, 0x0a, STATS_TYPE_BANK1) \
> +	_fn(tcam_counter_3,		4, 0x0b, STATS_TYPE_BANK1) \
> +	_fn(in_da_unknown,		4, 0x0e, STATS_TYPE_BANK1) \
> +	_fn(in_management,		4, 0x0f, STATS_TYPE_BANK1) \
> +	_fn(out_queue_0,		4, 0x10, STATS_TYPE_BANK1) \
> +	_fn(out_queue_1,		4, 0x11, STATS_TYPE_BANK1) \
> +	_fn(out_queue_2,		4, 0x12, STATS_TYPE_BANK1) \
> +	_fn(out_queue_3,		4, 0x13, STATS_TYPE_BANK1) \
> +	_fn(out_queue_4,		4, 0x14, STATS_TYPE_BANK1) \
> +	_fn(out_queue_5,		4, 0x15, STATS_TYPE_BANK1) \
> +	_fn(out_queue_6,		4, 0x16, STATS_TYPE_BANK1) \
> +	_fn(out_queue_7,		4, 0x17, STATS_TYPE_BANK1) \
> +	_fn(out_cut_through,		4, 0x18, STATS_TYPE_BANK1) \
> +	_fn(out_octets_a,		4, 0x1a, STATS_TYPE_BANK1) \
> +	_fn(out_octets_b,		4, 0x1b, STATS_TYPE_BANK1) \
> +	_fn(out_management,		4, 0x1f, STATS_TYPE_BANK1) \
> +	/*  */
> +
> +#define MV88E6XXX_HW_STAT_ENTRY(_string, _size, _reg, _type) \
> +	{ #_string, _size, _reg, _type },

I think it would look better to take the comma out of this macro and put
it into its callers, so that enums and arrays have the natural separators
between elements.

> +static const struct mv88e6xxx_hw_stat mv88e6xxx_hw_stats[] = {
> +	MV88E6XXX_HW_STAT_MAPPER(MV88E6XXX_HW_STAT_ENTRY)
> +};
> +
> +#define MV88E6XXX_HW_STAT_ENUM(_string, _size, _reg, _type) \
> +	MV88E6XXX_HW_STAT_ID_ ## _string,
> +enum mv88e6xxx_hw_stat_id {
> +	MV88E6XXX_HW_STAT_MAPPER(MV88E6XXX_HW_STAT_ENUM)
> +
> +	MV88E6XXX_HW_STAT_ID_MAX
>  };

  reply	other threads:[~2023-12-04 16:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 12:58 [PATCH net-next 0/4] net: dsa: mv88e6xxx: Add "eth-mac" and "rmon" counter group support Tobias Waldekranz
2023-12-01 12:58 ` [PATCH net-next 1/4] net: dsa: mv88e6xxx: Create API to read a single stat counter Tobias Waldekranz
2023-12-04 16:18   ` Vladimir Oltean
2023-12-01 12:58 ` [PATCH net-next 2/4] net: dsa: mv88e6xxx: Give each hw stat an ID Tobias Waldekranz
2023-12-04 16:20   ` Vladimir Oltean [this message]
2023-12-01 12:58 ` [PATCH net-next 3/4] net: dsa: mv88e6xxx: Add "eth-mac" counter group support Tobias Waldekranz
2023-12-04 16:34   ` Vladimir Oltean
2023-12-01 12:58 ` [PATCH net-next 4/4] net: dsa: mv88e6xxx: Add "rmon" " Tobias Waldekranz
2023-12-04 16:48 ` [PATCH net-next 0/4] net: dsa: mv88e6xxx: Add "eth-mac" and " Vladimir Oltean

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=20231204162035.7cjjn6jrbp5lsz63@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tobias@waldekranz.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