[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250729184529.149be2c3@kernel.org>
Date: Tue, 29 Jul 2025 18:45:29 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Vadim Fedorenko <vadfed@...a.com>
Cc: Andrew Lunn <andrew@...n.ch>, Michael Chan <michael.chan@...adcom.com>,
Pavan Chebbi <pavan.chebbi@...adcom.com>, Tariq Toukan <tariqt@...dia.com>,
Gal Pressman <gal@...dia.com>, <intel-wired-lan@...ts.osuosl.org>, Donald
Hunter <donald.hunter@...il.com>, Paolo Abeni <pabeni@...hat.com>, Simon
Horman <horms@...nel.org>, <netdev@...r.kernel.org>, Vadim Fedorenko
<vadim.fedorenko@...ux.dev>
Subject: Re: [RFC PATCH] ethtool: add FEC bins histogramm report
On Tue, 29 Jul 2025 03:23:54 -0700 Vadim Fedorenko wrote:
> diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
> index 1063d5d32fea2..3781ced722fee 100644
> --- a/Documentation/netlink/specs/ethtool.yaml
> +++ b/Documentation/netlink/specs/ethtool.yaml
> @@ -1239,6 +1239,30 @@ attribute-sets:
> name: corr-bits
> type: binary
> sub-type: u64
> + -
> + name: hist
> + type: nest
> + multi-attr: True
> + nested-attributes: fec-hist
> + -
> + name: fec-hist-bin-low
> + type: s32
> + -
> + name: fec-hist-bin-high
> + type: s32
> + -
> + name: fec-hist-bin-val
> + type: u64
> + -
> + name: fec-hist
> + subset-of: fec-stat
no need to make this a subset, better to make it its own attr set
> + attributes:
> + -
> + name: fec-hist-bin-low
> + -
> + name: fec-hist-bin-high
> + -
> + name: fec-hist-bin-val
> -
> name: fec
> attr-cnt-name: __ethtool-a-fec-cnt
> +static const struct ethtool_fec_hist_range netdevsim_fec_ranges[] = {
> + { 0, 0},
> + { 1, 3},
> + { 4, 7},
> + { -1, -1}
> +};
Let's add a define for the terminating element?
> +/**
> + * struct ethtool_fec_hist_range - byte range for FEC bins histogram statistics
byte range? thought these are bit errors..
> + * sentinel value of { -1, -1 } is used as marker for end of bins array
> + * @low: low bound of the bin (inclusive)
> + * @high: high bound of the bin (inclusive)
> + */
> + len += nla_total_size_64bit(sizeof(u64) * ETHTOOL_FEC_HIST_MAX);
I don't think it's right, each attr is its own nla_total_size().
Add a nla_total_size(8) to the calculation below
> + /* add FEC bins information */
> + len += (nla_total_size(0) + /* _A_FEC_HIST */
> + nla_total_size(4) + /* _A_FEC_HIST_BIN_LOW */
> + nla_total_size(4)) * /* _A_FEC_HIST_BIN_HI */
> + ETHTOOL_FEC_HIST_MAX;
Powered by blists - more mailing lists