aregm / nff-go

NFF-Go -Network Function Framework for GO (former YANFF)
BSD 3-Clause "New" or "Revised" License
1.38k stars 156 forks source link

How to get packet arriving timestamp? #685

Closed cang233 closed 4 years ago

cang233 commented 4 years ago

I set the

    config := flow.Config{
        CPUList:              "0-3",
        HWRXPacketsTimestamp: true,
    }

and use packet.GetPacketTimestamp() to get timestamp but return 0.

why?

gshimansky commented 4 years ago

This flag only enables capability of a NIC, it has to be supported by hardware to work correctly. AFAIK at the moment only Mellanox NICs support this feature, I implemented this flag for those cards. You can use flow.CheckHWCapability(flow.HWRXPacketsTimestamp) to query whether a network card supports this feature.

cang233 commented 4 years ago

oh,I get it,thanks a lot!