[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87v85ovj4d.fsf@nvidia.com>
Date: Thu, 14 Mar 2024 10:01:49 -0700
From: Rahul Rameshbabu <rrameshbabu@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: ahmed.zaki@...el.com, aleksander.lobakin@...el.com,
alexandre.torgue@...s.st.com, andrew@...n.ch, corbet@....net,
davem@...emloft.net, dtatulea@...dia.com, edumazet@...gle.com,
gal@...dia.com, hkallweit1@...il.com, jacob.e.keller@...el.com,
jiri@...nulli.us, joabreu@...opsys.com, justinstitt@...gle.com,
kory.maincent@...tlin.com, leon@...nel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, liuhangbin@...il.com,
maxime.chevallier@...tlin.com, netdev@...r.kernel.org, pabeni@...hat.com,
paul.greenwalt@...el.com, przemyslaw.kitszel@...el.com,
rdunlap@...radead.org, richardcochran@...il.com, saeed@...nel.org,
tariqt@...dia.com, vadim.fedorenko@...ux.dev, vladimir.oltean@....com,
wojciech.drewek@...el.com
Subject: Re: [PATCH RFC v2 1/6] ethtool: add interface to read Tx hardware
timestamping statistics
On Tue, 12 Mar, 2024 16:53:46 -0700 Jakub Kicinski <kuba@...nel.org> wrote:
> On Sat, 9 Mar 2024 00:44:35 -0800 Rahul Rameshbabu wrote:
>> Multiple network devices that support hardware timestamping appear to have
>> common behavior with regards to timestamp handling. Implement common Tx
>> hardware timestamping statistics in a tx_stats struct_group. Common Rx
>> hardware timestamping statistics can subsequently be implemented in a
>> rx_stats struct_group for ethtool_ts_stats.
>
>> Documentation/netlink/specs/ethtool.yaml | 20 +++++++++
>> include/linux/ethtool.h | 21 ++++++++++
>> include/uapi/linux/ethtool_netlink.h | 15 +++++++
>> net/ethtool/tsinfo.c | 52 +++++++++++++++++++++++-
>> 4 files changed, 107 insertions(+), 1 deletion(-)
>
> Feels like we should mention the new stats somehow in
> Documentation/networking/ethtool-netlink.rst
>
>> diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
>> index 197208f419dc..f99b003c78c0 100644
>> --- a/Documentation/netlink/specs/ethtool.yaml
>> +++ b/Documentation/netlink/specs/ethtool.yaml
>> @@ -559,6 +559,21 @@ attribute-sets:
>> -
>> name: tx-lpi-timer
>> type: u32
>> + -
>> + name: ts-stat
>> + attributes:
>> + -
>> + name: pad
>> + type: pad
>
> You can remove the pad entry, and...
>
You need the pad to match with ETHTOOL_A_TS_STAT_PAD (which similar to
other ethtool stats currently defined). Otherwise, you run into the
following.... mm-stat and fec-stat are good examples.
[root@...ary-eater-vm-01 linux-ethtool-ts]# ./tools/net/ynl/ethtool.py --show-time-stamping mlx5_1
Traceback (most recent call last):
File "/root/linux-ethtool-ts/tools/net/ynl/lib/ynl.py", line 598, in _decode
attr_spec = attr_space.attrs_by_val[attr.type]
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 4
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/linux-ethtool-ts/./tools/net/ynl/ethtool.py", line 437, in <module>
main()
File "/root/linux-ethtool-ts/./tools/net/ynl/ethtool.py", line 333, in main
tsinfo = dumpit(ynl, args, 'tsinfo-get', req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/linux-ethtool-ts/./tools/net/ynl/ethtool.py", line 91, in dumpit
reply = ynl.dump(op_name, { 'header': {} } | extra)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/linux-ethtool-ts/tools/net/ynl/lib/ynl.py", line 873, in dump
return self._op(method, vals, [], dump=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/linux-ethtool-ts/tools/net/ynl/lib/ynl.py", line 858, in _op
rsp_msg = self._decode(decoded.raw_attrs, op.attr_set.name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/linux-ethtool-ts/tools/net/ynl/lib/ynl.py", line 607, in _decode
subdict = self._decode(NlAttrs(attr.raw), attr_spec['nested-attributes'], search_attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/linux-ethtool-ts/tools/net/ynl/lib/ynl.py", line 601, in _decode
raise Exception(f"Space '{space}' has no attribute with value '{attr.type}'")
Exception: Space 'ts-stat' has no attribute with value '4'
>> +enum {
>> + ETHTOOL_A_TS_STAT_UNSPEC,
>> + ETHTOOL_A_TS_STAT_PAD,
>> +
>> + ETHTOOL_A_TS_STAT_TX_PKT, /* array, u64 */
>> + ETHTOOL_A_TS_STAT_TX_LOST, /* array, u64 */
>> + ETHTOOL_A_TS_STAT_TX_ERR, /* array, u64 */
>
> I don't think these are arrays.
>
>> +
>> + /* add new constants above here */
>> + __ETHTOOL_A_TS_STAT_CNT,
>> + ETHTOOL_A_TS_STAT_MAX = (__ETHTOOL_A_TS_STAT_CNT - 1)
>> +
>> +};
--
Thanks,
Rahul Rameshbabu
Powered by blists - more mailing lists