Skip to content

Commit 2e0e148

Browse files
Binary-Eaterkuba-moo
authored andcommitted
tools: ynl: ethtool.py: Output timestamping statistics from tsinfo-get operation
Print the nested stats attribute containing timestamping statistics when the --show-time-stamping flag is used. [root@binary-eater-vm-01 linux-ethtool-ts]# ./tools/net/ynl/ethtool.py --show-time-stamping mlx5_1 Time stamping parameters for mlx5_1: Capabilities: hardware-transmit hardware-receive hardware-raw-clock PTP Hardware Clock: 0 Hardware Transmit Timestamp Modes: off on Hardware Receive Filter Modes: none all Statistics: tx-pkts: 8 tx-lost: 0 tx-err: 0 Signed-off-by: Rahul Rameshbabu <[email protected]> Reviewed-by: Dragos Tatulea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ff8877b commit 2e0e148

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tools/net/ynl/ethtool.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,13 @@ def main():
324324
return
325325

326326
if args.show_time_stamping:
327-
tsinfo = dumpit(ynl, args, 'tsinfo-get')
327+
req = {
328+
'header': {
329+
'flags': 'stats',
330+
},
331+
}
332+
333+
tsinfo = dumpit(ynl, args, 'tsinfo-get', req)
328334

329335
print(f'Time stamping parameters for {args.device}:')
330336

@@ -338,6 +344,9 @@ def main():
338344

339345
print('Hardware Receive Filter Modes:')
340346
[print(f'\t{v}') for v in bits_to_dict(tsinfo['rx-filters'])]
347+
348+
print('Statistics:')
349+
[print(f'\t{k}: {v}') for k, v in tsinfo['stats'].items()]
341350
return
342351

343352
print(f'Settings for {args.device}:')

0 commit comments

Comments
 (0)