Discussion:
Fault in pcap_list_tstamp_types()?
Anders Broman
2013-12-02 13:50:19 UTC
Permalink
Hi,
Playing with this function I get
pcap_list_tstamp_types, num tstamp_types 3
host
adapter_unsynced
adapter

Then trying to set pcap_set_tstamp_type(pcap_h, PCAP_TSTAMP_ADAPTER);

'eth1' (SIOCSHWTSTAMP failed: Numerical result out of range).

ethtool -T eth1
Time stamping parameters for eth1:
Capabilities:
hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE)
software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE)
hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE)
software-receive (SOF_TIMESTAMPING_RX_SOFTWARE)
software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE)
PTP Hardware Clock: 1
Hardware Transmit Timestamp Modes:
off (HWTSTAMP_TX_OFF)
on (HWTSTAMP_TX_ON)
Hardware Receive Filter Modes:
none (HWTSTAMP_FILTER_NONE)
ptpv1-l4-event (HWTSTAMP_FILTER_PTP_V1_L4_EVENT)
ptpv2-l4-event (HWTSTAMP_FILTER_PTP_V2_L4_EVENT)
ptpv2-l2-event (HWTSTAMP_FILTER_PTP_V2_L2_EVENT)

So it seems libpcap is reporting the availability of HW timestamp when in fact it's not available. Or am I missing something?
(1.6.0-PRE-GIT)

Regards
Anders
Morgan Yang
2014-09-26 07:28:15 UTC
Permalink
Post by Anders Broman
Hi,
Playing with this function I get
pcap_list_tstamp_types, num tstamp_types 3
host
adapter_unsynced
adapter
Then trying to set pcap_set_tstamp_type(pcap_h, PCAP_TSTAMP_ADAPTER);
'eth1' (SIOCSHWTSTAMP failed: Numerical result out of range).
Hi Anders:

I am also coming across the same issue, running libpcap 1.6.0-PRE-GIT,
is this something you've been able to overcome?

Much Thanks
Morgan Yang
Guy Harris
2014-10-08 06:07:38 UTC
Permalink
Post by Anders Broman
So it seems libpcap is reporting the availability of HW timestamp when in fact it's not available.
Somewhere between Linux 3.0 and Linux 3.6, the ethtool ioctl ETHTOOL_GET_TS_INFO was introduced; it allows userland to query the kernel about a particular device to find out what time stamp types it supports.

libpcap does not use that yet.

I have some code to do so, but have not yet had the opportunity to test it.
Loading...