Ethernet counters difference between /sys/class/infiniband/<device>/device/net/<device2>/statistics and /sys/class/net/<device>/statistics/

Hi,

Assuming I have a ConnectX4 device connected to an Ethernet network, driver version MLNX_OFED_LINUX-24.01-0.3.3.1 if it matters.

I wanted to ask, is there a difference between the traffic captured by /sys/class/infiniband/<device>/device/net/<device2>/statistics and /sys/class/net/<device2>/statistics/?

Should we expect to get exactly the same numbers for counters under the two paths? Is there any latency between when one location is updated over the other?

Hi,

In general, these two paths should provide the same statistics for the network card.
However, the /sys/class/infiniband path is specific to Infiniband devices, therefore it is updated via the Infiniband driver stack.
The /sys/class/net path is more of a general linux network device representation and is updated through the standard linux network stack.
Due to these differences, while the values should generally be the same, there might be slight differences due to the update mechanisms and timings. In most cases, if the system is properly tuned, the latency should be minimal and in a stable system, the values should converge and be consistent over time.

If the network is Ethernet, I suggest using the /sys/class/net path as it is more generalized across platforms, while the Infiniband path is more infiniband-specific.

If you still have any additional questions, please feel free to open a case at enterprisesupport@nvidia.com and it will be handled according to entitlement.

Best Regards,
Jonathan.