All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Jakub Kicinski <kuba@kernel.org>, Vadim Fedorenko <vadfed@meta.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Michael Chan <michael.chan@broadcom.com>,
	Pavan Chebbi <pavan.chebbi@broadcom.com>,
	Tariq Toukan <tariqt@nvidia.com>, Gal Pressman <gal@nvidia.com>,
	intel-wired-lan@lists.osuosl.org,
	Donald Hunter <donald.hunter@gmail.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org
Subject: Re: [Intel-wired-lan] [RFC PATCH] ethtool: add FEC bins histogramm report
Date: Wed, 30 Jul 2025 10:22:36 +0100	[thread overview]
Message-ID: <15ca2392-1dbd-4f4d-a478-3d8edc32bc90@linux.dev> (raw)
In-Reply-To: <20250729184529.149be2c3@kernel.org>

On 30/07/2025 02:45, Jakub Kicinski wrote:
> 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

like a set for general histogram? or still fec-specific?

> 
>> +    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?

I believe it's about (-1, -1) case. If we end up using (0, 0) then there
is no need to define anything, right?

> 
>> +/**
>> + * 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

got it

> 
>> +		/* 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;


WARNING: multiple messages have this Message-ID (diff)
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Jakub Kicinski <kuba@kernel.org>, Vadim Fedorenko <vadfed@meta.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Michael Chan <michael.chan@broadcom.com>,
	Pavan Chebbi <pavan.chebbi@broadcom.com>,
	Tariq Toukan <tariqt@nvidia.com>, Gal Pressman <gal@nvidia.com>,
	intel-wired-lan@lists.osuosl.org,
	Donald Hunter <donald.hunter@gmail.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org
Subject: Re: [RFC PATCH] ethtool: add FEC bins histogramm report
Date: Wed, 30 Jul 2025 10:22:36 +0100	[thread overview]
Message-ID: <15ca2392-1dbd-4f4d-a478-3d8edc32bc90@linux.dev> (raw)
In-Reply-To: <20250729184529.149be2c3@kernel.org>

On 30/07/2025 02:45, Jakub Kicinski wrote:
> 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

like a set for general histogram? or still fec-specific?

> 
>> +    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?

I believe it's about (-1, -1) case. If we end up using (0, 0) then there
is no need to define anything, right?

> 
>> +/**
>> + * 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

got it

> 
>> +		/* 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;


  reply	other threads:[~2025-07-30  9:22 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29 10:23 [Intel-wired-lan] [RFC PATCH] ethtool: add FEC bins histogramm report Vadim Fedorenko
2025-07-29 10:23 ` Vadim Fedorenko
2025-07-29 13:48 ` [Intel-wired-lan] " Andrew Lunn
2025-07-29 13:48   ` Andrew Lunn
2025-07-29 16:01   ` [Intel-wired-lan] " Vadim Fedorenko
2025-07-29 16:01     ` Vadim Fedorenko
2025-07-29 16:17     ` [Intel-wired-lan] " Andrew Lunn
2025-07-29 16:17       ` Andrew Lunn
2025-07-29 16:36       ` [Intel-wired-lan] " Vadim Fedorenko
2025-07-29 16:36         ` Vadim Fedorenko
2025-07-29 17:31         ` [Intel-wired-lan] " Andrew Lunn
2025-07-29 17:31           ` Andrew Lunn
2025-07-29 18:07           ` [Intel-wired-lan] " Vadim Fedorenko
2025-07-29 18:07             ` Vadim Fedorenko
2025-07-30  1:51             ` [Intel-wired-lan] " Jakub Kicinski
2025-07-30  1:51               ` Jakub Kicinski
2025-07-30  5:39               ` [Intel-wired-lan] " Gal Pressman
2025-07-30  5:39                 ` Gal Pressman
2025-07-30 12:59                 ` [Intel-wired-lan] " Andrew Lunn
2025-07-30 12:59                   ` Andrew Lunn
2025-07-30 13:54                   ` [Intel-wired-lan] " Gal Pressman
2025-07-30 13:54                     ` Gal Pressman
2025-07-30  9:18               ` [Intel-wired-lan] " Vadim Fedorenko
2025-07-30  9:18                 ` Vadim Fedorenko
2025-07-30 13:44                 ` [Intel-wired-lan] " Jakub Kicinski
2025-07-30 13:44                   ` Jakub Kicinski
2025-07-30 14:39                   ` [Intel-wired-lan] " Vadim Fedorenko
2025-07-30 14:39                     ` Vadim Fedorenko
2025-07-30  1:45 ` [Intel-wired-lan] " Jakub Kicinski
2025-07-30  1:45   ` Jakub Kicinski
2025-07-30  9:22   ` Vadim Fedorenko [this message]
2025-07-30  9:22     ` Vadim Fedorenko
2025-07-30 13:45     ` [Intel-wired-lan] " Jakub Kicinski
2025-07-30 13:45       ` Jakub Kicinski
2025-07-30  1:48 ` [Intel-wired-lan] " Jakub Kicinski
2025-07-30  1:48   ` Jakub Kicinski
2025-07-30  2:53 ` kernel test robot
2025-07-30  5:54 ` [Intel-wired-lan] " Gal Pressman
2025-07-30  5:54   ` Gal Pressman
2025-07-30  9:29   ` [Intel-wired-lan] " Vadim Fedorenko
2025-07-30  9:29     ` Vadim Fedorenko
2025-07-30 10:42     ` [Intel-wired-lan] " Gal Pressman
2025-07-30 10:42       ` Gal Pressman
2025-07-30 11:32       ` [Intel-wired-lan] " Vadim Fedorenko
2025-07-30 11:32         ` Vadim Fedorenko
2025-07-30 13:47         ` [Intel-wired-lan] " Gal Pressman
2025-07-30 13:47           ` Gal Pressman
2025-07-30 14:15           ` [Intel-wired-lan] " Andrew Lunn
2025-07-30 14:15             ` Andrew Lunn
2025-07-30 12:08 ` [Intel-wired-lan] " Carolina Jubran
2025-07-30 12:08   ` Carolina Jubran

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=15ca2392-1dbd-4f4d-a478-3d8edc32bc90@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=andrew@lunn.ch \
    --cc=donald.hunter@gmail.com \
    --cc=gal@nvidia.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=tariqt@nvidia.com \
    --cc=vadfed@meta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.