ntop / PF_RING

High-speed packet processing framework
http://www.ntop.org
GNU Lesser General Public License v2.1
2.68k stars 353 forks source link

Hardware Timestamping for IGB driver on Intel I350 not working #887

Closed TIE1996 closed 11 months ago

TIE1996 commented 1 year ago

Hi,

we are currently testing the hardware timestamping on our I350 card and it seems that no HW Timestamps are generated / recorded.

Running "zcount -i zc:g0 -X -v 2" gives us the following output: ... [hash=4BB7B5A1] 00 01 02 03 04 05 06 07 08 09 0A 0B 08 00 45 00 00 56 07 DC 00 00 40 11 A8 12 0A 00 00 00 C0 A8 00 01 07 DC 0B B8 00 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [hash=4BB7B5A1] 00 01 02 03 04 05 06 07 08 09 0A 0B 08 00 45 00 00 56 07 DC 00 00 40 11 A8 12 0A 00 00 00 C0 A8 00 01 07 DC 0B B8 00 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [hash=4BB7B5A1] 00 01 02 03 04 05 06 07 08 09 0A 0B 08 00 45 00 00 56 07 DC 00 00 40 11 A8 12 0A 00 00 00 C0 A8 00 01 07 DC 0B B8 00 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ....

The bracket in front of the hash is missing, meaning the TS is 0.

We tested the same configuration on a intel E810 with the ice driver, there the timestamps are working.

The ethtool output for the interface g0 is the following:

Time stamping parameters for g0: Capabilities: hardware-transmit software-transmit hardware-receive software-receive software-system-clock hardware-raw-clock PTP Hardware Clock: 5 Hardware Transmit Timestamp Modes: off on Hardware Receive Filter Modes: none all

cardigliano commented 1 year ago

I pushed a new driver v. 5.14.16 in c95c76aecc8939ab08f07b72ed28d99c5c8929af, this seems to fix the timestamp, at least in our lab

TIE1996 commented 12 months ago

Hi the driver seems to work I can now see the timestamp. However, the timestamp appears to be the system time rather than the time provided by the HW clock on the card, as I am not able to manipulate it via phc_ctl tool. (it works with the ice driver).

cardigliano commented 12 months ago

Please note that the timestamp on igb adapters is a 40-bit counter, that is adjusted using the system time for the high part of the time. That is probably why you see some time shift with respect to what you expect.

TIE1996 commented 12 months ago

Good to know, thank you! I noticed another thing, the packet length in the IGB driver seems to be off by 16 byte. For the ice driver I am receiving the correct packet length. Can you take a look at that or should I open a separate issue?

cardigliano commented 12 months ago

I will check the length, no need to open a separate issue

cardigliano commented 12 months ago

It seems that when stripping the ts, the returned len was correct, while caplen was still including the ts bytes. E.g. on a 60-byte packets, returned len was 60, caplen was 76 (16-byte timestamp). This has been fixed and both len and caplen should return 60 now. A new library will be available soon.