safchain / ethtool

A simple ethtool "like" library for GO
Apache License 2.0
116 stars 69 forks source link

hitting MAX_GSTRINGS limit #45

Closed Stephenxf closed 2 years ago

Stephenxf commented 2 years ago

Hi @safchain We're hitting the MAX_GSTRINGS limit (current value 16384) on some of our hosts where this ethtool package is deployed.

time="2022-02-14T21:56:24Z" level=error msg="Failed to collect ethtool stats, ethtool currently doesn't support more than 16384 entries, received 19338" 

Depending on the NIC driver and some settings, the number of entries "ethtool -S" exposes can be quite different, e.g., with this mellanox NIC and driver, the number of entries goes beyond the limit.

$ ethtool -i enp1s0f0
driver: mlx5_core
version: 5.1-2.3.7
firmware-version: 16.28.4512 (DEL0000000016)
expansion-rom-version:
bus-info: 0000:01:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: yes

Do you see any risk bumping up the MAX_GSTRINGS limit to 20480 or even 32768? If it's okay, I can run some tests and create a PR for the change. Thanks. Appreciate your effort on open-source this package.

safchain commented 2 years ago

@Stephenxf I don't see any problem for bumping to 32768.

Stephenxf commented 2 years ago

@Stephenxf I don't see any problem for bumping to 32768.

Thanks for prompt feedback. I'll raise a PR once I get chance to run some tests with the change.

Stephenxf commented 2 years ago

@safchain I've raised PR #48 for this issue with test result. Please have a look. Thanks.